enqueue_scripts(); // var $this->taxonomy = $taxonomy; // hooks add_action('admin_enqueue_scripts', array($this, 'term_enqueue_scripts'), 15); // must be priority 15 add_action('admin_footer', array($this, 'term_footer')); } /** * load_terms * * @param $taxonomy */ function load_terms($taxonomy){ // enqueue $this->enqueue_scripts(); // hooks add_action('admin_footer', array($this, 'terms_footer')); } /** * add_term_meta_boxes * * @param $taxonomy * @param $term */ function add_term_meta_boxes($taxonomy, $term){ // post id $post_id = 'term_' . $term->term_id; // screen $screen = get_current_screen(); // field groups $field_groups = acf_get_field_groups(array( 'taxonomy' => $taxonomy )); if($field_groups){ // form data acf_form_data(array( 'screen' => 'taxonomy', 'post_id' => $post_id, )); $this->add_metaboxes($field_groups, $post_id, $screen); } // Sidebar submit add_meta_box('submitdiv', __('Edit'), array($this, 'render_metabox_submit'), $screen, 'side', 'high', 'term'); } /** * term_enqueue_scripts */ function term_enqueue_scripts(){ // remove acf render // advanced-custom-fields-pro/includes/forms/form-taxonomy.php acfe_remove_action("{$this->taxonomy}_edit_form", array('acf_form_taxonomy', 'edit_term')); } /** * term_footer */ function term_footer(){ global $tag, $tax; ?>
cap->edit_terms); ?>