- reorganized files
- fixed error in partner edti/creation page
This commit is contained in:
@@ -17,7 +17,6 @@ function is_own_partner() {
|
||||
Plgntls::debug_infos(2);
|
||||
$role_partner = Cipf::ROLE_PARTNER;
|
||||
|
||||
error_log("in toggle A");
|
||||
/*
|
||||
* is_single() will only return true for published post
|
||||
* so instead checks for both is_singular and post_type
|
||||
@@ -34,27 +33,22 @@ error_log("post type: " . get_post_type());
|
||||
}
|
||||
*/
|
||||
|
||||
error_log("in toggle B");
|
||||
if (!is_user_logged_in()) {
|
||||
return false;
|
||||
}
|
||||
error_log("in toggle C");
|
||||
if (!current_user_can($role_partner)) {
|
||||
return false;
|
||||
}
|
||||
error_log("in toggle D");
|
||||
global $post;
|
||||
if (is_null($post)) {
|
||||
return false;
|
||||
}
|
||||
error_log("in toggle E");
|
||||
Plgntls::debug_infos();
|
||||
$current_post_author = (int)($post->post_author);
|
||||
$current_user_id = (int)get_current_user_id();
|
||||
if ($current_user_id !== $current_post_author) {
|
||||
return false;
|
||||
}
|
||||
error_log("in toggle F");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -115,20 +109,16 @@ function toggle_partner_page_CIPF() {
|
||||
* - has query action
|
||||
*
|
||||
*/
|
||||
error_log("in toggle 1");
|
||||
if (!is_own_partner()) {
|
||||
return;
|
||||
}
|
||||
error_log("in toggle 2");
|
||||
Plgntls::debug_infos();
|
||||
if (!isset($_GET['action'])) {
|
||||
return;
|
||||
}
|
||||
error_log("in toggle 3");
|
||||
if ($_GET['action'] !== $toggle_partner_page) {
|
||||
return;
|
||||
}
|
||||
error_log("in toggle 4");
|
||||
|
||||
/*
|
||||
* get the post id and object
|
||||
@@ -139,7 +129,6 @@ error_log("in toggle 4");
|
||||
if (is_null($current_post)) {
|
||||
return;
|
||||
}
|
||||
error_log("in toggle 5");
|
||||
|
||||
/*
|
||||
* toogle the status
|
||||
|
||||
Reference in New Issue
Block a user