Support » Plugin: WP Favorite Posts » WP Favorite Posts (Plugin): Calling wpfp_link(); by ID?

  • Hi All –

    I can’t find an answer on the forums regarding this. With the nifty WP Favorite Posts plugin, does anyone know if there’s a way to execute the following by ID? An example of this would be calling on the WP Favorites Post link/function inside of a loop (where you’re looping through an array of post IDs):

    <?php if (function_exists('wpfp_link')) { wpfp_link(); } ?>

    Anyone happen to know? Simply executing the above mentioned line of code in the loop doesn’t work properly, as you can imagine.

    Many thanks in advance,

    — HJ

Viewing 1 replies (of 1 total)
  • Just tried the following and seems to work.
    Navigate yourself to wp-favorite-posts.php of the plugin.
    Make a copy of wpfp_link function below and add the post_id as an argument.
    e.g From
    function wpfp_link( $return = 0, $action = "", $show_span = 1, $args = array() )

    To : function wpfp_link_by_id( $post_id , $return = 0, $action = "", $show_span = 1, $args = array())

    Comment the $post_id = &$post->ID; in line 3 of the function.

    Then simple call it like this wpfp_link_by_id($post_id)

    Please note that any future update will erase your changes.

    I hope it helps if there are any problems with the above solution let me know.

Viewing 1 replies (of 1 total)
  • The topic ‘WP Favorite Posts (Plugin): Calling wpfp_link(); by ID?’ is closed to new replies.