Changeset 37933
- Timestamp:
- 06/30/2016 06:59:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r37928 r37933 981 981 */ 982 982 return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type, $object_subtype ); 983 984 985 983 } 986 984 … … 1004 1002 * @type bool $show_in_rest Whether data associated with this meta key can be considered public. 1005 1003 * } 1006 * @param string|array $ auth_callbackDeprecated. Use `$args` instead.1004 * @param string|array $deprecated Deprecated. Use `$args` instead. 1007 1005 * 1008 1006 * @return bool True if the meta key was successfully registered in the global array, false if not. … … 1010 1008 * callbacks, but will not add to the global registry as it requires a subtype. 1011 1009 */ 1012 function register_meta( $object_type, $meta_key, $args, $ auth_callback= null ) {1010 function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { 1013 1011 global $wp_meta_keys; 1014 1012 … … 1031 1029 ); 1032 1030 1033 $passed_args = array_slice( func_get_args(), 2 );1034 1035 1031 // There used to be individual args for sanitize and auth callbacks 1036 1032 $has_old_sanitize_cb = false; 1037 1033 1038 if ( is_callable( $passed_args[0] ) ) { 1039 $args['sanitize_callback'] = $passed_args[0]; 1034 if ( is_callable( $args ) ) { 1035 $args = array( 1036 'sanitize_callback' => $args, 1037 ); 1038 1040 1039 $has_old_sanitize_cb = true; 1041 1040 } else { 1042 $args = $passed_args[0];1043 } 1044 1045 if ( is set( $passed_args[1] ) && is_callable( $passed_args[1]) ) {1046 $args['auth_callback'] = $ passed_args[1];1041 $args = (array) $args; 1042 } 1043 1044 if ( is_callable( $deprecated ) ) { 1045 $args['auth_callback'] = $deprecated; 1047 1046 } 1048 1047
Note: See TracChangeset
for help on using the changeset viewer.