Changeset 47808 for trunk/src/wp-admin/includes/meta-boxes.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/meta-boxes.php
r47550 r47808 47 47 <div id="save-action"> 48 48 <?php 49 if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status) {49 if ( ! in_array( $post->post_status, array( 'publish', 'future', 'pending' ), true ) ) { 50 50 $private_style = ''; 51 if ( 'private' == $post->post_status ) {51 if ( 'private' === $post->post_status ) { 52 52 $private_style = 'style="display:none"'; 53 53 } … … 55 55 <input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" /> 56 56 <span class="spinner"></span> 57 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>57 <?php } elseif ( 'pending' === $post->post_status && $can_publish ) { ?> 58 58 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save as Pending' ); ?>" class="button" /> 59 59 <span class="spinner"></span> … … 64 64 <?php 65 65 $preview_link = esc_url( get_preview_post_link( $post ) ); 66 if ( 'publish' == $post->post_status ) {66 if ( 'publish' === $post->post_status ) { 67 67 $preview_button_text = __( 'Preview Changes' ); 68 68 } else { … … 121 121 </span> 122 122 <?php 123 if ( 'publish' == $post->post_status || 'private'== $post->post_status || $can_publish ) {123 if ( 'publish' === $post->post_status || 'private' === $post->post_status || $can_publish ) { 124 124 $private_style = ''; 125 if ( 'private' == $post->post_status ) {125 if ( 'private' === $post->post_status ) { 126 126 $private_style = 'style="display:none"'; 127 127 } … … 130 130 131 131 <div id="post-status-select" class="hide-if-js"> 132 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' == $post->post_status ) ? 'draft' : $post->post_status ); ?>" />132 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>" /> 133 133 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label> 134 134 <select name="post_status" id="post_status"> 135 <?php if ( 'publish' == $post->post_status ) : ?>135 <?php if ( 'publish' === $post->post_status ) : ?> 136 136 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option> 137 <?php elseif ( 'private' == $post->post_status ) : ?>137 <?php elseif ( 'private' === $post->post_status ) : ?> 138 138 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option> 139 <?php elseif ( 'future' == $post->post_status ) : ?>139 <?php elseif ( 'future' === $post->post_status ) : ?> 140 140 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled' ); ?></option> 141 141 <?php endif; ?> 142 142 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option> 143 <?php if ( 'auto-draft' == $post->post_status ) : ?>143 <?php if ( 'auto-draft' === $post->post_status ) : ?> 144 144 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> 145 145 <?php else : ?> … … 211 211 212 212 if ( 0 != $post->ID ) { 213 if ( 'future' == $post->post_status ) { // Scheduled for publishing at a future date.213 if ( 'future' === $post->post_status ) { // Scheduled for publishing at a future date. 214 214 /* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */ 215 215 $stamp = __( 'Scheduled for: %s' ); 216 } elseif ( 'publish' == $post->post_status || 'private'== $post->post_status ) { // Already published.216 } elseif ( 'publish' === $post->post_status || 'private' === $post->post_status ) { // Already published. 217 217 /* translators: Post date information. %s: Date on which the post was published. */ 218 218 $stamp = __( 'Published on: %s' ); 219 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified.219 } elseif ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified. 220 220 $stamp = __( 'Publish <b>immediately</b>' ); 221 221 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // Draft, 1 or more saves, future date specified. … … 709 709 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' . 710 710 esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />'; 711 if ( '' != $post->pinged ) { 711 712 if ( '' !== $post->pinged ) { 712 713 $pings = '<p>' . __( 'Already pinged:' ) . '</p><ul>'; 713 714 $already_pinged = explode( "\n", trim( $post->pinged ) ); … … 1003 1004 do_action( 'page_attributes_misc_attributes', $post ); 1004 1005 ?> 1005 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?>1006 <?php if ( 'page' === $post->post_type && get_current_screen()->get_help_tabs() ) : ?> 1006 1007 <p class="post-attributes-help-text"><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p> 1007 1008 <?php … … 1056 1057 <div id="delete-action"> 1057 1058 <?php 1058 if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) {1059 if ( ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] && current_user_can( 'manage_links' ) ) { 1059 1060 printf( 1060 1061 '<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>', … … 1183 1184 $rels = preg_split( '/\s+/', $link_rel ); 1184 1185 1185 if ( '' != $value && in_array( $value, $rels, true ) ) {1186 if ( '' !== $value && in_array( $value, $rels, true ) ) { 1186 1187 echo ' checked="checked"'; 1187 1188 } 1188 1189 1189 if ( '' == $value ) {1190 if ( 'family' == $class && strpos( $link_rel, 'child' ) === false && strpos( $link_rel, 'parent' ) === false && strpos( $link_rel, 'sibling' ) === false && strpos( $link_rel, 'spouse' ) === false && strpos( $link_rel, 'kin' ) === false ) {1190 if ( '' === $value ) { 1191 if ( 'family' === $class && strpos( $link_rel, 'child' ) === false && strpos( $link_rel, 'parent' ) === false && strpos( $link_rel, 'sibling' ) === false && strpos( $link_rel, 'spouse' ) === false && strpos( $link_rel, 'kin' ) === false ) { 1191 1192 echo ' checked="checked"'; 1192 1193 } 1193 if ( 'friendship' == $class && strpos( $link_rel, 'friend' ) === false && strpos( $link_rel, 'acquaintance' ) === false && strpos( $link_rel, 'contact' ) === false ) {1194 if ( 'friendship' === $class && strpos( $link_rel, 'friend' ) === false && strpos( $link_rel, 'acquaintance' ) === false && strpos( $link_rel, 'contact' ) === false ) { 1194 1195 echo ' checked="checked"'; 1195 1196 } 1196 if ( 'geographical' == $class && strpos( $link_rel, 'co-resident' ) === false && strpos( $link_rel, 'neighbor' ) === false ) {1197 if ( 'geographical' === $class && strpos( $link_rel, 'co-resident' ) === false && strpos( $link_rel, 'neighbor' ) === false ) { 1197 1198 echo ' checked="checked"'; 1198 1199 } 1199 if ( 'identity' == $class && in_array( 'me', $rels, true ) ) {1200 if ( 'identity' === $class && in_array( 'me', $rels, true ) ) { 1200 1201 echo ' checked="checked"'; 1201 1202 } … … 1422 1423 1423 1424 $publish_callback_args = array( '__back_compat_meta_box' => true ); 1424 if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' != $post->post_status ) {1425 if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) { 1425 1426 $revisions = wp_get_post_revisions( $post->ID ); 1426 1427 … … 1437 1438 } 1438 1439 1439 if ( 'attachment' == $post_type ) {1440 if ( 'attachment' === $post_type ) { 1440 1441 wp_enqueue_script( 'image-edit' ); 1441 1442 wp_enqueue_style( 'imgareaselect' ); … … 1544 1545 } 1545 1546 1546 if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {1547 if ( ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { 1547 1548 add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); 1548 1549 }
Note: See TracChangeset
for help on using the changeset viewer.