[wp-trac] [WordPress Trac] #43238: Media Library is empty on multiple sites
WordPress Trac
noreply at wordpress.org
Tue Feb 6 22:21:03 UTC 2018
#43238: Media Library is empty on multiple sites
-------------------------------+-----------------------------------------
Reporter: adampatterson | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.9.4
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses: javascript, administration
-------------------------------+-----------------------------------------
Comment (by adampatterson):
OK, I found the error, and I'm a little confused. Would suppress_filters
not be availbile at all times?
'''The error found in the log was:'''
[06-Feb-2018 22:17:03 UTC] PHP Notice: Undefined index: suppress_filters
in /PATH/wp-content/themes/adam/functions.php on line 22
[06-Feb-2018 22:17:03 UTC] PHP Stack trace:
[06-Feb-2018 22:17:03 UTC] PHP 1. {main}() /PATH/wp-admin/admin-
ajax.php:0
[06-Feb-2018 22:17:03 UTC] PHP 2. do_action() /PATH/wp-admin/admin-
ajax.php:97
[06-Feb-2018 22:17:03 UTC] PHP 3. WP_Hook->do_action() /PATH/wp-
includes/plugin.php:453
[06-Feb-2018 22:17:03 UTC] PHP 4. WP_Hook->apply_filters() /PATH/wp-
includes/class-wp-hook.php:310
[06-Feb-2018 22:17:03 UTC] PHP 5. wp_ajax_query_attachments() /PATH/wp-
includes/class-wp-hook.php:286
[06-Feb-2018 22:17:03 UTC] PHP 6. WP_Query->__construct() /PATH/wp-
admin/includes/ajax-actions.php:2482
[06-Feb-2018 22:17:03 UTC] PHP 7. WP_Query->query() /PATH/wp-includes
/class-wp-query.php:3336
[06-Feb-2018 22:17:03 UTC] PHP 8. WP_Query->get_posts() /PATH/wp-
includes/class-wp-query.php:3230
[06-Feb-2018 22:17:03 UTC] PHP 9. do_action_ref_array() /PATH/wp-
includes/class-wp-query.php:1634
[06-Feb-2018 22:17:03 UTC] PHP 10. WP_Hook->do_action() /PATH/wp-
includes/plugin.php:515
[06-Feb-2018 22:17:03 UTC] PHP 11. WP_Hook->apply_filters() /PATH/wp-
includes/class-wp-hook.php:310
[06-Feb-2018 22:17:03 UTC] PHP 12. show_draft_posts() /PATH/wp-includes
/class-wp-hook.php:286
'''Caused by'''
{{{#!php
function show_draft_posts( $query ) {
if ( user_can( wp_get_current_user(), 'administrator' ) ) {
if ( $query->query_vars['suppress_filters'] ) {
return $query;
}
$query->set( 'post_status', [ 'publish', 'draft' ] );
return $query;
}
if ( is_admin() ) {
return $query;
}
}
add_filter( 'pre_get_posts', 'show_draft_posts' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43238#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list