crowdfavorite / wp-capsule

The developer's code journal (built on WordPress)
https://crowdfavorite.com/capsule/
GNU General Public License v2.0
172 stars 27 forks source link

Explicitly remove Post Formats support #13

Closed MZAWeb closed 11 years ago

MZAWeb commented 11 years ago

It's actually a bug on WP core, but Capsule could prevent it really easily.

WP core is throwing a notice on wp-includes/post-formats.php:L988 when you try to wp_insert_post on capsule_controller() without setting a post_format.

Two possible solutions:

1) remove_post_type_support( 'post', 'post-formats' ); on init priority 9 or, 2) add a "post_format" => "standard" to the wp_insert_post in capsule/ui/controller.php:L100

MZAWeb commented 11 years ago

Mark just committed the patch to fix the underlying issue: http://core.trac.wordpress.org/changeset/24094

Anyway, I think it's a good idea to remove_post_type_support( 'post', 'post-formats' ) if you don't plan to support them.

alexkingorg commented 11 years ago

Need to wrap that in a "function exists" call too...

MZAWeb commented 11 years ago

For remove_post_type_support()? It's in core since 3.0.. are you supporting <3.0?

alexkingorg commented 11 years ago

Fixed in https://github.com/crowdfavorite/wp-capsule-ui/commit/ae3f5801186812408e17fbfd66e2115e221bb836