]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/meta-boxes.php
WordPress 4.6.1
[autoinstalls/wordpress.git] / wp-admin / includes / meta-boxes.php
index 1627b1f577962a65e018615d7b3c01d09e74cd8b..89e17671c9dc566f4a7312b5d1dfeb64b006d782 100644 (file)
@@ -13,7 +13,7 @@
  * @param array    $args {
  *     Array of arguments for building the post submit meta box.
  *
- *     @type string   $id       Meta box ID.
+ *     @type string   $id       Meta box 'id' attribute.
  *     @type string   $title    Meta box title.
  *     @type callable $callback Meta box display callback.
  *     @type array    $args     Extra meta box arguments.
@@ -170,7 +170,7 @@ echo esc_html( $visibility_trans ); ?></span>
 </div><!-- .misc-pub-section -->
 
 <?php
-/* translators: Publish box date format, see http://php.net/date */
+/* translators: Publish box date format, see https://secure.php.net/date */
 $datef = __( 'M j, Y @ H:i' );
 if ( 0 != $post->ID ) {
        if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
@@ -190,20 +190,9 @@ if ( 0 != $post->ID ) {
        $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
 }
 
-if ( ! empty( $args['args']['revisions_count'] ) ) :
-       $revisions_to_keep = wp_revisions_to_keep( $post );
-?>
+if ( ! empty( $args['args']['revisions_count'] ) ) : ?>
 <div class="misc-pub-section misc-pub-revisions">
-<?php
-       if ( $revisions_to_keep > 0 && $revisions_to_keep <= $args['args']['revisions_count'] ) {
-               echo '<span title="' . esc_attr( sprintf( __( 'Your site is configured to keep only the last %s revisions.' ),
-                       number_format_i18n( $revisions_to_keep ) ) ) . '">';
-               printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '+</b>' );
-               echo '</span>';
-       } else {
-               printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
-       }
-?>
+       <?php printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' ); ?>
        <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a>
 </div>
 <?php endif;
@@ -307,7 +296,7 @@ function attachment_submit_meta_box( $post ) {
 
 <div id="misc-publishing-actions">
        <?php
-       /* translators: Publish box date format, see http://php.net/date */
+       /* translators: Publish box date format, see https://secure.php.net/date */
        $datef = __( 'M j, Y @ H:i' );
        $stamp = __('Uploaded on: <b>%1$s</b>');
        $date = date_i18n( $datef, strtotime( $post->post_date ) );
@@ -334,7 +323,7 @@ function attachment_submit_meta_box( $post ) {
        <?php
        if ( current_user_can( 'delete_post', $post->ID ) )
                if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
-                       echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
+                       echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>";
                } else {
                        $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
                        echo  "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
@@ -364,7 +353,7 @@ function attachment_submit_meta_box( $post ) {
  * @param array   $box {
  *     Post formats meta box arguments.
  *
- *     @type string   $id       Meta box ID.
+ *     @type string   $id       Meta box 'id' attribute.
  *     @type string   $title    Meta box title.
  *     @type callable $callback Meta box display callback.
  *     @type array    $args     Extra meta box arguments.
@@ -405,7 +394,7 @@ function post_format_meta_box( $post, $box ) {
  * @param array   $box {
  *     Tags meta box arguments.
  *
- *     @type string   $id       Meta box ID.
+ *     @type string   $id       Meta box 'id' attribute.
  *     @type string   $title    Meta box title.
  *     @type callable $callback Meta box display callback.
  *     @type array    $args {
@@ -466,7 +455,7 @@ function post_tags_meta_box( $post, $box ) {
  * @param array   $box {
  *     Categories meta box arguments.
  *
- *     @type string   $id       Meta box ID.
+ *     @type string   $id       Meta box 'id' attribute.
  *     @type string   $title    Meta box title.
  *     @type callable $callback Meta box display callback.
  *     @type array    $args {
@@ -533,7 +522,7 @@ function post_categories_meta_box( $post, $box ) {
                                        );
 
                                        /**
-                                        * Filter the arguments for the taxonomy parent dropdown on the Post Edit page.
+                                        * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
                                         *
                                         * @since 4.4.0
                                         *
@@ -580,7 +569,13 @@ function post_categories_meta_box( $post, $box ) {
 function post_excerpt_meta_box($post) {
 ?>
 <label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
-<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="https://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
+<p><?php
+       printf(
+               /* translators: %s: Codex URL */
+               __( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ),
+               __( 'https://codex.wordpress.org/Excerpt' )
+       );
+?></p>
 <?php
 }
 
@@ -592,7 +587,8 @@ function post_excerpt_meta_box($post) {
  * @param object $post
  */
 function post_trackback_meta_box($post) {
-       $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
+       $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' .
+               esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />';
        if ('' != $post->pinged) {
                $pings = '<p>'. __('Already pinged:') . '</p><ul>';
                $already_pinged = explode("\n", trim($post->pinged));
@@ -603,8 +599,18 @@ function post_trackback_meta_box($post) {
        }
 
 ?>
-<p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
-<p><?php _e('Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress sites, they&#8217;ll be notified automatically using <a href="https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
+<p>
+       <label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label>
+       <?php echo $form_trackback; ?>
+</p>
+<p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p>
+<p><?php
+       printf(
+               /* translators: %s: Codex URL */
+               __( 'Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress sites, they&#8217;ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ),
+               __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' )
+       );
+?></p>
 <?php
 if ( ! empty($pings) )
        echo $pings;
@@ -630,7 +636,13 @@ foreach ( $metadata as $key => $value ) {
 list_meta( $metadata );
 meta_form( $post ); ?>
 </div>
-<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="https://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
+<p><?php
+       printf(
+               /* translators: %s: Codex URL */
+               __( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
+               __( 'https://codex.wordpress.org/Using_Custom_Fields' )
+       );
+?></p>
 <?php
 }
 
@@ -646,7 +658,12 @@ function post_comment_status_meta_box($post) {
 <input name="advanced_view" type="hidden" value="1" />
 <p class="meta-options">
        <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 />
-       <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.' ), __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
+       <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(
+                       /* translators: %s: Codex URL */
+                       __( 'Allow <a href="%s">trackbacks and pingbacks</a> on this page.' ),
+                       __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) );
+               ?></label>
        <?php
        /**
         * Fires at the end of the Discussion meta box on the post editing screen.
@@ -742,7 +759,8 @@ function post_author_meta_box($post) {
                'who' => 'authors',
                'name' => 'post_author_override',
                'selected' => empty($post->ID) ? $user_ID : $post->post_author,
-               'include_selected' => true
+               'include_selected' => true,
+               'show' => 'display_name_with_login',
        ) );
 }
 
@@ -780,7 +798,7 @@ function page_attributes_meta_box($post) {
                );
 
                /**
-                * Filter the arguments used to generate a Pages drop-down element.
+                * Filters the arguments used to generate a Pages drop-down element.
                 *
                 * @since 3.3.0
                 *
@@ -817,7 +835,7 @@ function page_attributes_meta_box($post) {
 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
 <?php
 /**
- * Filter the title of the default page template displayed in the drop-down.
+ * Filters the title of the default page template displayed in the drop-down.
  *
  * @since 4.1.0
  *
@@ -835,7 +853,7 @@ $default_title = apply_filters( 'default_page_template_title',  __( 'Default Tem
 <p><strong><?php _e('Order') ?></strong></p>
 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) { ?>
-<p><?php _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p>
+<p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p>
 <?php
        }
 }
@@ -995,7 +1013,7 @@ function xfn_check( $class, $value = '', $deprecated = '' ) {
        global $link;
 
        if ( !empty( $deprecated ) )
-               _deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented
+               _deprecated_argument( __FUNCTION__, '0.0.0' ); // Never implemented
 
        $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
        $rels = preg_split('/\s+/', $link_rel);
@@ -1173,6 +1191,8 @@ function link_advanced_meta_box($link) {
  * Display post thumbnail meta box.
  *
  * @since 2.9.0
+ *
+ * @param WP_Post $post A post object.
  */
 function post_thumbnail_meta_box( $post ) {
        $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
@@ -1184,7 +1204,7 @@ function post_thumbnail_meta_box( $post ) {
  *
  * @since 3.9.0
  *
- * @param WP_Post $post
+ * @param WP_Post $post A post object.
  */
 function attachment_id3_data_meta_box( $post ) {
        $meta = array();