Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: register_meta_args

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1169       * Filters the registration arguments when registering meta.
1170       *
1171       * @since 4.6.0
1172       *
1173       * @param array  $args        Array of meta registration arguments.
1174       * @param array  $defaults    Array of default arguments.
1175       * @param string $object_type Object type.
1176       * @param string $meta_key    Meta key.
1177       */
1178      $args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key );
1179      $args = wp_parse_args( $args, $defaults );
1180
1181      $object_subtype = ! empty( $args['object_subtype'] ) ? $args['object_subtype'] : '';
1182
1183      // If `auth_callback` is not provided, fall back to `is_protected_meta()`.
1184      if ( empty( $args['auth_callback'] ) ) {
1185           if ( is_protected_meta( $meta_key, $object_type ) ) {
1186                $args['auth_callback'] = '__return_false';
1187           } else {