Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: delete_{$meta_type}_meta

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
205           $query .= $wpdb->prepare(" AND $type_column = %d", $object_id );
206
207      if ( $meta_value )
208           $query .= $wpdb->prepare(" AND meta_value = %s", $meta_value );
209
210      $meta_ids = $wpdb->get_col( $query );
211      if ( !count( $meta_ids ) )
212           return false;
213
214      do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
215
216      $query = "DELETE FROM $table WHERE $id_column IN( " . implode( ',', $meta_ids ) . " )";
217
218      $count = $wpdb->query($query);
219
220      if ( !$count )
221           return false;
222
223      wp_cache_delete($object_id, $meta_type . '_meta');