diff --git a/includes/class-tni-core-custom-fields.php b/includes/class-tni-core-custom-fields.php index 84f6cce..d87372f 100644 --- a/includes/class-tni-core-custom-fields.php +++ b/includes/class-tni-core-custom-fields.php @@ -162,22 +162,6 @@ public function register_field_groups() { 'toolbar' => 'full', 'media_upload' => 'yes', ), - array ( - 'key' => 'field_audio_url', - 'label' => __( 'Audio URL', 'tni-core' ), - 'name' => 'audio_url', - 'type' => 'url', - 'instructions' => '', - 'required' => 0, - 'conditional_logic' => 0, - 'wrapper' => array ( - 'width' => '', - 'class' => '', - 'id' => '', - ), - 'default_value' => '', - 'placeholder' => '', - ), ), 'location' => array ( array ( @@ -313,6 +297,62 @@ public function register_field_groups() { 'description' => '', )); + + if( function_exists('acf_add_local_field_group') ) { + + /** + * Add `audio_url` field to posts and blogs + * @since 1.2.10 + */ + acf_add_local_field_group( array( + 'key' => 'group_post_audio', + 'title' => __( 'Post Audio', 'tni-core' ), + 'fields' => array ( + array ( + 'key' => 'field_audio_url', + 'label' => __( 'Audio URL', 'tni-core' ), + 'name' => 'audio_url', + 'type' => 'url', + 'instructions' => '', + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array ( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'default_value' => '', + 'placeholder' => '', + ), + ), + 'location' => array ( + array ( + array ( + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'blogs', + ), + ), + array ( + array ( + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'post', + ), + ), + ), + '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' ), diff --git a/readme.txt b/readme.txt index 86f8c7c..3d72f53 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: misfist Tags: custom Requires at least: 4.7 Tested up to: 4.8 -Version: 1.2.10 +Version: 1.2.11 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -22,6 +22,9 @@ This section describes how to install the plugin and get it working. == Changelog == += 1.2.11 October 3, 2017 = +* #92 Added `audio_url` field to blogs post type. @link https://github.com/thenewinquiry/tni-theme/issues/92 + = 1.2.10 Sept 15, 2017 = * Reduced unauthorized post transient cache time * Enabled unauthorized post transient clearing on post publish diff --git a/tni-core-functionality.php b/tni-core-functionality.php index d1e9687..b2120bd 100644 --- a/tni-core-functionality.php +++ b/tni-core-functionality.php @@ -10,7 +10,7 @@ * Text Domain: tni-core * Domain Path: /languages * - * Version: 1.2.10 + * Version: 1.2.11 * * @package Tni_Core_Functionality */ @@ -52,7 +52,7 @@ * @return object Tni_Core */ function Tni_Core() { - $instance = Tni_Core::instance( __FILE__, 'l.2.9' ); + $instance = Tni_Core::instance( __FILE__, 'l.2.11' ); return $instance; }