From 47e3944bd3609cb0fc6240e4c5bcfa3829648265 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Tue, 15 Aug 2023 00:04:11 +0200 Subject: [PATCH] Fix frontend error Function is only available in admin. Whoops. --- includes/functions/_roles.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/functions/_roles.php b/includes/functions/_roles.php index ba32f3b0..383c605e 100644 --- a/includes/functions/_roles.php +++ b/includes/functions/_roles.php @@ -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 ); }