From fcb15c97d1f7163222f4b662bf2ed3909db8b13d Mon Sep 17 00:00:00 2001 From: asus Date: Sun, 17 Mar 2024 18:16:28 +0100 Subject: [PATCH] v 0.3.1 - reset cgv - price works with all acf returns for radio buttons - redirection works --- plugins/cipf_plugin/cipf_plugin.php | 2 +- plugins/cipf_plugin/php/redirections.php | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/cipf_plugin/cipf_plugin.php b/plugins/cipf_plugin/cipf_plugin.php index 1b87998..0e9acde 100644 --- a/plugins/cipf_plugin/cipf_plugin.php +++ b/plugins/cipf_plugin/cipf_plugin.php @@ -2,7 +2,7 @@ /* Plugin Name: cipf_plugin Plugin URI: -Description: reset cgv, price works with acf label +Description: Author: hugogogo Version: 0.3.1 Author URI: diff --git a/plugins/cipf_plugin/php/redirections.php b/plugins/cipf_plugin/php/redirections.php index bb10874..3ed2e7a 100644 --- a/plugins/cipf_plugin/php/redirections.php +++ b/plugins/cipf_plugin/php/redirections.php @@ -26,22 +26,17 @@ function redirection_profil_CIPF(){ // Set up nocache headers before redirecting : https://developer.wordpress.org/reference/functions/wp_safe_redirect/#user-contributed-notes nocache_headers(); -error_log("- in redirection_profil_CIPF"); - if (!is_user_logged_in()) { -error_log("user not logged in"); wp_redirect($base_url, 301); exit; } if (current_user_can($role_prof)) { -error_log("user is prof"); $user_page = get_author_posts_url($current_user_id); wp_redirect($user_page, 301); exit; } else if (current_user_can($role_partner)) { -error_log("user is partner"); $args = array( 'post_type' => 'post', 'author' => $current_user_id, @@ -60,7 +55,6 @@ error_log("user is partner"); exit; } else { -error_log("else"); wp_redirect($base_url, 301); exit; } @@ -71,7 +65,7 @@ error_log("else"); /* -* version 3: +* version 4: * redirects when trying to access the page with SLUG_PAGE_REDIRECTION * no matter if it exists or not * @@ -156,6 +150,7 @@ add_action('template_redirect', 'redirection_page_CIPF'); /* +* version 3: * DOES NOT WORK so far * because to use is_user_logged_in() in redirection_profil_CIPF * the request should include the X-WP-Nonce header, but it does not