Make WordPress Core

Ticket #25229: options.patch

File options.patch, 1.5 KB (added by siobhyb, 11 years ago)

Second pass at options.php. Thanks @DrewAPicture, @tierra, and @kimparsell.

  • options.php

     
    2929if ( empty($option_page) ) // This is for back compat and will eventually be removed.
    3030        $option_page = 'options';
    3131else
     32
     33        /**
     34         * Filter the capability required when using the Settings API.
     35         *
     36         * By default, the options groups for all registered settings require the manage_options capability.
     37         * This filter is required to change the capability required for a certain options page.
     38         *
     39         * @since 3.2.0
     40         *
     41         * @param string $capability The capability used for the page, which is manage_options by default.
     42         */
    3243        $capability = apply_filters( "option_page_capability_{$option_page}", $capability );
    3344
    3445if ( !current_user_can( $capability ) )
     
    95106} else {
    96107        $whitelist_options['general'][] = 'new_admin_email';
    97108        $whitelist_options['general'][] = 'WPLANG';
    98 
     109       
     110        /**
     111         * Toggle post-by-email functionality.
     112         *
     113         * @since 3.0.0
     114         *
     115         * @param bool True or false, based on whether post-by-email configuration is enabled or not.
     116         */
    99117        if ( apply_filters( 'enable_post_by_email_configuration', true ) )
    100118                $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
    101119}
    102120
     121/**
     122 * Filter the options white list.
     123 *
     124 * @since 2.7.0
     125 *
     126 * @param array White list options.
     127 */
    103128$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
    104129
    105130/*