Harm10
Forum Replies Created
-
Forum: Plugins
In reply to: [Five Star Restaurant Reviews] Show More button has no event?Closing….
Forum: Plugins
In reply to: [Five Star Restaurant Reviews] Show More button has no event?Do you want this report to remain Open until the next release?
I assume this report can be closed?
Forum: Plugins
In reply to: [Five Star Restaurant Reviews] Show More button has no event?I know PHP notices do not break the code but they aren’t there for nothing!
Can you inform when you expect them to be fixed in an update?Forum: Plugins
In reply to: [Five Star Restaurant Reviews] Show More button has no event?As I am not using those plugins but am using the normal plugin isn’t it kind of strange that I need to set those values using a hook? The values are normally there so can be picked up or not? Why do you ask this of your users? Or is this a temporary fix?
Forum: Plugins
In reply to: [Five Star Restaurant Reviews] Show More button has no event?Forgive my ignorance…… But what is (or are) Five Star Business Profile and Schema plugin?
I am using the free version of Five Star Restaurant Reviews and not those mentioned above?I just found that is_admin() is set to true by WP itself when doing AJAX. This seems to be a (undesired) side effect of the AJAX part in WP.
See Is admin and AJAX.
I changed the code toif ( is_admin() && ! wp_doing_ajax() ) { return $meta; }
and then it works OK even when I click the AJAX action button.I looked at your code and that is of no use to me! I want to discern whether an admin is on the admin pages doing something or looking at the web pages. A lot of times hooks are also fired when you are on the admin pages.
If you can confirm that this hook is NEVER fired on the admin side then I can remove this protection (although I still think you should not interfere with the value of a STANDARD function of WordPress).I will try your suggestion and report back.
But…….. is_admin() is a WordPress delivered function: WP function so the result should not be interfered with by a plug-in! Or am I wrong in this assumption?Forum: Plugins
In reply to: [Five Star Restaurant Reviews] Show More button has no event?I am sorry to say that all 3 settings are set since installing WordPress years ago. So they have values. So I do not understand why template-functions.php seems to think that they are not set. Can you please explain? And can I expect the same notices on my live site as soon as I upgrade the plug-in when all problems are solved?
Forum: Plugins
In reply to: [Five Star Restaurant Reviews] Show More button has no event?I would like to ask again whether the notices in my log (they keep on cropping up quite regularly) will be investigated?
PHP Notice: Undefined index: name in /myurl/wp-content/plugins/good-reviews-wp/includes/template-functions.php on line 611 PHP Notice: Undefined index: description in /myurl/wp-content/plugins/good-reviews-wp/includes/template-functions.php on line 612 PHP Notice: Undefined index: url in /myurl/wp-content/plugins/good-reviews-wp/includes/template-functions.php on line 613
This is very weird. I have used your example code and for the reviews that are shown right away the max is changed to 10 indeed (as did my own customization), but on the reviews that are displayed when I click the button nothing changes.
But I found what causes it! At least something you can investigate!
My test code is thisfunction remark_greviews_post_meta_test( $meta ) { if (is_admin()) { return $meta; } $meta['rating_max'] = 10; $meta['review_date'] = 'Test!'; return $meta; }
And then the meta does not get changed whenever the AJAX is fired. But if I comment the is_admin() then it works!
I always use the is_admin() function so you will not get adverse effects when you are on the admin side of WordPress.
So the question now is why is_admin() is true after AJAX fires?
Can you please ask the developers?No problem that it takes some time! I am glad with the support I am getting. Many plug-ins can take this as an example.
As you may have gathered I often use hooks to customize things.
So I can wait for an answer.If you ask me then offering a hook should mean that you offer it always irrespective on the form of code. But that is just my two cents…….. ??
It seems to me that when using the short code, filter grfwp_post_meta is not called when I click the AJAX button.
When I am on the short code page I use the filter to force the value back in $meta[‘review_date’] as it is blanked out in the code for the short code.
When testing now I put a fixed text in there that gets displayed for the reviews that are shown right away but not for those that are displayed after you click the AJAX button.
Can you confirm that grfwp_post_meta is called after the AJAX action?Thanks for the update! I can confirm that the filter grfwp_print_review_obj now gets the data after the Show More button is clicked but in filter grfwp_post_meta the data still seems to be missing?