Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r15452 r17322  
    2323<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
    2424<div style="display:none;">
    25 <input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
     25<?php submit_button( __( 'Save' ), 'button', 'save' ); ?>
    2626</div>
    2727
     
    3333<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
    3434<?php } ?>
     35<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="draft-ajax-loading" alt="" />
    3536</div>
    3637
     
    3839<?php
    3940if ( 'publish' == $post->post_status ) {
    40     $preview_link = esc_url(get_permalink($post->ID));
    41     $preview_button = __('Preview Changes');
     41    $preview_link = esc_url( get_permalink( $post->ID ) );
     42    $preview_button = __( 'Preview Changes' );
    4243} else {
    43     $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
    44     $preview_button = __('Preview');
     44    $preview_link = get_permalink( $post->ID );
     45    if ( is_ssl() )
     46        $preview_link = str_replace( 'http://', 'https://', $preview_link );
     47    $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
     48    $preview_button = __( 'Preview' );
    4549}
    4650?>
     
    7377    case 'auto-draft':
    7478        _e('Draft');
    75         break;
    76     case 'auto-draft':
    77         _e('Unsaved');
    7879        break;
    7980}
     
    154155</div><?php // /misc-pub-section ?>
    155156
    156 
    157157<?php
    158158// translators: Publish box date formt, see http://php.net/date
     
    205205
    206206<div id="publishing-action">
    207 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" id="ajax-loading" style="visibility:hidden;" alt="" />
     207<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" />
    208208<?php
    209209if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
     
    211211        if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
    212212        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
    213         <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
     213        <?php submit_button( __( 'Schedule' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
    214214<?php   else : ?>
    215215        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
    216         <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
     216        <?php submit_button( __( 'Publish' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
    217217<?php   endif;
    218218    else : ?>
    219219        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
    220         <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
     220        <?php submit_button( __( 'Submit for Review' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
    221221<?php
    222222    endif;
     
    232232
    233233<?php
     234}
     235
     236/**
     237 * Display post format form elements.
     238 *
     239 * @since 3.1.0
     240 *
     241 * @param object $post
     242 */
     243function post_format_meta_box( $post, $box ) {
     244    if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
     245    $post_formats = get_theme_support( 'post-formats' );
     246
     247    if ( is_array( $post_formats[0] ) ) :
     248        $post_format = get_post_format( $post->ID );
     249        if ( !$post_format )
     250            $post_format = '0';
     251        $post_format_display = get_post_format_string( $post_format );
     252        // Add in the current one if it isn't there yet, in case the current theme doesn't support it
     253        if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
     254            $post_formats[0][] = $post_format;
     255    ?>
     256    <div id="post-formats-select">
     257        <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>
     258        <?php foreach ( $post_formats[0] as $format ) : ?>
     259        <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>
     260        <?php endforeach; ?><br />
     261    </div>
     262    <?php endif; endif;
    234263}
    235264
     
    257286    <div class="nojs-tags hide-if-js">
    258287    <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
    259     <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
     288    <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo get_terms_to_edit( $post->ID, $tax_name ); // textarea_escaped by esc_attr() ?></textarea></div>
    260289    <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    261290    <div class="ajaxtag hide-if-no-js">
     
    272301<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    273302<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p>
    274 <?php else : ?>
    275 <p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
    276303<?php endif; ?>
    277304<?php
     
    317344            </ul>
    318345        </div>
    319     <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
    320     <p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
    321     <?php endif; ?>
    322346    <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
    323347            <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
     
    357381function post_excerpt_meta_box($post) {
    358382?>
    359 <label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
     383<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
    360384<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
    361385<?php
     
    424448    <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br />
    425449    <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
     450    <?php do_action('post_comment_status_meta_box-options', $post); ?>
    426451</p>
    427452<?php
     
    433458 * @since 3.0.0
    434459 *
    435  * @param $result table header rows
    436  * @return
     460 * @param array $result table header rows
     461 * @return array
    437462 */
    438463function post_comment_meta_box_thead($result) {
     
    459484
    460485    wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
    461     add_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead', 8, 1);
    462 ?>
    463 
    464 <table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
    465 <thead><tr>
    466     <?php print_column_headers('edit-comments'); ?>
    467 </tr></thead>
    468 <tbody id="the-comment-list" class="list:comment"></tbody>
    469 </table>
     486
     487    $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
     488    $wp_list_table->display( true );
     489?>
    470490<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p>
    471491<?php
     
    475495<?php
    476496    }
    477     remove_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead');
    478497    wp_comment_trashnotice();
    479498}
     
    503522function post_author_meta_box($post) {
    504523    global $user_ID;
    505     $authors = get_editable_user_ids( get_current_user_id(), true, $post->post_type ); // TODO: ROLE SYSTEM
    506     if ( $post->post_author && !in_array($post->post_author, $authors) )
    507         $authors[] = $post->post_author;
    508 ?>
    509 <label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
    510 <?php
     524?>
     525<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label>
     526<?php
     527    wp_dropdown_users( array(
     528        'who' => 'authors',
     529        'name' => 'post_author_override',
     530        'selected' => empty($post->ID) ? $user_ID : $post->post_author,
     531        'include_selected' => true
     532    ) );
    511533}
    512534
     
    579601<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
    580602<div style="display:none;">
    581 <input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
     603<?php submit_button( __( 'Save' ), 'button', 'save', false ); ?>
    582604</div>
    583605
     
    863885    <tr class="form-field">
    864886        <th valign="top"  scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
    865         <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo  ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
     887        <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td>
    866888    </tr>
    867889    <tr class="form-field">
Note: See TracChangeset for help on using the changeset viewer.