Changeset 53713
- Timestamp:
- 07/17/2022 01:36:27 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-permalink.php
r53712 r53713 239 239 } 240 240 241 $url_base = home_url( $blog_prefix . $index_php_prefix ); 242 241 243 $default_structures = array( 242 0 => '', 243 1 => $index_php_prefix . '/%year%/%monthnum%/%day%/%postname%/', 244 2 => $index_php_prefix . '/%year%/%monthnum%/%postname%/', 245 3 => $index_php_prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%', 246 4 => $index_php_prefix . '/%postname%/', 247 ); 248 249 $url_base = home_url( $blog_prefix . $index_php_prefix ); 250 251 $default_structure_inputs = array( 252 0 => array( 244 array( 253 245 'id' => 'plain', 254 246 'label' => __( 'Plain' ), 247 'value' => '', 255 248 'example' => home_url( '/?p=123' ), 256 'value' => $default_structures[0],257 249 ), 258 1 =>array(250 array( 259 251 'id' => 'day-name', 260 252 'label' => __( 'Day and name' ), 253 'value' => $index_php_prefix . '/%year%/%monthnum%/%day%/%postname%/', 261 254 'example' => $url_base . '/' . gmdate( 'Y/m/d' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/', 262 'value' => $default_structures[1],263 255 ), 264 2 =>array(256 array( 265 257 'id' => 'month-name', 266 258 'label' => __( 'Month and name' ), 259 'value' => $index_php_prefix . '/%year%/%monthnum%/%postname%/', 267 260 'example' => $url_base . '/' . gmdate( 'Y/m' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/', 268 'value' => $default_structures[2],269 261 ), 270 3 =>array(271 'id' => ' day-numeric',262 array( 263 'id' => 'numeric', 272 264 'label' => __( 'Numeric' ), 265 'value' => $index_php_prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%', 273 266 'example' => $url_base . '/' . _x( 'archives', 'sample permalink base' ) . '/123', 274 'value' => $default_structures[3],275 267 ), 276 4 =>array(268 array( 277 269 'id' => 'post-name', 278 270 'label' => __( 'Post name' ), 271 'value' => $index_php_prefix . '/%postname%/', 279 272 'example' => $url_base . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/', 280 'value' => $default_structures[4],281 273 ), 282 274 ); 275 276 $default_structure_values = wp_list_pluck( $default_structures, 'value' ); 283 277 284 278 $available_tags = array( … … 337 331 <fieldset class="structure-selection"> 338 332 <legend class="screen-reader-text"><?php _e( 'Permalink structure' ); ?></legend> 339 <?php foreach ( $default_structure _inputs as $input ) : ?>333 <?php foreach ( $default_structures as $input ) : ?> 340 334 <div class="row"> 341 335 <input id="permalink-input-<?php echo $input['id']; ?>" … … 356 350 <input id="custom_selection" 357 351 name="selection" type="radio" value="custom" 358 <?php checked( ! in_array( $permalink_structure, $default_structure s, true ) ); ?>352 <?php checked( ! in_array( $permalink_structure, $default_structure_values, true ) ); ?> 359 353 /> 360 354 <div>
Note: See TracChangeset
for help on using the changeset viewer.