post_type = 'testimonial'; $this->token = esc_attr( $token ); $this->singular = esc_html( $singular ); $this->plural = esc_html( $plural ); if ( '' == $this->singular ) $this->singular = __( 'Category', WFT_DOMAIN ); if ( '' == $this->plural ) $this->plural = __( 'Categories', WFT_DOMAIN ); $this->args = wp_parse_args( $args, $this->_get_default_args() ); } // End __construct() /** * Return an array of default arguments. * @access private * @since 1.3.0 * @return array Default arguments. */ private function _get_default_args () { return array( 'labels' => $this->_get_default_labels(), 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'show_in_nav_menus' => false, 'show_tagcloud' => false ); } // End _get_default_args() /** * Return an array of default labels. * @access private * @since 1.3.0 * @return array Default labels. */ private function _get_default_labels () { return array( 'name' => sprintf( _x( '%s', 'taxonomy general name', WFT_DOMAIN ), $this->plural ), 'singular_name' => sprintf( _x( '%s', 'taxonomy singular name', WFT_DOMAIN ), $this->singular ), 'search_items' => sprintf( __( 'Search %s', WFT_DOMAIN ), $this->plural ), 'all_items' => sprintf( __( 'All %s', WFT_DOMAIN ), $this->plural ), 'parent_item' => sprintf( __( 'Parent %s', WFT_DOMAIN ), $this->singular ), 'parent_item_colon' => sprintf( __( 'Parent %s:', WFT_DOMAIN ), $this->singular ), 'edit_item' => sprintf( __( 'Edit %s', WFT_DOMAIN ), $this->singular ), 'update_item' => sprintf( __( 'Update %s', WFT_DOMAIN ), $this->singular ), 'add_new_item' => sprintf( __( 'Add New %s', WFT_DOMAIN ), $this->singular ), 'new_item_name' => sprintf( __( 'New %s Name', WFT_DOMAIN ), $this->singular ), 'menu_name' => sprintf( __( '%s', WFT_DOMAIN ), $this->plural ) ); } // End _get_default_labels() /** * Register the taxonomy. * @access public * @since 1.3.0 * @return void */ public function register () { register_taxonomy( esc_attr( $this->token ), esc_attr( $this->post_type ), (array)$this->args ); } // End register() } // End Class ?>