Skip to content

Commit

Permalink
Correcting problem with archive page queries
Browse files Browse the repository at this point in the history
  • Loading branch information
jesgs committed Dec 22, 2014
1 parent 4f3c1e6 commit e5df0c1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions includes/comicarchive-functions.php
Expand Up @@ -17,13 +17,12 @@
function mangapress_get_all_comics_for_archive()
{
global $wp_actions;

// TODO Ordering options
// TODO Sort parameters for taxonomies
// TODO Move add/remove filter calls to separate functions
do_action('_mangapress_pre_archives_get_posts');
add_filter('posts_orderby', 'mangapress_orderby');
add_filter('posts_fields', 'mangapress_select_fields');
add_filter('posts_join', 'mangapress_join');

$archives = new WP_Query(array(
'post_type' => 'mangapress_comic',
'posts_per_page' => -1,
Expand All @@ -32,10 +31,8 @@ function mangapress_get_all_comics_for_archive()
if (isset($wp_actions['_mangapress_pre_archives_get_posts'])) {
unset($wp_actions['_mangapress_pre_archives_get_posts']);
}

remove_all_actions('_mangapress_pre_archives_get_posts');
remove_filter('posts_orderby', 'mangapress_orderby');
remove_filter('posts_fields', 'mangapress_select_fields');
remove_filter('posts_join', 'mangapress_join');

return $archives;
}

0 comments on commit e5df0c1

Please sign in to comment.