PHP code for CPTs generated by the plugin has a new label called "text_domain"
Support › MB Custom Post Type › PHP code for CPTs generated by the plugin has a new label called "text_domain"
- This topic has 3 replies, 2 voices, and was last updated 10 minutes ago by
Peter.
-
AuthorPosts
-
October 3, 2025 at 5:49 AM #49077
A.
ParticipantWhen I create a custom post type using Meta Box AIO 3.1.1 I noticed that the generated PHP code adds an extra label that, as far as I know, is not valid. Take a look that this sample code generated by the plugin, I am referring to the last line in
$labels
:
'text_domain' => esc_html__( 'your-textdomain', 'your-textdomain' ),
<?php add_action( 'init', 'your_prefix_register_post_type' ); function your_prefix_register_post_type() { $labels = [ 'name' => esc_html__( 'Courses', 'your-textdomain' ), 'singular_name' => esc_html__( 'Course', 'your-textdomain' ), 'add_new' => esc_html__( 'Add New', 'your-textdomain' ), 'add_new_item' => esc_html__( 'Add New Course', 'your-textdomain' ), 'edit_item' => esc_html__( 'Edit Course', 'your-textdomain' ), 'new_item' => esc_html__( 'New Course', 'your-textdomain' ), 'view_item' => esc_html__( 'View Course', 'your-textdomain' ), 'view_items' => esc_html__( 'View Courses', 'your-textdomain' ), 'search_items' => esc_html__( 'Search Courses', 'your-textdomain' ), 'not_found' => esc_html__( 'No courses found.', 'your-textdomain' ), 'not_found_in_trash' => esc_html__( 'No courses found in Trash.', 'your-textdomain' ), 'parent_item_colon' => esc_html__( 'Parent Course:', 'your-textdomain' ), 'all_items' => esc_html__( 'All Courses', 'your-textdomain' ), 'archives' => esc_html__( 'Course Archives', 'your-textdomain' ), 'attributes' => esc_html__( 'Course Attributes', 'your-textdomain' ), 'insert_into_item' => esc_html__( 'Insert into course', 'your-textdomain' ), 'uploaded_to_this_item' => esc_html__( 'Uploaded to this course', 'your-textdomain' ), 'featured_image' => esc_html__( 'Featured image', 'your-textdomain' ), 'set_featured_image' => esc_html__( 'Set featured image', 'your-textdomain' ), 'remove_featured_image' => esc_html__( 'Remove featured image', 'your-textdomain' ), 'use_featured_image' => esc_html__( 'Use as featured image', 'your-textdomain' ), 'menu_name' => esc_html__( 'Courses', 'your-textdomain' ), 'filter_items_list' => esc_html__( 'Filter courses list', 'your-textdomain' ), 'filter_by_date' => esc_html__( '', 'your-textdomain' ), 'items_list_navigation' => esc_html__( 'Courses list navigation', 'your-textdomain' ), 'items_list' => esc_html__( 'Courses list', 'your-textdomain' ), 'item_published' => esc_html__( 'Course published.', 'your-textdomain' ), 'item_published_privately' => esc_html__( 'Course published privately.', 'your-textdomain' ), 'item_reverted_to_draft' => esc_html__( 'Course reverted to draft.', 'your-textdomain' ), 'item_scheduled' => esc_html__( 'Course scheduled.', 'your-textdomain' ), 'item_updated' => esc_html__( 'Course updated.', 'your-textdomain' ), 'text_domain' => esc_html__( 'your-textdomain', 'your-textdomain' ), ]; $args = [ 'label' => esc_html__( 'Courses', 'your-textdomain' ), 'labels' => $labels, 'description' => '', 'public' => true, 'hierarchical' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'show_in_rest' => false, 'query_var' => true, 'can_export' => true, 'delete_with_user' => false, 'order' => true, 'has_archive' => 'courses', 'rest_base' => '', 'show_in_menu' => true, 'menu_position' => 20, 'menu_icon' => 'dashicons-book-alt', 'capability_type' => 'post', 'supports' => ['title', 'editor', 'thumbnail', 'page-attributes'], 'taxonomies' => [], 'rewrite' => [ 'with_front' => false, ], ]; register_post_type( 'course', $args ); }
I have been away from WordPress for awhile, so at first I thought this was something new/updated that I was not aware of, but I could not find any resources about it. So, I thought to ask just to be sure. Is this by design in the Meta Box CPT/AIO plugin or a bug?
October 3, 2025 at 8:34 PM #49079Peter
ModeratorHello,
Thank you for your feedback.
The item
text_domain
shouldn't be included in the list of labels. I've escalated this issue to the development team to remove it in the next update of Meta Box plugins.October 4, 2025 at 1:26 AM #49083A.
ParticipantThank you. I noticed another issue similar to this but not exactly the same. Should I post it in a separate topic under the right forum section or submit it via a contact form for bugs/quirks?
October 6, 2025 at 9:42 PM #49092Peter
ModeratorHello,
You can post the issue in another topic or share it by submitting the contact form https://metabox.io/contact/
I will help you check it first. Thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.