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 |
---|---|
1447 | $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1", $alt_post_name, $post_type, $post_ID, $post_parent)); |
1448 | $suffix++; |
1449 | } while ($post_name_check); |
1450 | $post_name = $alt_post_name; |
1451 | } |
1452 | } |
1453 |
|
1454 | // expected_slashed (everything!) |
1455 | $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'guid' ) ); |
1456 | $data = apply_filters('wp_insert_post_data', $data, $postarr); |
1457 | $data = stripslashes_deep( $data ); |
1458 | $where = array( 'ID' => $post_ID ); |
1459 |
|
1460 | if ($update) { |
1461 | do_action( 'pre_post_update', $post_ID ); |
1462 | if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { |
1463 | if ( $wp_error ) |
1464 | return new WP_Error('db_update_error', __('Could not update post in the database'), $wpdb->last_error); |
1465 | else |