WordPress.org

Ready to get started?Download WordPress

Forums

Royal PrettyPhoto
Code snippet for Buddypress activity (1 post)

  1. lenasterg
    Member
    Posted 1 year ago #

    Thanks for the great plugin.

    You can also use it for Buddypress activity by simply adding the following in your custom.php file

    add_filter('bp_get_activity_content_body', 'royal_prettyphoto_replaceBuddypress');
    
    function royal_prettyphoto_replaceBuddypress($content) {
        $pattern = "/<a(.*?)href=('|\")([^>]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>(.*?)<\/a>/i";
        $replacement = '<a$1href=$2$3.$4$5 rel="prettyPhoto[' . bp_get_activity_id() . ']"$6>$7</a>';
        $content = preg_replace($pattern, $replacement, $content);
        return $content;
    }

    Bests Lena

    http://wordpress.org/plugins/rt-prettyphoto/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.