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 |
---|---|
376 |
|
377 | $sql_exclude_cats = ''; |
378 | if ( !empty($excluded_categories) ) { |
379 | $blah = explode(' and ', $excluded_categories); |
380 | $posts_in_ex_cats = get_objects_in_term($blah, 'category'); |
381 | $posts_in_ex_cats_sql = 'AND p.ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; |
382 | } |
383 |
|
384 | $join = apply_filters( 'get_previous_post_join', $join, $in_same_cat, $excluded_categories ); |
385 | $where = apply_filters( 'get_previous_post_where', "WHERE p.post_date < '$current_post_date' AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql", $in_same_cat, $excluded_categories ); |
386 | $sort = apply_filters( 'get_previous_post_sort', 'ORDER BY p.post_date DESC LIMIT 1' ); |
387 |
|
388 | return @$wpdb->get_row("SELECT p.ID, p.post_title FROM $wpdb->posts AS p $join $where $sort"); |
389 | } |
390 |
|
391 | function get_next_post($in_same_cat = false, $excluded_categories = '') { |
392 | global $post, $wpdb; |
393 |
|
394 | if( empty($post) || !is_single() || is_attachment() ) |