Changeset 33738
- Timestamp:
- 08/25/2015 09:41:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r33110 r33738 44 44 * @param bool|mixed $pre_option Value to return instead of the option value. 45 45 * Default false to skip it. 46 */ 47 $pre = apply_filters( 'pre_option_' . $option, false ); 46 * @param string $option Option name. 47 */ 48 $pre = apply_filters( 'pre_option_' . $option, false, $option ); 48 49 if ( false !== $pre ) 49 50 return $pre; … … 63 64 * @since 3.4.0 64 65 * 65 * @param mixed $default The default value to return if the option does not exist 66 * in the database. 66 * @param mixed $default The default value to return if the option does not exist 67 * in the database. 68 * @param string $option Option name. 67 69 */ 68 return apply_filters( 'default_option_' . $option, $default );70 return apply_filters( 'default_option_' . $option, $default, $option ); 69 71 } 70 72 … … 91 93 92 94 /** This filter is documented in wp-includes/option.php */ 93 return apply_filters( 'default_option_' . $option, $default );95 return apply_filters( 'default_option_' . $option, $default, $option ); 94 96 } 95 97 } … … 103 105 } else { 104 106 /** This filter is documented in wp-includes/option.php */ 105 return apply_filters( 'default_option_' . $option, $default );107 return apply_filters( 'default_option_' . $option, $default, $option ); 106 108 } 107 109 } … … 122 124 * @since 3.0.0 123 125 * 124 * @param mixed $value Value of the option. If stored serialized, it will be 125 * unserialized prior to being returned. 126 */ 127 return apply_filters( 'option_' . $option, maybe_unserialize( $value ) ); 126 * @param mixed $value Value of the option. If stored serialized, it will be 127 * unserialized prior to being returned. 128 * @param string $option Option name. 129 */ 130 return apply_filters( 'option_' . $option, maybe_unserialize( $value ), $option ); 128 131 } 129 132 … … 264 267 * @since 2.6.0 265 268 * 266 * @param mixed $value The new, unserialized option value. 267 * @param mixed $old_value The old option value. 268 */ 269 $value = apply_filters( 'pre_update_option_' . $option, $value, $old_value ); 269 * @param mixed $value The new, unserialized option value. 270 * @param mixed $old_value The old option value. 271 * @param string $option Option name. 272 */ 273 $value = apply_filters( 'pre_update_option_' . $option, $value, $old_value, $option ); 270 274 271 275 /** … … 342 346 * @since 2.0.1 343 347 * 344 * @param mixed $old_value The old option value. 345 * @param mixed $value The new option value. 346 */ 347 do_action( "update_option_{$option}", $old_value, $value ); 348 * @param mixed $old_value The old option value. 349 * @param mixed $value The new option value. 350 * @param string $option Option name. 351 */ 352 do_action( "update_option_{$option}", $old_value, $value, $option ); 348 353 349 354 /** … … 596 601 function get_transient( $transient ) { 597 602 598 603 /** 599 604 * Filter the value of an existing transient. 600 605 * … … 606 611 * @since 2.8.0 607 612 * 608 * @param mixed $pre_transient The default value to return if the transient does not exist. 609 * Any value other than false will short-circuit the retrieval 610 * of the transient, and return the returned value. 611 */ 612 $pre = apply_filters( 'pre_transient_' . $transient, false ); 613 * @param mixed $pre_transient The default value to return if the transient does not exist. 614 * Any value other than false will short-circuit the retrieval 615 * of the transient, and return the returned value. 616 * @param string $transient Transient name. 617 */ 618 $pre = apply_filters( 'pre_transient_' . $transient, false, $transient ); 613 619 if ( false !== $pre ) 614 620 return $pre; … … 643 649 * @since 2.8.0 644 650 * 645 * @param mixed $value Value of transient. 646 */ 647 return apply_filters( 'transient_' . $transient, $value ); 651 * @param mixed $value Value of transient. 652 * @param string $transient Transient name. 653 */ 654 return apply_filters( 'transient_' . $transient, $value, $transient ); 648 655 } 649 656 … … 675 682 * @since 4.2.0 Added `$expiration` parameter. 676 683 * 677 * @param mixed $value New value of transient. 678 * @param int $expiration Time until expiration in seconds. 679 */ 680 $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration ); 684 * @param mixed $value New value of transient. 685 * @param int $expiration Time until expiration in seconds. 686 * @param string $transient Transient name. 687 */ 688 $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration, $transient ); 681 689 682 690 if ( wp_using_ext_object_cache() ) { … … 984 992 * @since 3.0.0 985 993 * 986 * @param mixed $pre_option The default value to return if the option does not exist. 987 */ 988 $pre = apply_filters( 'pre_site_option_' . $option, false ); 994 * @param mixed $pre_option The default value to return if the option does not exist. 995 * @param string $option Option name. 996 */ 997 $pre = apply_filters( 'pre_site_option_' . $option, false, $option ); 989 998 990 999 if ( false !== $pre ) … … 1004 1013 * @since 3.4.0 1005 1014 * 1006 * @param mixed $default The value to return if the site option does not exist 1007 * in the database. 1015 * @param mixed $default The value to return if the site option does not exist 1016 * in the database. 1017 * @param string $option Option name. 1008 1018 */ 1009 return apply_filters( 'default_site_option_' . $option, $default );1019 return apply_filters( 'default_site_option_' . $option, $default, $option ); 1010 1020 } 1011 1021 … … 1013 1023 1014 1024 /** This filter is documented in wp-includes/option.php */ 1015 $default = apply_filters( 'default_site_option_' . $option, $default );1025 $default = apply_filters( 'default_site_option_' . $option, $default, $option ); 1016 1026 $value = get_option($option, $default); 1017 1027 } else { … … 1036 1046 1037 1047 /** This filter is documented in wp-includes/option.php */ 1038 $value = apply_filters( 'default_site_option_' . $option, $default );1048 $value = apply_filters( 'default_site_option_' . $option, $default, $option ); 1039 1049 } 1040 1050 } … … 1049 1059 * @since 3.0.0 1050 1060 * 1051 * @param mixed $value Value of site option. 1052 */ 1053 return apply_filters( 'site_option_' . $option, $value ); 1061 * @param mixed $value Value of site option. 1062 * @param string $option Option name. 1063 */ 1064 return apply_filters( 'site_option_' . $option, $value, $option ); 1054 1065 } 1055 1066 … … 1082 1093 * @since 3.0.0 1083 1094 * 1084 * @param mixed $value Value of site option. 1085 */ 1086 $value = apply_filters( 'pre_add_site_option_' . $option, $value ); 1095 * @param mixed $value Value of site option. 1096 * @param string $option Option name. 1097 */ 1098 $value = apply_filters( 'pre_add_site_option_' . $option, $value, $option ); 1087 1099 1088 1100 $notoptions_key = "{$wpdb->siteid}:notoptions"; … … 1170 1182 * 1171 1183 * @since 3.0.0 1172 */ 1173 do_action( 'pre_delete_site_option_' . $option ); 1184 * 1185 * @param string $option Option name. 1186 */ 1187 do_action( 'pre_delete_site_option_' . $option, $option ); 1174 1188 1175 1189 if ( !is_multisite() ) { … … 1241 1255 * @since 3.0.0 1242 1256 * 1243 * @param mixed $value New value of site option. 1244 * @param mixed $old_value Old value of site option. 1245 */ 1246 $value = apply_filters( 'pre_update_site_option_' . $option, $value, $old_value ); 1257 * @param mixed $value New value of site option. 1258 * @param mixed $old_value Old value of site option. 1259 * @param string $option Option name. 1260 */ 1261 $value = apply_filters( 'pre_update_site_option_' . $option, $value, $old_value, $option ); 1247 1262 1248 1263 if ( $value === $old_value ) … … 1375 1390 * @since 2.9.0 1376 1391 * 1377 * @param mixed $pre_site_transient The default value to return if the site transient does not exist. 1378 * Any value other than false will short-circuit the retrieval 1379 * of the transient, and return the returned value. 1380 */ 1381 $pre = apply_filters( 'pre_site_transient_' . $transient, false ); 1392 * @param mixed $pre_site_transient The default value to return if the site transient does not exist. 1393 * Any value other than false will short-circuit the retrieval 1394 * of the transient, and return the returned value. 1395 * @param string $transient Transient name. 1396 */ 1397 $pre = apply_filters( 'pre_site_transient_' . $transient, false, $transient ); 1382 1398 1383 1399 if ( false !== $pre ) … … 1411 1427 * @since 2.9.0 1412 1428 * 1413 * @param mixed $value Value of site transient. 1414 */ 1415 return apply_filters( 'site_transient_' . $transient, $value ); 1429 * @param mixed $value Value of site transient. 1430 * @param string $transient Transient name. 1431 */ 1432 return apply_filters( 'site_transient_' . $transient, $value, $transient ); 1416 1433 } 1417 1434 … … 1441 1458 * @since 3.0.0 1442 1459 * 1443 * @param mixed $value Value of site transient. 1444 */ 1445 $value = apply_filters( 'pre_set_site_transient_' . $transient, $value ); 1460 * @param mixed $value Value of site transient. 1461 * @param string $transient Transient name. 1462 */ 1463 $value = apply_filters( 'pre_set_site_transient_' . $transient, $value, $transient ); 1446 1464 1447 1465 $expiration = (int) $expiration; … … 1471 1489 * @since 3.0.0 1472 1490 * 1473 * @param mixed $value Site transient value. 1474 * @param int $expiration Time until expiration in seconds. Default 0. 1491 * @param mixed $value Site transient value. 1492 * @param int $expiration Time until expiration in seconds. Default 0. 1493 * @param string $transient Transient name. 1475 1494 */ 1476 do_action( 'set_site_transient_' . $transient, $value, $expiration );1495 do_action( 'set_site_transient_' . $transient, $value, $expiration, $transient ); 1477 1496 1478 1497 /**
Note: See TracChangeset
for help on using the changeset viewer.