Fix frontend error

Function is only available in admin. Whoops.
This commit is contained in:
Tetrakern 2023-08-15 00:04:11 +02:00
parent 3a506256a7
commit 47e3944bd3

View File

@ -827,7 +827,6 @@ if ( ! current_user_can( 'manage_options' ) ) {
$screen = get_current_screen();
if (
is_admin() &&
$wp_query->is_main_query() &&
$wp_query->query['post_type'] === 'attachment' &&
$screen && $screen->base == 'upload' &&
@ -838,7 +837,7 @@ if ( ! current_user_can( 'manage_options' ) ) {
}
}
if ( ! current_user_can( 'fcn_read_others_files' ) ) {
if ( ! current_user_can( 'fcn_read_others_files' ) && is_admin() ) {
add_action( 'pre_get_posts', 'fictioneer_read_others_files', 9999 );
add_action( 'pre_get_posts', 'fictioneer_read_others_files_list_view', 9999 );
}