+post_name ) );
-
-if ( current_user_can( 'create_posts', 'page' ) && ! ( get_option( 'page_for_posts' ) && $page_for_posts = get_post( get_option( 'page_for_posts' ) ) ) ) {
- $title = _x( 'Blog', 'default page for posts title' );
- // @todo What if the found page is post_type = attachment or post_status != publish?
- // We could go ahead and create a new one, but we would not be able to take over
- // the slug from another page. (We could for an attachment.)
- // We must also check that the user can edit this page and publish a page.
- // Otherwise, we must assume they cannot create pages (throughout), and thus
- // should fall back to the dropdown.
- $page_for_posts = get_page_by_path( sanitize_title( $title ) );
- if ( ! $page_for_posts || $page_for_posts->ID == get_option( 'page_on_front' ) ) {
- $page_for_posts = get_default_post_to_edit( 'page', true );
- $page_for_posts->post_title = $title;
- $page_for_posts->post_name = sanitize_title( $title );
- }
-}
-
-if ( ! $new_front_page_only || current_user_can( 'create_posts', 'page' ) ) : ?>
+else :
+ if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) )
+ update_option( 'show_on_front', 'posts' );
+?>
+