-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESI - Add Edit with Elementor #635
ESI - Add Edit with Elementor #635
Conversation
Add admin bar to "wp_body_open" Also make sure is loaded just once. Tested the fix for PHP 5 too
36a0ef1
to
5db36f2
Compare
src/esi.cls.php
Outdated
@@ -760,7 +763,12 @@ public function sub_widget_block($instance, $widget, $args) | |||
public function sub_admin_bar_block() | |||
{ | |||
global $wp_admin_bar; | |||
static $rendered = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't define static here, plz define it in class level. Otherwise others won't be aware of this var and may cause conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to class
1bbf55b
to
acd608d
Compare
29d1647
to
cf4e313
Compare
@@ -771,6 +779,8 @@ public function sub_admin_bar_block() | |||
); | |||
|
|||
echo $this->sub_esi_block('admin-bar', 'adminbar', $params); | |||
|
|||
$this->admin_rendered = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is better moved to above line 781. That can give an additional safe check to avoid infinite embed just in case in $this->sub_esi_block()
it called some hook which fall into this func again. How do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* ESI - Add Edit with Elementor Add admin bar to "wp_body_open" Also make sure is loaded just once. Tested the fix for PHP 5 too * Move rendered to class level * Review change --------- Co-authored-by: Timotei <[email protected]>
* ESI - Add Edit with Elementor Add admin bar to "wp_body_open" Also make sure is loaded just once. Tested the fix for PHP 5 too * Move rendered to class level * Review change --------- Co-authored-by: Timotei <[email protected]>
No description provided.