wip
This commit is contained in:
+43
-8
@@ -132,10 +132,10 @@ function get_option( $option, $default_value = false ) {
|
||||
$pre = apply_filters( "pre_option_{$option}", false, $option, $default_value );
|
||||
|
||||
/**
|
||||
* Filters the value of all existing options before it is retrieved.
|
||||
* Filters the value of any existing option before it is retrieved.
|
||||
*
|
||||
* Returning a truthy value from the filter will effectively short-circuit retrieval
|
||||
* and return the passed value instead.
|
||||
* Returning a value other than false from the filter will short-circuit retrieval
|
||||
* and return that value instead.
|
||||
*
|
||||
* @since 6.1.0
|
||||
*
|
||||
@@ -1629,10 +1629,10 @@ function set_transient( $transient, $value, $expiration = 0 ) {
|
||||
* The multi-table delete syntax is used to delete the transient record
|
||||
* from table a, and the corresponding transient_timeout record from table b.
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @since 4.9.0
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @param bool $force_db Optional. Force cleanup to run against the database even when an external object cache is used.
|
||||
*/
|
||||
function delete_expired_transients( $force_db = false ) {
|
||||
@@ -1669,7 +1669,7 @@ function delete_expired_transients( $force_db = false ) {
|
||||
time()
|
||||
)
|
||||
);
|
||||
} elseif ( is_multisite() && is_main_site() && is_main_network() ) {
|
||||
} elseif ( is_main_site() && is_main_network() ) {
|
||||
// Multisite stores site transients in the sitemeta table.
|
||||
$wpdb->query(
|
||||
$wpdb->prepare(
|
||||
@@ -1880,7 +1880,7 @@ function wp_set_all_user_settings( $user_settings ) {
|
||||
}
|
||||
|
||||
if ( ! is_user_member_of_blog() ) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$settings = '';
|
||||
@@ -2037,6 +2037,25 @@ function get_network_option( $network_id, $option, $default_value = false ) {
|
||||
*/
|
||||
$pre = apply_filters( "pre_site_option_{$option}", false, $option, $network_id, $default_value );
|
||||
|
||||
/**
|
||||
* Filters the value of any existing network option before it is retrieved.
|
||||
*
|
||||
* Returning a value other than false from the filter will short-circuit retrieval
|
||||
* and return that value instead.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param mixed $pre_option The value to return instead of the network option value. This differs
|
||||
* from `$default_value`, which is used as the fallback value in the event
|
||||
* the option doesn't exist elsewhere in get_network_option().
|
||||
* Default false (to skip past the short-circuit).
|
||||
* @param string $option Name of the option.
|
||||
* @param int $network_id ID of the network.
|
||||
* @param mixed $default_value The fallback value to return if the option does not exist.
|
||||
* Default false.
|
||||
*/
|
||||
$pre = apply_filters( 'pre_site_option', $pre, $option, $network_id, $default_value );
|
||||
|
||||
if ( false !== $pre ) {
|
||||
return $pre;
|
||||
}
|
||||
@@ -3176,7 +3195,23 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) {
|
||||
*
|
||||
* @global array $wp_registered_settings
|
||||
*
|
||||
* @return array List of registered settings, keyed by option name.
|
||||
* @return array {
|
||||
* List of registered settings, keyed by option name.
|
||||
*
|
||||
* @type array ...$0 {
|
||||
* Data used to describe the setting when registered.
|
||||
*
|
||||
* @type string $type The type of data associated with this setting.
|
||||
* Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'.
|
||||
* @type string $label A label of the data attached to this setting.
|
||||
* @type string $description A description of the data attached to this setting.
|
||||
* @type callable $sanitize_callback A callback function that sanitizes the option's value.
|
||||
* @type bool|array $show_in_rest Whether data associated with this setting should be included in the REST API.
|
||||
* When registering complex settings, this argument may optionally be an
|
||||
* array with a 'schema' key.
|
||||
* @type mixed $default Default value when calling `get_option()`.
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
function get_registered_settings() {
|
||||
global $wp_registered_settings;
|
||||
|
||||
Reference in New Issue
Block a user