2017-03-01 19:51:34 -05:00
|
|
|
<?php
|
2019-04-22 17:28:46 -03:00
|
|
|
/**
|
|
|
|
|
* Genesis Simple Sidebars Term.
|
|
|
|
|
*
|
|
|
|
|
* @package genesis-simple-sidebars
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class Genesis Simple Sidebars Term.
|
|
|
|
|
*/
|
2017-03-01 19:51:34 -05:00
|
|
|
class Genesis_Simple_Sidebars_Term {
|
|
|
|
|
|
2019-04-22 17:28:46 -03:00
|
|
|
/**
|
|
|
|
|
* Init functiom.
|
|
|
|
|
*/
|
2017-03-01 19:51:34 -05:00
|
|
|
public function init() {
|
|
|
|
|
|
2019-02-08 18:38:56 +01:00
|
|
|
add_action( 'init', array( $this, 'add_term_fields' ), 12 );
|
2017-03-01 19:51:34 -05:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-22 17:28:46 -03:00
|
|
|
/**
|
|
|
|
|
* Adds term fields.
|
|
|
|
|
*/
|
2017-03-01 19:51:34 -05:00
|
|
|
public function add_term_fields() {
|
|
|
|
|
|
|
|
|
|
$taxonomies = Genesis_Simple_Sidebars()->core->get_public_taxonomies();
|
|
|
|
|
|
|
|
|
|
if ( ! empty( $taxonomies ) && is_admin() && is_array( $taxonomies ) ) {
|
|
|
|
|
|
|
|
|
|
foreach ( $taxonomies as $tax ) {
|
|
|
|
|
add_action( "{$tax}_edit_form", array( $this, 'term_sidebar_form' ), 9, 2 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-22 17:28:46 -03:00
|
|
|
/**
|
|
|
|
|
* Import the sidebar form.
|
|
|
|
|
*
|
|
|
|
|
* @param string $tag Tag.
|
|
|
|
|
* @param string $taxonomy Taxonomy.
|
|
|
|
|
*/
|
2017-03-01 19:51:34 -05:00
|
|
|
public function term_sidebar_form( $tag, $taxonomy ) {
|
|
|
|
|
|
2019-04-22 17:28:46 -03:00
|
|
|
require_once GENESIS_SIMPLE_SIDEBARS_PLUGIN_DIR . '/includes/views/term-edit-sidebar-form.php';
|
2017-03-01 19:51:34 -05:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|