Make WordPress Core

Changeset 47158


Ignore:
Timestamp:
02/01/2020 10:40:06 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Administration: Include options page name in the "Options page not found" error message to provide better context for plugin developers.

Props tdlewis77, williampatton.
Fixes #42941.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options.php

    r47157 r47158  
    201201 * @since 2.7.0
    202202 *
    203  * @param array $whitelist_options Whitelist options.
     203 * @param array $whitelist_options The options whitelist.
    204204 */
    205205$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
     
    218218
    219219    if ( ! isset( $whitelist_options[ $option_page ] ) ) {
    220         wp_die( __( '<strong>Error</strong>: Options page not found.' ) );
     220        wp_die(
     221            sprintf(
     222                /* translators: %s: The options page name. */
     223                __( '<strong>Error</strong>: Options page %s not found in the options whitelist.' ),
     224                '<code>' . esc_html( $option_page ) . '</code>'
     225            )
     226        );
    221227    }
    222228
     
    269275                        /* translators: %s: The option/setting. */
    270276                        __( 'The %s setting is unregistered. Unregistered settings are deprecated. See https://developer.wordpress.org/plugins/settings/settings-api/' ),
    271                         '<code>' . $option . '</code>'
     277                        '<code>' . esc_html( $option ) . '</code>'
    272278                    )
    273279                );
Note: See TracChangeset for help on using the changeset viewer.