WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 536 | if ( $postmeta) { foreach ($postmeta as $p) { |
| 537 | $key = $this->get_tag( $p, 'wp:meta_key' ); |
| 538 | $value = $this->get_tag( $p, 'wp:meta_value' ); |
| 539 | $value = stripslashes($value); // add_post_meta() will escape. |
| 540 | |
| 541 | $this->process_post_meta($post_id, $key, $value); |
| 542 | |
| 543 | } } |
| 544 | |
| 545 | do_action('import_post_added', $post_id); |
| 546 | print "</li>\n"; |
| 547 | } |
| 548 | |
| 549 | function process_post_meta($post_id, $key, $value) { |
| 550 | // the filter can return false to skip a particular metadata key |
| 551 | $_key = apply_filters('import_post_meta_key', $key); |
| 552 | if ( $_key ) { |
| 553 | add_post_meta( $post_id, $_key, $value ); |
| 554 | do_action('import_post_meta', $post_id, $_key, $value); |