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

Check for existence of post_type of posts #214

Closed
shadyvb opened this issue Feb 5, 2014 · 0 comments · Fixed by #227
Closed

Check for existence of post_type of posts #214

shadyvb opened this issue Feb 5, 2014 · 0 comments · Fixed by #227
Labels

Comments

@shadyvb
Copy link
Contributor

shadyvb commented Feb 5, 2014

Do not always assume that a new post's post_type exists / is registered.
ex:

wp_insert_post( array(
  'post_type' => 'non_registered_post_type'
) );

results in:

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/wp-stream/connectors/posts.php on line 144

Notice: Trying to get property of non-object in /srv/www/wordpress-develop/src/wp-content/plugins/wp-stream/connectors/posts.php on line 144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant