Make WordPress Core

Ticket #43830: 43830.diff

File 43830.diff, 2.5 KB (added by dssaez, 7 years ago)
  • src/wp-admin/includes/meta-boxes.php

    diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php
    old mode 100644
    new mode 100755
    index f9e4701..4b23432
    a b function post_comment_status_meta_box( $post ) { 
    757757<input name="advanced_view" type="hidden" value="1" />
    758758<p class="meta-options">
    759759        <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 />
    760         <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked( $post->ping_status, 'open' ); ?> /> 
     760        <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked( $post->ping_status, 'open' ); ?> />
    761761                                                                                                                                                                                                                                                                                                                <?php
    762762                                                                                                                                                                                                                                                                                                                printf(
    763763                                                                                                                                                                                                                                                                                                                        /* translators: %s: Codex URL */
    $default_title = apply_filters( 'default_page_template_title', __( 'Default Temp 
    963963<?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>
    964964<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p>
    965965<input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" />
     966<p>
     967        <label for="homepage">
     968                <?php $checked = ( $post->ID == get_option( 'page_on_front' ) ? 'checked' : 0 ); ?>
     969                <input name="homepage" id="homepage" value="0" type="checkbox" <?php echo $checked; ?>>
     970                <?php _e( 'Set as a hompage' ); ?>
     971        </label>
     972</p>
    966973<?php
    967974/**
    968975 * Fires before the help hint text in the 'Page Attributes' meta box.
  • src/wp-includes/post.php

    diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
    old mode 100644
    new mode 100755
    index cb5025f..440aa4c
    a b function wp_insert_post( $postarr, $wp_error = false ) { 
    37213721                }
    37223722        }
    37233723
     3724        // Set page as a homepage
     3725        if ( get_post_type( $post_ID ) == 'page' )
     3726                if ( isset( $_POST[ 'homepage' ] ) )
     3727                {
     3728                        update_option( 'page_on_front', $post_ID );
     3729                        update_option( 'show_on_front', 'page' );
     3730                }
     3731                else if ( get_option( 'page_on_front' ) == $post_ID )
     3732                {
     3733                        update_option( 'page_on_front', '0' );
     3734                        update_option( 'show_on_front', 'posts' );
     3735                }
     3736
    37243737        clean_post_cache( $post_ID );
    37253738
    37263739        $post = get_post( $post_ID );