Provide some simple functionality to register some hooks that could not register inside the WordPress themes
דירוגים
4
עודכן לאחרונה
April 4, 2021
גרסה
2.2
התקנות פעילות
600

Provide some simple functionality to register some hooks that could not register inside the WordPress themes

Quick Start

Get instance of main class.

LibWp();

Post type

LibWp()->postType();

Taxonomy

LibWp()->taxonomy();

Register a new taxonomy

LibWp()->postType() ->setName('book') ->setLabels([ 'name' => _x('Books', 'Post type general name', 'textdomain'), 'singular_name' => _x('Book', 'Post type singular name', 'textdomain'), 'menu_name' => _x('Books', 'Admin Menu text', 'textdomain'), 'add_new' => __('Add New', 'textdomain'), 'edit_item' => __('Edit Book', 'textdomain'), 'view_item' => __('View Book', 'textdomain'), 'all_items' => __('All Books', 'textdomain'), ]) ->setFeatures([ 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ]) ->setArgument('show_ui', true) ->register();

Register a new taxonomy belongs to previous post type

LibWp()->taxonomy() ->setName('types') ->setPostTypes('book') ->setArgument('show_in_rest', true) ->setLabels([ 'name' => _x('Types', 'taxonomy general name', 'textdomain'), 'singular_name' => _x('Type', 'taxonomy singular name', 'textdomain'), 'search_items' => __('Search Types', 'textdomain'), 'all_items' => __('All Types', 'textdomain'), 'edit_item' => __('Edit Type', 'textdomain'), 'add_new_item' => __('Add New Type', 'textdomain'), 'new_item_name' => __('New Type Name', 'textdomain'), 'menu_name' => __('Types', 'textdomain'), ]) ->register();
חינםבתוכנית Creator
בביצוע ההתקנה, אנחנו מקבלים את הסכמתך לתנאי השירות של WordPress.com ולתנאים של התוסף של הצד השלישי.
התקנות פעילות
600
נבדקו עד
5.6.14