Make WordPress Core

Ticket #23503: 23503.3.patch

File 23503.3.patch, 9.0 KB (added by DrewAPicture, 12 years ago)

Add "Edit {format} Post" labels

  • wp-admin/edit-form-advanced.php

     
    142142
    143143        $all_post_formats = array(
    144144                'standard' => array (
     145                        'title'       => $post_type_object->labels->formats->post_format_standard,
    145146                        'description' => __( 'Add a title and use the editor to compose your post.' )
    146147                ),
    147148                'image' => array (
     149                        'title'       => $post_type_object->labels->formats->post_format_image,
    148150                        'description' => __( 'Select or upload an image to use for your post.' )
    149151                ),
    150152                'gallery' => array (
     153                        'title'       => $post_type_object->labels->formats->post_format_gallery,
    151154                        'description' => __( 'Use the Add Media button to select or upload images for your gallery.' )
    152155                ),
    153156                'link' => array (
     157                        'title'       => $post_type_object->labels->formats->post_format_link,
    154158                        'description' => __( 'Add a link URL below.' )
    155159                ),
    156160                'video' => array (
     161                        'title'       => $post_type_object->labels->formats->post_format_video,
    157162                        'description' => __( 'Select or upload a video, or paste a video embed code into the box.' )
    158163                ),
    159164                'audio' => array (
     165                        'title'       => $post_type_object->labels->formats->post_format_audio,
    160166                        'description' => __( 'Select or upload an audio file, or paste an audio embed code into the box.' )
    161167                ),
    162168                'chat' => array (
     169                        'title'       => $post_type_object->labels->formats->post_format_chat,
    163170                        'description' => __( 'Copy a chat or Q&A transcript into the editor.' )
    164171                ),
    165172                'status' => array (
     173                        'title'       => $post_type_object->labels->formats->post_format_status,
    166174                        'description' => __( 'Use the editor to compose a status update. What’s new?' )
    167175                ),
    168176                'quote' => array (
     177                        'title'       => $post_type_object->labels->formats->post_format_quote,
    169178                        'description' => __( 'Copy a quotation into the box. Also add the source and URL if you have them.' )
    170179                ),
    171180                'aside' => array (
     181                        'title'       => $post_type_object->labels->formats->post_format_aside,
    172182                        'description' => __( 'An aside is a quick thought or side topic. Use the editor to compose one.' )
    173183                )
    174184        );
     
    183193                        $active_post_format_description = $attr['description'];
    184194                }
    185195
    186                 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-description="' . $attr['description'] . '" data-wp-format="' . $slug . '" title="' . ucfirst( sprintf( __( '%s Post' ), $slug ) ) . '"><div class="' . $slug . '"></div></a>';
     196                $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-description="' . esc_attr( $attr['description'] ) . '" data-wp-format="' . $slug . '" title="' . esc_attr( $attr['title'] ) . '"><div class="' . $slug . '"></div></a>';
    187197        }
    188198
    189199        $current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) );
     
    405415
    406416<?php if ( ! empty( $post_format_options ) ) : ?>
    407417<div class="post-format-options">
    408         <span class="post-format-tip">Standard Post</span>
     418        <span class="post-format-tip"><?php echo $all_post_formats[$post_format]['title']; ?></span>
    409419        <?php echo $post_format_options; ?>
    410420</div>
    411421<?php endif; ?>
  • wp-admin/includes/meta-boxes.php

     
    315315                        $post_formats[0][] = $post_format;
    316316        ?>
    317317        <div id="post-formats-select">
    318                 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>
     318                <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php echo get_post_format_string( 'standard' ); ?></label>
    319319                <?php foreach ( $post_formats[0] as $format ) : ?>
    320320                <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
    321321                <?php endforeach; ?><br />
  • wp-admin/options-writing.php

     
    8787<th scope="row"><label for="default_post_format"><?php _e('Default Post Format') ?></label></th>
    8888<td>
    8989        <select name="default_post_format" id="default_post_format">
    90                 <option value="0"><?php _e('Standard'); ?></option>
     90                <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
    9191<?php foreach ( $post_formats[0] as $format ): ?>
    9292                <option<?php selected( get_option('default_post_format'), $format ); ?> value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
    9393<?php endforeach; ?>
  • wp-includes/post.php

     
    14361436                'not_found' => array( __('No posts found.'), __('No pages found.') ),
    14371437                'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
    14381438                'parent_item_colon' => array( null, __('Parent Page:') ),
    1439                 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) )
     1439                'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ),
     1440                'formats' => array(
     1441                        'post_format_standard'      => array( _x( 'Standard Post',      'Post format' ),      _x( 'Standard Page',      'Post format' ) ),
     1442                        'post_format_standard_edit' => array( _x( 'Edit Standard Post', 'Edit post format' ), _x( 'Edit Standard Page', 'Edit post format' ) ),
     1443                        'post_format_aside'         => array( _x( 'Aside Post',         'Post format' ),      _x( 'Aside Page',         'Post format' ) ),
     1444                        'post_format_aside_edit'    => array( _x( 'Edit Aside Post',    'Edit post format' ), _x( 'Edit Aside Page',    'Edit post format' ) ),
     1445                        'post_format_chat'          => array( _x( 'Chat Post',          'Post format' ),      _x( 'Chat Page',          'Post format' ) ),
     1446                        'post_format_chat_edit'     => array( _x( 'Edit Chat Post',     'Edit post format' ), _x( 'Edit Chat Page',     'Edit post format' ) ),
     1447                        'post_format_gallery'       => array( _x( 'Gallery Post',       'Post format' ),      _x( 'Gallery Page',       'Post format' ) ),
     1448                        'post_format_gallery_edit'  => array( _x( 'Edit Gallery Post',  'Edit post format' ), _x( 'Edit Gallery Page',  'Edit post format' ) ),
     1449                        'post_format_link'          => array( _x( 'Link Post',          'Post format' ),      _x( 'Link Page',          'Post format' ) ),
     1450                        'post_format_link_edit'     => array( _x( 'Edit Link Post',     'Edit post format' ), _x( 'Edit Link Page',     'Edit post format' ) ),
     1451                        'post_format_image'         => array( _x( 'Image Post',         'Post format' ),      _x( 'Image Page',         'Post format' ) ),
     1452                        'post_format_image_edit'    => array( _x( 'Edit Image Post',    'Edit post format' ), _x( 'Edit Image Page',    'Edit post format' ) ),
     1453                        'post_format_quote'         => array( _x( 'Quote Post',         'Post format' ),      _x( 'Quote Page',         'Post format' ) ),
     1454                        'post_format_quote_edit'    => array( _x( 'Edit Quote Post',    'Edit post format' ), _x( 'Edit Quote Page',    'Edit post format' ) ),
     1455                        'post_format_status'        => array( _x( 'Status Post',        'Post format' ),      _x( 'Status Page',        'Post format' ) ),
     1456                        'post_format_status_edit'   => array( _x( 'Edit Status Post',   'Edit post format' ), _x( 'Edit Status Page',   'Edit post format' ) ),
     1457                        'post_format_video'         => array( _x( 'Video Post',         'Post format' ),      _x( 'Video Page',         'Post format' ) ),
     1458                        'post_format_video_edit'    => array( _x( 'Edit Video Post',    'Edit post format' ), _x( 'Edit Video Page',    'Edit post format' ) ),
     1459                        'post_format_audio'         => array( _x( 'Audio Post',         'Post format' ),      _x( 'Audio Page',         'Post format' ) ),
     1460                        'post_format_audio_edit'    => array( _x( 'Edit Audio Post',    'Edit post format' ), _x( 'Edit Audio Page',    'Edit post format' ) )
     1461                )
    14401462        );
    14411463        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    14421464
     
    14691491        if ( !isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) )
    14701492                $object->labels['all_items'] = $object->labels['menu_name'];
    14711493
    1472         foreach ( $nohier_vs_hier_defaults as $key => $value )
    1473                         $defaults[$key] = $object->hierarchical ? $value[1] : $value[0];
     1494        foreach ( $nohier_vs_hier_defaults as $key => $value ) {
     1495                if ( 'formats' == $key ) {
     1496                        foreach ( $value as $format => $_value )
     1497                                $defaults['formats']->$format = $object->hierarchical ? $_value[1] : $_value[0];
     1498                } else {
     1499                        $defaults[$key] = $object->hierarchical ? $value[1] : $value[0];                       
     1500                }
     1501        }
    14741502
    14751503        $labels = array_merge( $defaults, $object->labels );
    14761504        return (object)$labels;