Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels not seen for CPT registered on init with default priority #565

Closed
fjarrett opened this issue Jun 10, 2014 · 0 comments · Fixed by #586
Closed

Labels not seen for CPT registered on init with default priority #565

fjarrett opened this issue Jun 10, 2014 · 0 comments · Fixed by #586
Labels

Comments

@fjarrett
Copy link
Contributor

Today I discovered yet another issue caused by #532.

If a custom post type is registered on the init hook (like in the example below) the labels will not display in Stream or in the Context dropdown filter.

function register_book_cpt() {
    $args = array(
        'public' => true,
        'labels' => array(
            'name'          => 'Books',
            'singular_name' => 'Book',
        ),
    );

    register_post_type( 'book', $args );
}
add_action( 'init', 'register_book_cpt' );

Registering on init with a priority of 8, or an earlier hook like after_setup_theme, remedies the problem.

However, since the Codex example recommends using init with the default priority of 10, I think we need to discover a work-around on our end.

@fjarrett fjarrett added the bug label Jun 10, 2014
@fjarrett fjarrett changed the title Labels not seen for CPT registered on init Labels not seen for CPT registered on init with default priority Jun 10, 2014
@fjarrett fjarrett self-assigned this Jun 11, 2014
@fjarrett fjarrett removed their assignment Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant