diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index e3c5a058fd..604c75f3fb 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -238,49 +238,43 @@ if ( is_multisite() && ! is_subdomain_install() && is_main_site() $tag_base = preg_replace( '|^/?blog|', '', $tag_base ); } -$default_structures = array( - 0 => '', - 1 => $index_php_prefix . '/%year%/%monthnum%/%day%/%postname%/', - 2 => $index_php_prefix . '/%year%/%monthnum%/%postname%/', - 3 => $index_php_prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%', - 4 => $index_php_prefix . '/%postname%/', -); - $url_base = home_url( $blog_prefix . $index_php_prefix ); -$default_structure_inputs = array( - 0 => array( +$default_structures = array( + array( 'id' => 'plain', 'label' => __( 'Plain' ), + 'value' => '', 'example' => home_url( '/?p=123' ), - 'value' => $default_structures[0], ), - 1 => array( + array( 'id' => 'day-name', 'label' => __( 'Day and name' ), + 'value' => $index_php_prefix . '/%year%/%monthnum%/%day%/%postname%/', 'example' => $url_base . '/' . gmdate( 'Y/m/d' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/', - 'value' => $default_structures[1], ), - 2 => array( + array( 'id' => 'month-name', 'label' => __( 'Month and name' ), + 'value' => $index_php_prefix . '/%year%/%monthnum%/%postname%/', 'example' => $url_base . '/' . gmdate( 'Y/m' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/', - 'value' => $default_structures[2], ), - 3 => array( - 'id' => 'day-numeric', + array( + 'id' => 'numeric', 'label' => __( 'Numeric' ), + 'value' => $index_php_prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%', 'example' => $url_base . '/' . _x( 'archives', 'sample permalink base' ) . '/123', - 'value' => $default_structures[3], ), - 4 => array( + array( 'id' => 'post-name', 'label' => __( 'Post name' ), + 'value' => $index_php_prefix . '/%postname%/', 'example' => $url_base . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/', - 'value' => $default_structures[4], ), ); +$default_structure_values = wp_list_pluck( $default_structures, 'value' ); + $available_tags = array( /* translators: %s: Permalink structure tag. */ 'year' => __( '%s (The year of the post, four digits, for example 2004.)' ), @@ -336,7 +330,7 @@ printf(