Temporarily disabled login requirement for backend pages

This commit is contained in:
Ruben Ramirez 2025-04-04 15:11:02 -05:00
parent 38de3b234c
commit fe70cd65ea
7 changed files with 14 additions and 14 deletions

View file

@ -12,8 +12,8 @@
// Replace with a more specific capability like 'manage_quiztech_assessments' if defined.
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
// Redirect to login page or show an error message.
wp_safe_redirect( wp_login_url( get_permalink() ) );
exit;
// wp_safe_redirect( wp_login_url( get_permalink() ) );
// exit;
// Alternatively, display an error message:
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
}

View file

@ -13,8 +13,8 @@ $required_capability = 'edit_assessments'; // Corresponds to 'assessment' CPT ca
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
// Redirect to login page or show an error message.
wp_safe_redirect( wp_login_url( get_permalink() ) );
exit;
// wp_safe_redirect( wp_login_url( get_permalink() ) );
// exit;
// Alternatively, display an error message:
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
}

View file

@ -13,8 +13,8 @@ $required_capability = 'read';
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
// Redirect to login page or show an error message.
wp_safe_redirect( wp_login_url( get_permalink() ) );
exit;
// wp_safe_redirect( wp_login_url( get_permalink() ) );
// exit;
// Alternatively, display an error message:
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
}

View file

@ -12,8 +12,8 @@
// Replace with a more specific capability like 'manage_quiztech_jobs' if defined.
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
// Redirect to login page or show an error message.
wp_safe_redirect( wp_login_url( get_permalink() ) );
exit;
// wp_safe_redirect( wp_login_url( get_permalink() ) );
// exit;
// Alternatively, display an error message:
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
}

View file

@ -13,8 +13,8 @@ $required_capability = 'edit_questions'; // Corresponds to 'question' CPT capabi
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
// Redirect to login page or show an error message.
wp_safe_redirect( wp_login_url( get_permalink() ) );
exit;
// wp_safe_redirect( wp_login_url( get_permalink() ) );
// exit;
// Alternatively, display an error message:
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
}

View file

@ -12,8 +12,8 @@
// Replace with a more specific capability like 'manage_quiztech_options' if defined.
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
// Redirect to login page or show an error message.
wp_safe_redirect( wp_login_url( get_permalink() ) );
exit;
// wp_safe_redirect( wp_login_url( get_permalink() ) );
// exit;
// Alternatively, display an error message:
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
}

View file

@ -13,8 +13,8 @@ $required_capability = 'edit_jobs'; // Or a more specific 'view_results' capabil
if ( ! is_user_logged_in() || ! current_user_can( $required_capability ) ) {
// Redirect to login page or show an error message.
wp_safe_redirect( wp_login_url( get_permalink() ) );
exit;
// wp_safe_redirect( wp_login_url( get_permalink() ) );
// exit;
// Alternatively, display an error message:
// wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'quiztech' ), 403 );
}