Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Registers a new post type
- * @uses $wp_post_types Inserts new post type object into the list
- *
- * @param string Post type key, must not exceed 20 characters
- * @param array|string See optional args description above.
- * @return object|WP_Error the registered post type object, or an error object
- */
- function dzmitrockpress_css_post() {
- $labels = array(
- 'name' => 'Css свойства',
- 'singular_name' => 'Css свойство',
- 'add_new' => 'Добавить Css свойство',
- 'add_new_item' => 'Добавить Css свойство',
- 'edit_item' => 'Редактировать Css свойство',
- 'new_item' => 'Новое Css свойство',
- 'view_item' => 'Смотреть Css свойство',
- 'search_items' => 'Искать Css свойства',
- 'not_found' => 'Не найдено Css свойств',
- 'not_found_in_trash' => 'Не найдено Css свойства в корзине',
- 'parent_item_colon' => 'Дочернее Css свойство:',
- 'menu_name' => 'Css свойства',
- );
- $args = array(
- 'labels' => $labels,
- 'hierarchical' => false,
- 'description' => 'Css свойства',
- 'taxonomies' => array('css-category'),
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_admin_bar' => true,
- 'menu_position' => null,
- 'menu_icon' => 'dashicons-star-empty',
- 'show_in_nav_menus' => true,
- 'publicly_queryable' => true,
- 'exclude_from_search' => false,
- 'has_archive' => true,
- 'query_var' => true,
- 'can_export' => true,
- 'rewrite' => true,
- 'show_in_rest' => true,
- 'capability_type' => 'post',
- 'supports' => array(
- 'title',
- 'editor',
- 'author',
- 'thumbnail',
- 'excerpt',
- 'custom-fields',
- 'trackbacks',
- 'comments',
- 'revisions',
- 'page-attributes',
- 'post-formats',
- ),
- );
- register_post_type( 'css', $args );
- }
- add_action( 'init', 'dzmitrockpress_css_post' );
- /**
- * Create a taxonomy
- *
- * @uses Inserts new taxonomy object into the list
- * @uses Adds query vars
- *
- * @param string Name of taxonomy object
- * @param array|string Name of the object type for the taxonomy object.
- * @param array|string Taxonomy arguments
- * @return null|WP_Error WP_Error if errors, otherwise null.
- */
- function tax_css_category() {
- $labels = array(
- 'name' => _x( 'Рубрика свойства', 'Taxonomy plural name', 'text-domain' ),
- 'singular_name' => _x( 'Рубрики свойства', 'Taxonomy singular name', 'text-domain' ),
- 'search_items' => __( 'Search Рубрика свойства', 'text-domain' ),
- 'popular_items' => __( 'Popular Рубрика свойства', 'text-domain' ),
- 'all_items' => __( 'All Рубрика свойства', 'text-domain' ),
- 'parent_item' => __( 'Parent Рубрики свойства', 'text-domain' ),
- 'parent_item_colon' => __( 'Parent Рубрики свойства', 'text-domain' ),
- 'edit_item' => __( 'Edit Рубрики свойства', 'text-domain' ),
- 'update_item' => __( 'Update Рубрики свойства', 'text-domain' ),
- 'add_new_item' => __( 'Add New Рубрики свойства', 'text-domain' ),
- 'new_item_name' => __( 'New Рубрики свойства Name', 'text-domain' ),
- 'add_or_remove_items' => __( 'Add or remove Рубрика свойства', 'text-domain' ),
- 'choose_from_most_used' => __( 'Choose from most used Рубрика свойства', 'text-domain' ),
- 'menu_name' => __( 'Рубрики свойства', 'text-domain' ),
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'show_in_nav_menus' => true,
- 'show_admin_column' => false,
- 'hierarchical' => true,
- 'show_tagcloud' => true,
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => true,
- 'query_var' => true,
- 'capabilities' => array(),
- );
- register_taxonomy( 'css_category', array( 'css' ), $args );
- }
- add_action( 'init', 'tax_css_category' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement