Fix use of pre_get_posts hook to only use add_action()
add_filter() did work but was technically wrong.
This commit is contained in:
parent
fda42d7e0f
commit
9f6861b1c6
@ -293,7 +293,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
|
|||||||
| `manage_comments_custom_column` | `fictioneer_add_comments_report_column_content` (10)
|
| `manage_comments_custom_column` | `fictioneer_add_comments_report_column_content` (10)
|
||||||
| `manage_{$type}_posts_custom_column` | `fictioneer_manage_posts_column_patreon` (10), `fictioneer_manage_posts_column_chapter_story` (10)
|
| `manage_{$type}_posts_custom_column` | `fictioneer_manage_posts_column_patreon` (10), `fictioneer_manage_posts_column_chapter_story` (10)
|
||||||
| `personal_options_update` | `fictioneer_update_admin_user_profile` (10), `fictioneer_update_my_user_profile` (10), `fictioneer_update_admin_unlocked_posts` (10)
|
| `personal_options_update` | `fictioneer_update_admin_user_profile` (10), `fictioneer_update_my_user_profile` (10), `fictioneer_update_admin_unlocked_posts` (10)
|
||||||
| `pre_get_posts` | `fictioneer_extend_search_query` (11), `fictioneer_read_others_files` (10), `fictioneer_read_others_files_list_view` (10), `fictioneer_filter_chapters_by_story` (10)
|
| `pre_get_posts` | `fictioneer_extend_search_query` (11), `fictioneer_read_others_files` (10), `fictioneer_read_others_files_list_view` (10), `fictioneer_filter_chapters_by_story` (10), `fictioneer_extend_taxonomy_pages` (10), `fictioneer_edit_others_fictioneer_posts` (10), `fictioneer_add_sof_to_taxonomy_query` (10)
|
||||||
| `private_to_draft` | `fictioneer_chapter_to_draft` (10)
|
| `private_to_draft` | `fictioneer_chapter_to_draft` (10)
|
||||||
| `profile_update` | `fictioneer_on_profile_change` (10)
|
| `profile_update` | `fictioneer_on_profile_change` (10)
|
||||||
| `publish_to_draft` | `fictioneer_chapter_to_draft` (10)
|
| `publish_to_draft` | `fictioneer_chapter_to_draft` (10)
|
||||||
@ -366,7 +366,6 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
|
|||||||
| `post_stuck` | `fictioneer_prevent_post_sticky` (10)
|
| `post_stuck` | `fictioneer_prevent_post_sticky` (10)
|
||||||
| `postbox_classes_{$screen_id}_{$box_id}` | `fictioneer_append_metabox_classes` (10)
|
| `postbox_classes_{$screen_id}_{$box_id}` | `fictioneer_append_metabox_classes` (10)
|
||||||
| `pre_comment_user_ip` | `__return_empty_string` (10)
|
| `pre_comment_user_ip` | `__return_empty_string` (10)
|
||||||
| `pre_get_posts` | `fictioneer_extend_taxonomy_pages` (10), `fictioneer_edit_others_fictioneer_posts` (10), `fictioneer_add_sof_to_taxonomy_query` (10)
|
|
||||||
| `pre_insert_term` | `fictioneer_restrict_tag_creation` (9999)
|
| `pre_insert_term` | `fictioneer_restrict_tag_creation` (9999)
|
||||||
| `preprocess_comment` | `fictioneer_preprocess_comment` (30), `fictioneer_validate_comment_form` (20)
|
| `preprocess_comment` | `fictioneer_preprocess_comment` (30), `fictioneer_validate_comment_form` (20)
|
||||||
| `protected_title_format` | `fictioneer_remove_protected_text` (10)
|
| `protected_title_format` | `fictioneer_remove_protected_text` (10)
|
||||||
|
@ -1068,7 +1068,7 @@ if ( ! current_user_can( 'manage_options' ) ) {
|
|||||||
$query->set( 'author', get_current_user_id() );
|
$query->set( 'author', get_current_user_id() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add_filter( 'pre_get_posts', 'fictioneer_edit_others_fictioneer_posts' );
|
add_action( 'pre_get_posts', 'fictioneer_edit_others_fictioneer_posts' );
|
||||||
|
|
||||||
// === FCN_READ_OTHERS_FILES =================================================
|
// === FCN_READ_OTHERS_FILES =================================================
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ function fictioneer_extend_taxonomy_pages( $query ) {
|
|||||||
// Add all post types to taxonomy page query
|
// Add all post types to taxonomy page query
|
||||||
$query->set( 'post_type', ['post', 'fcn_story', 'fcn_chapter', 'fcn_recommendation', 'fcn_collection'] );
|
$query->set( 'post_type', ['post', 'fcn_story', 'fcn_chapter', 'fcn_recommendation', 'fcn_collection'] );
|
||||||
}
|
}
|
||||||
add_filter( 'pre_get_posts', 'fictioneer_extend_taxonomy_pages' );
|
add_action( 'pre_get_posts', 'fictioneer_extend_taxonomy_pages' );
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// MODIFY RSS FEEDS
|
// MODIFY RSS FEEDS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user