Support » Plugin: WP Favorite Posts » Need to click wpfp_link() twice to return "remove" or "add" link?

  • At some point I noticed that the wpfp_link I was adding to my templates was not working until I clicked it twice. This includes the “add” link, “remove” link, “clear” link. I’m puzzled, though, because the address bar does display the append on the first click and the item will show up in the favorites list with one click. The page just doesn’t load the replacement link code. Also, the clear button hasn’t cleared the cart until I visit the page again, with or without the ?wpfpaction=clear in the address bar.

    The one that doesn’t seem to require two clicks is the remove link on the favorites list template page. (the wpfp_remove_favorite_link(get_the_ID()); link)

    I’m wondering if other folks see this or if I created the issue while editing the template.

    I’ve tried testing placement of the link and syntax

    <?php wpfp_link(); ?>
    <?php echo wpfp_link(); ?>
    <?php wpfp_link() ?>
    <?php echo wpfp_link() ?>

    https://wordpress.org/plugins/wp-favorite-posts/

Viewing 1 replies (of 1 total)
  • OK, so not really sure why but I when I add the parameter page=1 to the URL, this resolves my issue of having to click twice.

    I changed this:

    $link = "<a class='wpfp-link' href='?wpfpaction=".$action."&postid=". $post_id . "' title='". $opt ."' rel='nofollow'>". $opt ."</a>";

    to this

    $link = "<a class='wpfp-link' href='?wpfpaction=".$action."&page=1&postid=". $post_id . "' title='". $opt ."' rel='nofollow'>". $opt ."</a>";

    I probably commented out something about paging somewhere. I also noticed that it worked without that edit if I was logged in as an administrator.

Viewing 1 replies (of 1 total)
  • The topic ‘Need to click wpfp_link() twice to return "remove" or "add" link?’ is closed to new replies.