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

Cannot modify existing post types #52

Closed
jakewhiteley opened this issue May 29, 2019 · 0 comments · Fixed by #80
Closed

Cannot modify existing post types #52

jakewhiteley opened this issue May 29, 2019 · 0 comments · Fixed by #80

Comments

@jakewhiteley
Copy link

As described in your docs here, it states that you can modify built in PTs using this package.

But in the PostType class, we encounter the following code which clearly makes this impossible:

public function registerPostType()
{
    // create options for the PostType
    $options = $this->createOptions();

    // check that the post type doesn't already exist
    if (!post_type_exists($this->name)) {
        // register the post type
        register_post_type($this->name, $options);
    }
}

It would be great if this could work again! Until it does, could you please remove it from the docs.


I tried using register_post_type_args to modify the post built in, but to no real luck - the post types are initially declared in wp-settings@347, which is before functions.php has been loaded.

I know we can modify built-ins through entirely different means such as modifying the global $wp_post_types, but that's all I got

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant