Make WordPress Core


Ignore:
Timestamp:
05/29/2024 08:51:04 AM (6 months ago)
Author:
ellatrix
Message:

Options: Add 'label' argument to register_setting.

The 'label' will displayed to users when editing core or custom settings via block editors. It avoids hardcoding Settings labels and improves extensibility.

Backports https://github.com/WordPress/gutenberg/pull/59243.

Props mamaduka, timothyblynjacobs, ellatrix.

Fixes #61023.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php

    r56548 r58230  
    238238            $default_schema = array(
    239239                'type'        => empty( $args['type'] ) ? null : $args['type'],
     240                'title'       => empty( $args['label'] ) ? '' : $args['label'],
    240241                'description' => empty( $args['description'] ) ? '' : $args['description'],
    241242                'default'     => isset( $args['default'] ) ? $args['default'] : null,
Note: See TracChangeset for help on using the changeset viewer.