WordPress.org

Ready to get started?Download WordPress

Forums

Image Widget
[resolved] [request] Network (domain mapping) Image link and URL (3 posts)

  1. TCBarrett
    Member
    Posted 1 year ago #

    Hello

    I'm using this in a network/multisite environment with domain mapping. The plugin does work, but the image sources and links use the non-mapped url.

    There is a filter to change the image source, but not one for the link. Here's some example code how I use it:

    add_filter( 'image_widget_image_url', 'tcb_image_widget_image_url', 1, 3 );
    function tcb_image_widget_image_url( $url, $args, $instance ){
      if( is_multisite() ) :
        if( function_exists('domain_mapping_post_content') ) :
          $url = domain_mapping_post_content( $url );
        endif;
      endif;
      return $url;
    }

    Any chance of adding a similar filter to the 'link' setting, or wrapping a filter around the whole HTML chunk (to be passed through dm filter)?

    http://wordpress.org/extend/plugins/image-widget/

  2. Peter Chester
    Modern Tribe
    Plugin Author

    Posted 1 year ago #

    Awesome!

    Ask and ye (may) receive. I just deployed 3.3.7 with a bunch of filters for all the variables in the image widget display. (Though technically you could have also achieved this by using the poorly named 'sp_template_image-widget_widget.php' filter to completely override the display template. see: http://wordpress.org/extend/plugins/image-widget/other_notes/)

    In any case a bunch more filters have been added. Thanks!

    http://wordpress.org/extend/plugins/image-widget/changelog/

  3. TCBarrett
    Member
    Posted 1 year ago #

    Super smashing lovely. Thank you :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.