WordPress.org

Make WordPress Core

Changeset 38815


Ignore:
Timestamp:
10/19/2016 04:53:02 AM (3 years ago)
Author:
jeremyfelt
Message:

Multisite: Add $network_id parameter to filters in get_network_option().

Props flixos90.
Fixes #38319.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r38814 r38815  
    11011101     * @since 2.9.0 As 'pre_site_option_' . $key
    11021102     * @since 3.0.0
    1103      * @since 4.4.0 The `$option` parameter was added
     1103     * @since 4.4.0 The `$option` parameter was added.
     1104     * @since 4.7.0 The `$network_id` parameter was added.
    11041105     *
    11051106     * @param mixed  $pre_option The default value to return if the option does not exist.
    11061107     * @param string $option     Option name.
    1107      */
    1108     $pre = apply_filters( "pre_site_option_{$option}", false, $option );
     1108     * @param int    $network_id ID of the network.
     1109     */
     1110    $pre = apply_filters( "pre_site_option_{$option}", false, $option, $network_id );
    11091111
    11101112    if ( false !== $pre ) {
     
    11251127         * @since 3.4.0
    11261128         * @since 4.4.0 The `$option` parameter was added.
    1127          *
    1128          * @param mixed  $default The value to return if the site option does not exist
    1129          *                        in the database.
    1130          * @param string $option  Option name.
     1129         * @since 4.7.0 The `$network_id` parameter was added.
     1130         *
     1131         * @param mixed  $default    The value to return if the site option does not exist
     1132         *                           in the database.
     1133         * @param string $option     Option name.
     1134         * @param int    $network_id ID of the network.
    11311135         */
    1132         return apply_filters( "default_site_option_{$option}", $default, $option );
     1136        return apply_filters( "default_site_option_{$option}", $default, $option, $network_id );
    11331137    }
    11341138
    11351139    if ( ! is_multisite() ) {
    11361140        /** This filter is documented in wp-includes/option.php */
    1137         $default = apply_filters( 'default_site_option_' . $option, $default, $option );
     1141        $default = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id );
    11381142        $value = get_option( $option, $default );
    11391143    } else {
     
    11571161
    11581162                /** This filter is documented in wp-includes/option.php */
    1159                 $value = apply_filters( 'default_site_option_' . $option, $default, $option );
     1163                $value = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id );
    11601164            }
    11611165        }
     
    11691173     * @since 2.9.0 As 'site_option_' . $key
    11701174     * @since 3.0.0
    1171      * @since 4.4.0 The `$option` parameter was added
    1172      *
    1173      * @param mixed  $value  Value of network option.
    1174      * @param string $option Option name.
    1175      */
    1176     return apply_filters( "site_option_{$option}", $value, $option );
     1175     * @since 4.4.0 The `$option` parameter was added.
     1176     * @since 4.7.0 The `$network_id` parameter was added.
     1177     *
     1178     * @param mixed  $value      Value of network option.
     1179     * @param string $option     Option name.
     1180     * @param int    $network_id ID of the network.
     1181     */
     1182    return apply_filters( "site_option_{$option}", $value, $option, $network_id );
    11771183}
    11781184
Note: See TracChangeset for help on using the changeset viewer.