Skip to content

Commit

Permalink
Added audio_url field to blogs post type
Browse files Browse the repository at this point in the history
#92 Added `audio_url` field to blogs post type. @link thenewinquiry/tni-theme#92
  • Loading branch information
misfist committed Oct 4, 2017
1 parent 1222d51 commit f79841b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 19 deletions.
72 changes: 56 additions & 16 deletions includes/class-tni-core-custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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' ),
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tni-core-functionality.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Text Domain: tni-core
* Domain Path: /languages
*
* Version: 1.2.10
* Version: 1.2.11
*
* @package Tni_Core_Functionality
*/
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit f79841b

Please sign in to comment.