Created
February 17, 2017 01:23
-
-
Save ajskelton/d5a744a68e9f97baab6790ccbb152013 to your computer and use it in GitHub Desktop.
WordPress Custom Post Type Labels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the post type labels configuration | |
* | |
* @param string $post_type | |
* @param string $singular_label | |
* @param string $plural_label | |
* | |
* @return array | |
*/ | |
function get_TODO_post_type_labels_config( $post_type, $singular_label, $plural_label ) { | |
return array( | |
'name' => _x( $plural_label, 'post type general name', FAQ_MODULE_TEXT_DOMAIN ), | |
'singular_name' => _x( $singular_label, 'post type singular name', FAQ_MODULE_TEXT_DOMAIN ), | |
'menu_name' => _x( $plural_label, 'admin menu', FAQ_MODULE_TEXT_DOMAIN ), | |
'name_admin_bar' => _x( $singular_label, 'add new on admin bar', FAQ_MODULE_TEXT_DOMAIN ), | |
'add_new' => _x( 'Add New ', $post_type, FAQ_MODULE_TEXT_DOMAIN ), | |
'add_new_item' => __( 'Add New ' . $singular_label, FAQ_MODULE_TEXT_DOMAIN ), | |
'new_item' => __( 'New ' . $singular_label, FAQ_MODULE_TEXT_DOMAIN ), | |
'edit_item' => __( 'Edit ' . $singular_label, FAQ_MODULE_TEXT_DOMAIN ), | |
'view_item' => __( 'View ' . $singular_label, FAQ_MODULE_TEXT_DOMAIN ), | |
'all_items' => __( 'All ' . $plural_label, FAQ_MODULE_TEXT_DOMAIN ), | |
'search_items' => __( 'Search ' . $plural_label, FAQ_MODULE_TEXT_DOMAIN ), | |
'parent_item_colon' => __( 'Parent ' . $singular_label . ':', FAQ_MODULE_TEXT_DOMAIN ), | |
'not_found' => __( 'No ' . $plural_label . ' found.', FAQ_MODULE_TEXT_DOMAIN ), | |
'not_found_in_trash' => __( 'No ' . $plural_label . ' found in Trash.', FAQ_MODULE_TEXT_DOMAIN ) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! Saved me a decent bit of time.