WP Favorite Posts
[resolved] Successful addition of Grey Toggle Image Functionality (2 posts)

  1. silfani
    Posted 4 years ago #

    I managed to edit the plugin to toggle the star image from yellow to grey. Here's the crude, but working hack:

    1. Create star-grey.png image by desaturating the provided star.png image.

    2. Add the following function:

    function wpfp_before_link_img_grey() {
        $options = wpfp_get_options();
        $option = $options['before_image_grey'];
        return "<img src='". WPFP_PATH . "/img/star-grey.png' alt='Not Favorite' title='Not Favorite' class='wpfp-img' />";

    Note it skips the options variable for now.

    Added the following code to the main wpfp_link function:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    This seems to work really well once the Show remove link and Show add link functions are enabled on the plugins admin page.

    Next up, create a downloadable version of the favorites list. Thanks Huseyin for a great plugin.


  2. houseofstrauss
    Posted 4 years ago #

    Can you repost this, as it was moderated to remove some code.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Favorite Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic