Support » Plugin: Perfect Images + Retina » Using the plugin in a shrtcode

  • Resolved ikivanov

    (@ikivanov)


    I have a custom shortcode I coded that echoes <imd>
    How can I connect or pass that thru retina 2x to do its magic? I didn’t see any API or functions I can call in the documentation.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    There is a file called api.php, you can call those functions šŸ™‚ But do you really need to call the functions? What is your shortcode doing?

    Thread Starter ikivanov

    (@ikivanov)

    The shortcode is simply echoing an image with a given id and adding some attributes. Instead of importing img thru the add media button, I prefer to have a shortcode and call certain images by id. Then I pass attributes to add wraps, class, link etc. So the shortcode generates either or

    Hope I explained it well.

    Plugin Author Jordy Meow

    (@tigroumeow)

    In this case, that will be handled automatically by WP Retina 2x. Your images will go through the standard Responsive functions of WordPress in which my plugin hooks itself. Check the “new functions”: https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/. If your image generated by your shortcode doesn’t go through those functions, there is a problem šŸ™‚

    Thread Starter ikivanov

    (@ikivanov)

    Thanks a lot, Jordy.

    I wasn’t aware of that new feature in WordPress.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using the plugin in a shrtcode’ is closed to new replies.