The code you posted is an incomplete copy/paste of the code from the tutorial you linked. labels
is a parameter within the $args
array:
$labels_array = array(
'name' => _x('Books', 'post type general name')
);
$args = array(
'labels' => $labels_array
);
register_post_type( 'book', $args );
$args
is an array that contains an array of label parameters.
Related Posts:
- Order by & include array by specific post ids
- Get list of all registered post types slugs
- get post type plural
- Limit the post for differents custom post type in the same wp_query
- array_pop() expects array, boolean given for $event_type_term ->slug
- Save custom post type in different table
- Custom Post Type and taxonomies’s labels localization not working
- How can I use a different default admin menu icon for custom post type?
- Automatically adding meta data to posts or multiple query help
- Create a post in custom post type using field in registration form after users submit form
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- Save an array from drop-down in custom meta box
- How to store multiple values in 1 meta_key with radio input?
- Display a CPT based on a metabox selection
- Display post content with respect to its title?
- Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
- Limit the post for differents custom post type in the same wp_query
- Get an array wich contains the post_name of every post that has the custom post_type “pelicula”
- Add first letter of titles to array, then compare arrays
- Query Custom Post Types with checkboxes
- Change “empty trash” button text?
- Create Array from custom post type to display a slider
- Give each post type label a different color?
- Inefficient Query Confusion
- Querying multiple values from a single key
- Check if user has comment on current post
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- How do I disply an array inside a custom post type?
- Custom Post Type Field Array parsing [closed]
- Getting custom post types to properly display alphabetically
- How can I loop at a Specific Taxonomy from a custom post type?
- Update value inside array update_post_meta
- Custom archive page for custom taxonomy and pagination issue
- Get an array of the number of post per year of a custom post type (WordPress)
- Query when is one or several values
- Staggering featured post using ‘sticky’
- If custom taxonomy exist on post?
- Displaying image instead of post label in wordpress
- Convert Custom Post Data to Javascript Array for Autocomplete
- Changing menu label to post name for custom post type
- Trying to get custom post type attachment images to function in indexed array
- CPT and metabox: create multi checkbox by using array?
- Pulling in Related Posts based on Post Type array
- WordPress custom field images not getting inserted into array
- Meta-Box to add multiple items one at a time and on publish save all
- Custom Post Type Author Array Problem
- taxonomy terms array not working
- Display custom posts in checkbox list
- posting twice from an array?
- create functions based on array values
- Display custom post type attached media file sizes
- post__in select all custom posts and not the selected array of ids
- Allow member to have access to custom post type only. Permission to only edit their own posts
- add_rewrite_endpoint() not working for custom post type archives
- Custom post type URL with post ID that allows archiving and paging
- How do i display the post type title?
- Sorting a query by custom field date
- WordPress Custom Post Type Category Page
- White screen error for a custom theme
- disable /feed/ for custom post type
- Display Post Author for Custom Post Type in Edit-Post Screen
- How to query different post types in specific order?
- How can I display my custom metaboxes on a custom post template?
- “Allow Comments” box cannot be checked
- Second Custom Post Type Archive
- Delete link on single-custom.php with redirection
- Single Template for Custom Post Type stops working after WordPress 5.4 update
- Categories sorting
- Wp_query: sort by PHP variable
- How can I make my custom posts appear in their assigned category url?
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- child of post type (custom)
- Rewrite rules for custom posts types
- Add tag to a custom post type doesn’t change the total of custom post type in backend
- How to Create Columns with WordPress and CPTUI display page ?
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Best way to specify “article type” in URL
- How can I output WPAlchemy repeating fields meta values in my page template?
- Cannot upload featured image to a custom post type
- Custom post pagination trouble
- Best Way to Query Custom Taxonomies Used on Custom Post Type
- Retrieve posts by author
- Question about link two types of data in wordpress
- Adding Category Name in Slug in Custom Post Type
- How to mass get post editor URLs
- Custom Post Type add_rewrite_rule
- Post type to appear on every page on site
- Custom search for a custom post type in WordPress
- Metabox is not saving
- WPML – Auto Duplicate Post Issue
- Loop carousel slider in wordpress
- How can I add a “fake” parent into the permalink?
- Best way to structure article and issue relationship for CPT
- Custom post types working in functions.php but not in plugin
- Missing categories for Custom Taxonomy and Custom Posts
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- How do I add a checkbox option to this custom post type code?
- Show one of the taxonomies always as default
- From form submission values – dynamically update CPT “has_archive” slug and custom taxonomy “rewrite” slug value
- Dynamically count the number of custom post types associated to a custom taxonomy