Changeset 38041 for trunk/src/wp-includes/meta.php
- Timestamp:
- 07/13/2016 04:45:50 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/meta.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r38040 r38041 1033 1033 // There used to be individual args for sanitize and auth callbacks 1034 1034 $has_old_sanitize_cb = false; 1035 $has_old_auth_cb = false; 1035 1036 1036 1037 if ( is_callable( $args ) ) { … … 1046 1047 if ( is_callable( $deprecated ) ) { 1047 1048 $args['auth_callback'] = $deprecated; 1049 $has_old_auth_cb = true; 1048 1050 } 1049 1051 … … 1063 1065 1064 1066 // Object subtype is required if using the args style of registration 1065 if ( ! $has_old_sanitize_cb && empty( $args['object_subtype'] ) ) {1067 if ( ! $has_old_sanitize_cb && ! $has_old_auth_cb && empty( $args['object_subtype'] ) ) { 1066 1068 return new WP_Error( 'register_meta_failed', __( 'Meta must be registered against an object subtype.' ) ); 1067 1069 } … … 1082 1084 } 1083 1085 1084 // Back-compat: old sanitize and auth callbacks a pplied to all of an object type1085 if ( $has_old_sanitize_cb ) {1086 // Back-compat: old sanitize and auth callbacks are applied to all of an object type. 1087 if ( $has_old_sanitize_cb && is_callable( $args['sanitize_callback'] ) ) { 1086 1088 add_filter( "sanitize_{$object_type}_meta_{$meta_key}", $args['sanitize_callback'], 10, 4 ); 1089 } 1090 1091 if ( $has_old_auth_cb && is_callable( $args['auth_callback'] ) ) { 1087 1092 add_filter( "auth_{$object_type}_meta_{$meta_key}", $args['auth_callback'], 10, 6 ); 1088 } else { 1093 } 1094 1095 if ( ! $has_old_auth_cb && ! $has_old_sanitize_cb) { 1089 1096 if ( is_callable( $args['sanitize_callback'] ) ) { 1090 1097 add_filter( "sanitize_{$object_type}_{$object_subtype}_meta_{$meta_key}", $args['sanitize_callback'], 10, 4 );
Note: See TracChangeset
for help on using the changeset viewer.