diff --git a/src/wp-admin/options-permalink.php b/src/wp-admin/options-permalink.php
index 379dc8a0f5..0d228ef6cf 100644
a
|
b
|
printf( |
373 | 373 | <span class="code"> |
374 | 374 | <code id="permalink-custom"><?php echo esc_url( $url_base ); ?></code> |
375 | 375 | <input name="permalink_structure" id="permalink_structure" |
376 | | type="text" value="<?php echo esc_attr( $permalink_structure ); ?>" |
| 376 | type="text" disabled value="<?php echo esc_attr( $permalink_structure ); ?>" |
377 | 377 | aria-describedby="permalink-custom" class="regular-text code" |
378 | 378 | /> |
379 | 379 | </span> |
… |
… |
printf( |
387 | 387 | <ul role="list"> |
388 | 388 | <?php foreach ( $available_tags as $tag => $explanation ) : ?> |
389 | 389 | <li> |
390 | | <button type="button" |
| 390 | <button disabled type="button" |
391 | 391 | class="button button-secondary" |
392 | 392 | aria-label="<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>" |
393 | 393 | data-added="<?php echo esc_attr( sprintf( $tag_added, $tag ) ); ?>" |
… |
… |
printf( |
403 | 403 | </div><!-- .available-structure-tags --> |
404 | 404 | </div> |
405 | 405 | </div><!-- .row --> |
| 406 | <script> |
| 407 | let permalinkRadio = document.querySelector('input[name="selection"]'); |
| 408 | document.body.addEventListener('change', function (e) { |
| 409 | var strctureType = e.target.value; |
| 410 | const structureButtons = document.querySelectorAll('.button-secondary'); |
| 411 | if(strctureType == 'custom'){ |
| 412 | document.querySelector('input[name="permalink_structure"]').disabled = false; |
| 413 | for (let i = 0; i < structureButtons.length; i++) { |
| 414 | structureButtons[i].disabled = false; |
| 415 | } |
| 416 | } else { |
| 417 | document.querySelector('input[name="permalink_structure"]').disabled = true; |
| 418 | for (let i = 0; i < structureButtons.length; i++) { |
| 419 | structureButtons[i].disabled = true; |
| 420 | } |
| 421 | } |
| 422 | }); |
| 423 | </script> |
406 | 424 | </fieldset><!-- .structure-selection --> |
407 | 425 | </td> |
408 | 426 | </tr> |