true]); $public = get_taxonomies([ '_builtin' => false, 'public' => true, ]); $private = get_taxonomies([ '_builtin' => false, 'public' => false, ]); $registered_taxonomies = array_merge($core, $public, $private); wp_localize_script('st-taxonomies', 'taxopress_tax_data', [ 'confirm' => esc_html__('Are you sure you want to delete this? Deleting will NOT remove created content.', 'simple-tags'), 'no_associated_type' => esc_html__('Please select at least one post type.', 'simple-tags'), 'existing_taxonomies' => $registered_taxonomies, 'integer_error' => esc_html__('Taxonomy slug cannot be numbers only.', 'simple-tags'), ] ); } } public static function set_screen($status, $option, $value) { return $value; } /** Singleton instance */ public static function get_instance() { if (!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; } /** * Add WP admin menu for Tags * * @return void * @author Olatechpro */ public function admin_menu() { $hook = add_submenu_page( self::MENU_SLUG, esc_html__('Taxonomies', 'simple-tags'), esc_html__('Taxonomies', 'simple-tags'), 'simple_tags', 'st_taxonomies', [ $this, 'page_manage_taxonomies', ] ); if(taxopress_is_screen_main_page()){ add_action("load-$hook", [$this, 'screen_option']); } } /** * Screen options */ public function screen_option() { $option = 'per_page'; $args = [ 'label' => esc_html__('Number of items per page', 'simple-tags'), 'default' => 20, 'option' => 'st_taxonomies_per_page' ]; add_screen_option($option, $args); $this->terms_table = new Taxonomy_List(); } /** * Method for build the page HTML manage tags * * @return void * @author Olatechpro */ public function page_manage_taxonomies() { // Default order if (!isset($_GET['order'])) { $_GET['order'] = 'name-asc'; } settings_errors(__CLASS__); if (!isset($_GET['add'])) { //all tax ?>