Ticket #38319: 38319.diff
File 38319.diff, 2.9 KB (added by , 8 years ago) |
---|
-
src/wp-includes/option.php
1101 1101 * 1102 1102 * @since 2.9.0 As 'pre_site_option_' . $key 1103 1103 * @since 3.0.0 1104 * @since 4.4.0 The `$option` parameter was added 1104 * @since 4.4.0 The `$option` parameter was added. 1105 * @since 4.7.0 The `$network_id` parameter was added. 1105 1106 * 1106 1107 * @param mixed $pre_option The default value to return if the option does not exist. 1107 1108 * @param string $option Option name. 1109 * @param int $network_id ID of the network. 1108 1110 */ 1109 $pre = apply_filters( "pre_site_option_{$option}", false, $option );1111 $pre = apply_filters( "pre_site_option_{$option}", false, $option, $network_id ); 1110 1112 1111 1113 if ( false !== $pre ) { 1112 1114 return $pre; … … 1125 1127 * 1126 1128 * @since 3.4.0 1127 1129 * @since 4.4.0 The `$option` parameter was added. 1130 * @since 4.7.0 The `$network_id` parameter was added. 1128 1131 * 1129 * @param mixed $default The value to return if the site option does not exist 1130 * in the database. 1131 * @param string $option Option name. 1132 * @param mixed $default The value to return if the site option does not exist 1133 * in the database. 1134 * @param string $option Option name. 1135 * @param int $network_id ID of the network. 1132 1136 */ 1133 return apply_filters( "default_site_option_{$option}", $default, $option );1137 return apply_filters( "default_site_option_{$option}", $default, $option, $network_id ); 1134 1138 } 1135 1139 1136 1140 if ( ! is_multisite() ) { 1137 1141 /** This filter is documented in wp-includes/option.php */ 1138 $default = apply_filters( 'default_site_option_' . $option, $default, $option );1142 $default = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id ); 1139 1143 $value = get_option( $option, $default ); 1140 1144 } else { 1141 1145 $cache_key = "$network_id:$option"; … … 1157 1161 wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); 1158 1162 1159 1163 /** This filter is documented in wp-includes/option.php */ 1160 $value = apply_filters( 'default_site_option_' . $option, $default, $option );1164 $value = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id ); 1161 1165 } 1162 1166 } 1163 1167 } … … 1169 1173 * 1170 1174 * @since 2.9.0 As 'site_option_' . $key 1171 1175 * @since 3.0.0 1172 * @since 4.4.0 The `$option` parameter was added 1176 * @since 4.4.0 The `$option` parameter was added. 1177 * @since 4.7.0 The `$network_id` parameter was added. 1173 1178 * 1174 * @param mixed $value Value of network option. 1175 * @param string $option Option name. 1179 * @param mixed $value Value of network option. 1180 * @param string $option Option name. 1181 * @param int $network_id ID of the network. 1176 1182 */ 1177 return apply_filters( "site_option_{$option}", $value, $option );1183 return apply_filters( "site_option_{$option}", $value, $option, $network_id ); 1178 1184 } 1179 1185 1180 1186 /**