- This topic has 15 replies, 4 voices, and was last updated 8 years, 7 months ago by
Tom.
-
AuthorPosts
-
June 20, 2017 at 12:26 am #336043
Stefan
Hi,
I’ve got a little incompatibility issue which is described here: Getting 404 Errors When Clicking SmartTag Links. There is also a solution.
I found out that it’s caused by GPP hooks. Is there any other solution (action hook or something) how can I resolve this issue without modifying core file?
Thank you for your help.
Regards,
StefanJune 20, 2017 at 9:02 am #336294Tom
Lead DeveloperLead DeveloperHi there,
That would be an issue with adding javascript to the main editors in WP, not GP Hooks. Are you having issues with adding it to the page editors or hooks?
June 20, 2017 at 9:26 am #336316Stefan
Hi Tom,
let me explain better. MemberMouse has a core page myaccount. Members on that page can modify theirs information but when I click on update button I get an error page. You can see here how myaccount page looks like (myaccout page )
When I disable Hook addon everything works as it should. It also works when I add ‘javascript’ to the $protocols (wp-includes/functions.php) and hook addon is on.
Otherwise every other funcionality of GP Premium of MemberMouse works good. I can add PHP code or some shortcodes to hooks and it works. Other funcionality of MemberMouse such as submitting the checkout form isn’s affectedd by that problem.
I’m sorry I didn’t describe this issue better for the first time.
June 20, 2017 at 1:57 pm #336480Tom
Lead DeveloperLead DeveloperIs there anything in your hook fields? I’m not sure how hooks could cause any error pages, unless the code added into one of them is the cause.
June 20, 2017 at 10:03 pm #336630Stefan
In After content hook is
<?php if (is_single() ) : ?>
[related_posts_by_tax format=”thumbnails” columns=”2″ image_size=”medium” title=”My Related Posts” posts_per_page=”2″]
<?php endif; ?>It doesn’t work even if I delete it.
I tried put this code to my child theme’s function file
function gpmm_allow_javascript_protocol( $protocols ) {
$protocols[] = ‘javascript’;
return $protocols;
}
add_filter(‘kses_allowed_protocols’, ‘gpmm_allow_javascript_protocol’ );but it doesn’t work either.
Maybe this has something to do with WordPress ticketJune 20, 2017 at 10:12 pm #336633Stefan
I tried that code
function gpmm_allow_javascript_protocol( $protocols ) {
$protocols[] = ‘javascript’;
return $protocols;
}
add_action(‘plugins_loaded’, function(){add_filter(‘kses_allowed_protocols’, ‘gpmm_allow_javascript_protocol’ );});
print_r(wp_allowed_protocols());when Hook add-on activated the problem persists and no javascript protocol is added, but when i deactivate Hook add-on
I can see that javascript protocol is added and everything works.June 21, 2017 at 12:06 am #336672Tom
Lead DeveloperLead DeveloperHmm, Hooks shouldn’t care what functions you have added – it’s literally a bunch of text boxes which add hook related functions for you.
Try this code:
function gpmm_allow_javascript_protocol( $protocols ) { $protocols[] = 'javascript'; return $protocols; } add_action( 'after_setup_theme', function() { add_filter( 'kses_allowed_protocols', 'gpmm_allow_javascript_protocol' ); });June 21, 2017 at 12:34 am #336686Stefan
Unfortunately this didn’t help. Still the same.
Update:
Maybe I found a solution.
I’ve created a simple plugin with one php file
<?php /* Plugin name: Allow javascript protocol */ function gpmm_allow_javascript_protocol( $protocols ) { $protocols[] = 'javascript'; return $protocols; } add_filter( 'kses_allowed_protocols', 'gpmm_allow_javascript_protocol' );added to the folder, uploaded and activated it.
Now javascript protocol is added, hooks add-on activated and on myaccount page button links don’t point to http://test.dev/myaccount/myaccount_js.updateAccountDetails(20); but only to javascript:myaccount_js.updateAccountDetails(20);.
Everything works as it should.
Is this the right approach how to solve it?
June 21, 2017 at 9:33 am #336952Tom
Lead DeveloperLead DeveloperYep, I see no problem with that 🙂
June 21, 2017 at 9:42 am #336958Stefan
Thank you, Tom.
Also thanks to rosshanney for the idea.
Tom, would you please check on affiliate applications. I just want to know if you can see my application there, because I didn’t get any confirmation after I signed up.
Thanks.
June 21, 2017 at 9:54 am #336961Tom
Lead DeveloperLead DeveloperNot seeing your application – can you try applying again?
June 21, 2017 at 10:05 am #336963Stefan
This time I got a confirmation page. I hope you will see it there. 🙂
June 21, 2017 at 11:19 am #337014Tom
Lead DeveloperLead DeveloperApproved 🙂
June 21, 2017 at 11:33 am #337023Stefan
Tom, you are awesome.
Thank you.August 30, 2017 at 5:00 pm #376434Sam
I’ve run into this same issue, but the code snippet isn’t working for me. I did switch to TwentyTwelve theme and the issue was still happening, so in my case the problem doesn’t seem to be GP.
-
AuthorPosts
- You must be logged in to reply to this topic.