* @param string $option_group Setting group.
* @param string $option_name Setting name.
*/
do_action( 'unregister_setting', $option_group, $option_name );
unset( $wp_registered_settings[ $option_name ] );
}
}
/**
* Retrieves an array of registered settings.
*
* @since 4.7.0
*
* @global array $wp_registered_settings
*
* @return array List of registered settings, keyed by option name.
*/
function get_registered_settings() {
global $wp_registered_settings;
if ( ! is_array( $wp_registered_settings ) ) {
return array();
}
return $wp_registered_settings;
}
/**
* Filters the default value for the option.
*
* For settings which register a default setting in `register_setting()`, this
* function is added as a filter to `default_option_{$option}`.
*
* @since 4.7.0
*
* @param mixed $default_value Existing default value to return.
* @param string $option Option name.
* @param bool $passed_default Was `get_option()` passed a default value?
* @return mixed Filtered default value.
*/
function filter_default_option( $default_value, $option, $passed_default ) {
if ( $passed_default ) {
return $default_value;
}
$registered = get_registered_settings();
if ( empty( $registered[ $option ] ) ) {
return $default_value;
}
return $registered[ $option ]['default'];
}
/**
* Returns the values that trigger autoloading from the options table.
*
* @since 6.6.0
*
* @return string[] The values that trigger autoloading.
*/
function wp_autoload_values_to_autoload() {
$autoload_values = array( 'yes', 'on', 'auto-on', 'auto' );
/**
* Filters the autoload values that should be considered for autoloading from the options table.
*
* The filter can only be used to remove autoload values from the default list.
*
* @since 6.6.0
*
* @param string[] $autoload_values Autoload values used to autoload option.
* Default list contains 'yes', 'on', 'auto-on', and 'auto'.
*/
$filtered_values = apply_filters( 'wp_autoload_values_to_autoload', $autoload_values );
return array_intersect( $filtered_values, $autoload_values );
}
Fatal error: Uncaught Error: Call to undefined function wp_load_alloptions() in /home/ocb/public_html/wp-includes/functions.php:1780
Stack trace:
#0 /home/ocb/public_html/wp-includes/load.php(915): is_blog_installed()
#1 /home/ocb/public_html/wp-settings.php(174): wp_not_installed()
#2 /home/ocb/public_html/wp-config.php(77): require_once('/home/ocb/publi...')
#3 /home/ocb/public_html/wp-load.php(50): require_once('/home/ocb/publi...')
#4 /home/ocb/public_html/wp-blog-header.php(13): require_once('/home/ocb/publi...')
#5 /home/ocb/public_html/index.php(17): require('/home/ocb/publi...')
#6 {main}
thrown in /home/ocb/public_html/wp-includes/functions.php on line 1780
Fatal error: Uncaught Error: Call to undefined function get_option() in /home/ocb/public_html/wp-includes/l10n.php:63
Stack trace:
#0 /home/ocb/public_html/wp-includes/l10n.php(165): get_locale()
#1 /home/ocb/public_html/wp-includes/l10n.php(953): determine_locale()
#2 /home/ocb/public_html/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#3 [internal function]: WP_Fatal_Error_Handler->handle()
#4 {main}
thrown in /home/ocb/public_html/wp-includes/l10n.php on line 63