WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. silfani
    Member
    Posted 3 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.

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. houseofstrauss
    Member
    Posted 3 years ago #

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

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic