[Resolved] GPP hooks and MemberMouse issue

Home Forums Support GPP hooks and MemberMouse issue

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #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,
    Stefan

    GeneratePress 1.3.48
    GP Premium 1.3.1
    #336294
    Tom
    Lead Developer
    Lead Developer

    Hi 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?

    #336316
    Stefan

    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.

    #336480
    Tom
    Lead Developer
    Lead Developer

    Is 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.

    #336630
    Stefan

    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 ticket

    #336633
    Stefan

    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.

    #336672
    Tom
    Lead Developer
    Lead Developer

    Hmm, 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' );
    });
    #336686
    Stefan

    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?

    #336952
    Tom
    Lead Developer
    Lead Developer

    Yep, I see no problem with that 🙂

    #336958
    Stefan

    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.

    #336961
    Tom
    Lead Developer
    Lead Developer

    Not seeing your application – can you try applying again?

    #336963
    Stefan

    This time I got a confirmation page. I hope you will see it there. 🙂

    #337014
    Tom
    Lead Developer
    Lead Developer
    #337023
    Stefan

    Tom, you are awesome.
    Thank you.

    #376434
    Sam

    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.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.