From ad662744dcf72b94c2ee6da3c4ac95d9a3c2b0f6 Mon Sep 17 00:00:00 2001 From: Pea Date: Tue, 2 May 2017 20:32:55 -0400 Subject: [PATCH 1/2] Added SEO Description Field Added `seo_description` field --- includes/class-tni-core-custom-fields.php | 64 +++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/includes/class-tni-core-custom-fields.php b/includes/class-tni-core-custom-fields.php index f672a81..b3184e7 100644 --- a/includes/class-tni-core-custom-fields.php +++ b/includes/class-tni-core-custom-fields.php @@ -143,6 +143,70 @@ public function register_field_groups() { 'menu_order' => 0, )); + acf_add_local_field_group( array( + 'key' => 'group_seo_info', + 'title' => 'SEO Information', + 'fields' => array ( + array ( + 'key' => 'field_seo_description', + 'label' => __( 'SEO Description', 'tni-core' ), + 'name' => 'seo_description', + 'type' => 'textarea', + 'instructions' => __( 'Text that appears with article when shared on social networks.', 'tni' ), + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array ( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'default_value' => '', + 'placeholder' => '', + 'maxlength' => '', + 'rows' => '', + 'new_lines' => 'wpautop', + ), + ), + 'location' => array ( + array ( + array ( + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'post', + ), + ), + array ( + array ( + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'page', + ), + ), + array ( + array ( + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'magazines', + ), + ), + array ( + array ( + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'blogs', + ), + ), + ), + 'menu_order' => 0, + 'position' => 'normal', + 'style' => 'default', + 'label_placement' => 'top', + 'instruction_placement' => 'label', + 'hide_on_screen' => '', + 'active' => 1, + 'description' => '', + )); + register_field_group( array ( 'id' => 'acf_magazine', 'title' => __( 'Magazine Details', 'tni-core' ), From 31353f6cb0446174f1a9dc7b1f44e66f1193fee8 Mon Sep 17 00:00:00 2001 From: Pea Date: Tue, 2 May 2017 20:33:22 -0400 Subject: [PATCH 2/2] Added `jetpack_open_graph_tags` filter Added `jetpack_open_graph_tags` filter to set `og:description` to `seo_description`, if it exists --- includes/jetpack-customization.php | 32 ++++++++++++++++++++++++++++++ readme.txt | 7 ++++++- tni-core-functionality.php | 6 ++++-- 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 includes/jetpack-customization.php diff --git a/includes/jetpack-customization.php b/includes/jetpack-customization.php new file mode 100644 index 0000000..0b71b0a --- /dev/null +++ b/includes/jetpack-customization.php @@ -0,0 +1,32 @@ +