Make WordPress Core

Ticket #56870: Introduce_a_general_`pre_site_option`_filter_in_`get_network_option()`.patch

File Introduce_a_general_`pre_site_option`_filter_in_`get_network_option()`.patch, 1.5 KB (added by Drivingralle, 2 years ago)
  • wp-includes/option.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/wp-includes/option.php b/wp-includes/option.php
    a b  
    14271427         */
    14281428        $pre = apply_filters( "pre_site_option_{$option}", false, $option, $network_id, $default );
    14291429
     1430        /**
     1431         * Filters the value of an existing network options before it is retrieved.
     1432         *
     1433         * Returning a truthy value from the filter will effectively short-circuit retrieval
     1434         * and return the passed value instead.
     1435         *
     1436         * @since 6.2.0
     1437         *
     1438         * @param mixed  $pre_option  The value to return instead of the network option value. This differs
     1439         *                            from `$default`, which is used as the fallback value in the event
     1440         *                            the option doesn't exist elsewhere in get_network_option().
     1441         *                            Default false (to skip past the short-circuit).
     1442         * @param string $option      Name of the option.
     1443         * @param int    $network_id ID of the network.
     1444         * @param mixed  $default     The fallback value to return if the option does not exist.
     1445         *                            Default false.
     1446         */
     1447        $pre = apply_filters( 'pre_site_option', $pre, $option, $network_id, $default );
     1448
    14301449        if ( false !== $pre ) {
    14311450                return $pre;
    14321451        }