Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_{$meta_type}_metadata_by_mid

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
738       * The dynamic portion of the hook, `$meta_type`, refers to the meta object type
739       * (post, comment, term, user, or any other type with an associated meta table).
740       * Returning a non-null value will effectively short-circuit the function.
741       *
742       * @since 5.0.0
743       *
744       * @param stdClass|null $value   The value to return.
745       * @param int           $meta_id Meta ID.
746       */
747      $check = apply_filters( "get_{$meta_type}_metadata_by_mid", null, $meta_id );
748      if ( null !== $check ) {
749           return $check;
750      }
751
752      $id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';
753
754      $meta = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE $id_column = %d", $meta_id ) );
755
756      if ( empty( $meta ) ) {