• Hi

    I’d like to change the title of the photos on the slideshow (adding the photo owner for example). Is it possible to have some filters for customization in a next version?

    This could be easely accomplished with wordpress filters and it would be transparent:
    in index.php line 380 remplace the if content with

    
    if ($slideshow_option != 'none') {
        $slideshow_photo_title = $photo['title'];
        $slideshow_photo_title = apply_filters( 'afg_slideshow_photo_title', $slideshow_photo_title, $photo );
        if (isset($rel))
            $disp_gallery .= "<a $class $rel $click_event href='{$photo_page_url}' title=\"{$slideshow_photo_title}\">";
        else
            $disp_gallery .= "<a $class $click_event href='{$photo_page_url}' title=\"{$slideshow_photo_title}\">";
    }
    

    than the title can be hooked in function.php like :

    
    function slideshow_photo_title($title, $photo) {
        $photo_title = $photo['title'];
        $owner_name = $photo['ownername'];
        $owner_id = $photo['owner'];
    
        $owner_profile = "https://www.flickr.com/$owner_id";
        $owner_link = "<a href='$owner_profile'>par $owner_name</a>";
    
        return "$photo_title $owner_link";
    }
    add_filter('afg_slideshow_photo_title', 'slideshow_photo_title', 10, 2);
    
    • This topic was modified 7 years, 1 month ago by davidkuehner.
    • This topic was modified 7 years, 1 month ago by davidkuehner.
  • The topic ‘Add WP Filters’ is closed to new replies.