WordPress.org

Make WordPress Core

Changeset 42359


Ignore:
Timestamp:
12/03/2017 10:28:33 PM (20 months ago)
Author:
joehoyle
Message:

REST API: Include permalink_structure in the settings route.

There are situations where the REST API client wants to be able to read and set the permalink_structure option. Though this doesn’t fix the use case of front-end rendered unauthenticated websites, it still has utility as a setting in it’s own right.

Props aduth.
See #41014.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r42343 r42359  
    20212021    );
    20222022
     2023    register_setting( 'permalink', 'permalink_structure', array(
     2024        'show_in_rest' => true,
     2025        'type'         => 'string',
     2026        'description'  => __( 'Custom URL structure for permalinks and archives.' ),
     2027    ) );
    20232028}
    20242029
  • trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php

    r42343 r42359  
    7373            'default_ping_status',
    7474            'default_comment_status',
     75            'permalink_structure',
    7576        );
    7677
Note: See TracChangeset for help on using the changeset viewer.