[wp-testers] post-format 'standard'?

Mark Jaquith markjaquith at gmail.com
Wed Jan 5 20:40:40 UTC 2011


On Tue, Jan 4, 2011 at 1:43 PM, Dougal Campbell <dougal at gunters.org> wrote:
> But for reading post information, why not move the special casing into
> get_post_format(), instead of duplicating it?
>
> get_post_format(), get_post_format_string(), get_post_class(),
> wp_xmlrpc_server::mw_getPost(), and wp_xmlrpc_server::mw_getRecentPosts()
> all have special case 'if' clauses, all immediately after calling
> get_post_format(). (I only checked wp-includes, there might be more cases in
> the wp-admin code).
>
> Seems it would make more sense to let get_post_format() return 'standard',
> and eliminate a lot of checking in other parts of core. It would also help
> future-proof against future code changes that might miss the exception.

It's a reasonable suggestion, but it's too late in the cycle. People
will be doing things like:

if ( !get_post_format() ) {
    // foo
}

And if that starts returning 'standard', they're going to break.

What we can do, in 3.2, is to have another function for getting the
string, which replaces all the logic checks you mentioned.

-- 
Mark Jaquith
• http://markjaquith.com/http://coveredwebservices.com/


More information about the wp-testers mailing list