Changeset 47785 for trunk/src/wp-admin/edit-form-advanced.php
- Timestamp:
- 05/12/2020 06:30:03 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/edit-form-advanced.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r47410 r47785 77 77 $action = isset( $action ) ? $action : ''; 78 78 79 if ( get_option( 'page_for_posts' )== $post_ID && empty( $post->post_content ) ) {79 if ( (int) get_option( 'page_for_posts' ) === $post_ID && empty( $post->post_content ) ) { 80 80 add_action( 'edit_form_after_title', '_wp_posts_page_notice' ); 81 81 remove_post_type_support( $post_type, 'editor' ); … … 229 229 $notice = false; 230 230 $form_extra = ''; 231 if ( 'auto-draft' == $post->post_status ) {232 if ( 'edit' == $action ) {231 if ( 'auto-draft' === $post->post_status ) { 232 if ( 'edit' === $action ) { 233 233 $post->post_title = ''; 234 234 } … … 277 277 ); 278 278 279 if ( 'post' == $post_type ) {279 if ( 'post' === $post_type ) { 280 280 $customize_display = '<p>' . __( 'The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.' ) . '</p>'; 281 281 … … 314 314 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' 315 315 ); 316 } elseif ( 'page' == $post_type ) {316 } elseif ( 'page' === $post_type ) { 317 317 $about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.' ) . '</p>' . 318 318 '<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>'; … … 332 332 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' 333 333 ); 334 } elseif ( 'attachment' == $post_type ) {334 } elseif ( 'attachment' === $post_type ) { 335 335 get_current_screen()->add_help_tab( 336 336 array( … … 352 352 } 353 353 354 if ( 'post' == $post_type || 'page'== $post_type ) {354 if ( 'post' === $post_type || 'page' === $post_type ) { 355 355 $inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>'; 356 356 $inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. <a href="https://wordpress.org/support/article/embeds/">Learn more about embeds</a>.' ) . '</p>'; … … 365 365 } 366 366 367 if ( 'post' == $post_type ) {367 if ( 'post' === $post_type ) { 368 368 $publish_box = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>'; 369 369 $publish_box .= '<ul><li>' . … … 403 403 ) 404 404 ); 405 } elseif ( 'page' == $post_type ) {405 } elseif ( 'page' === $post_type ) { 406 406 $page_attributes = '<p>' . __( '<strong>Parent</strong> — You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' . 407 407 '<p>' . __( '<strong>Template</strong> — Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.' ) . '</p>' . … … 472 472 <?php 473 473 } 474 if ( 'draft' != get_post_status( $post ) ) {474 if ( 'draft' !== get_post_status( $post ) ) { 475 475 wp_original_referer_field( true, 'previous' ); 476 476 } … … 496 496 497 497 <div id="poststuff"> 498 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">498 <div id="post-body" class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>"> 499 499 <div id="post-body-content"> 500 500 … … 536 536 537 537 if ( ! empty( $shortlink ) && $shortlink !== $permalink && home_url( '?page_id=' . $post->ID ) !== $permalink ) { 538 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>'; 538 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" />' . 539 '<button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . 540 __( 'Get Shortlink' ) . 541 '</button>'; 539 542 } 540 543 } 541 544 542 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { 543 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; 545 if ( $post_type_object->public 546 && ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) 547 ) { 548 $has_sample_permalink = $sample_permalink_html && 'auto-draft' !== $post->post_status; 544 549 ?> 545 550 <div id="edit-slug-box" class="hide-if-no-js"> … … 609 614 <span class="autosave-message"> </span> 610 615 <?php 611 if ( 'auto-draft' != $post->post_status ) {616 if ( 'auto-draft' !== $post->post_status ) { 612 617 echo '<span id="last-edit">'; 613 618 $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ); … … 643 648 <?php 644 649 645 if ( 'page' == $post_type ) {650 if ( 'page' === $post_type ) { 646 651 /** 647 652 * Fires before meta boxes with 'side' context are output for the 'page' post type. … … 677 682 do_meta_boxes( null, 'normal', $post ); 678 683 679 if ( 'page' == $post_type ) {684 if ( 'page' === $post_type ) { 680 685 /** 681 686 * Fires after 'normal' context meta boxes have been output for the 'page' post type.
Note: See TracChangeset
for help on using the changeset viewer.