Make WordPress Core

Changeset 18083


Ignore:
Timestamp:
05/31/2011 07:52:38 PM (15 years ago)
Author:
ryan
Message:

Use array_combine() to avoid a hard-coded copy of the post format slugs. Props mfields. fixes #17576

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r18080 r18083  
    50905090 */
    50915091function get_post_format_slugs() {
    5092         // 3.2-early: use array_combine() and array_keys( get_post_format_strings() )
    5093         $slugs = array(
    5094                 'standard' => 'standard', // Special case. any value that evals to false will be considered standard
    5095                 'aside'    => 'aside',
    5096                 'chat'     => 'chat',
    5097                 'gallery'  => 'gallery',
    5098                 'link'     => 'link',
    5099                 'image'    => 'image',
    5100                 'quote'    => 'quote',
    5101                 'status'   => 'status',
    5102                 'video'    => 'video',
    5103                 'audio'    => 'audio',
    5104         );
    5105         return $slugs;
     5092        $slugs = array_keys( get_post_format_strings() );
     5093        return array_combine( $slugs, $slugs );
    51065094}
    51075095
Note: See TracChangeset for help on using the changeset viewer.