Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Brady Vercher

    (@bradyvercher)

    Hi punkerben, the widget will only work on the Widgets screen for now. I’ve got a pretty good idea of how to fix this, but don’t have the time to tackle it at the moment. I do hope to address this at some point in the future, though.

    Thanks,
    Brady

    Thread Starter Benjamin

    (@punkerben)

    Super simple fix, since the javascript is already there to pull the media modal, you can add the class .insert-media to the button, tahda!

    like so on line 168 in class-simple-image-widget.php

    $button_class = array( 'button', 'button-hero', 'simple-image-widget-control-choose', 'insert-media' );

    //
    nevermind that worked to use the media modal but then it inserted it into the content not the widget ??

    Thread Starter Benjamin

    (@punkerben)

    I Have to say thanks for the update but I am still having issue getting it to work on page widgets.

    The .js and the .css are not loaded so that might be where it is going wrong.

    Plugin Author Brady Vercher

    (@bradyvercher)

    Hey punkerben,

    I did look into that plugin at one point before this release, but didn’t have time to configure it and test. You’re right about the js/css not loading being the root of the issue, however, there doesn’t appear to be a decent way to add support without adding bloat or causing the assets to be loaded everywhere for everyone (they’re not usually needed outside of the widgets screen). I did see the developer of the other plugin specifically added support for another image widget, so they might be willing to add support for this one if you get in touch.

    Otherwise, you can drop this snippet of code in your theme’s functions.php to load those assets everywhere and make it work:

    add_action( 'admin_enqueue_scripts', array( $GLOBALS['simple_image_widget'], 'enqueue_admin_assets' ) );

    Hope that helps.

    Cheers,
    Brady

    Thread Starter Benjamin

    (@punkerben)

    Much Thanks, I did see they made the call to other plugin, I am using it now. I do have to say that even though your plugin is only slightly different it’s better then the other one. I will have to try your functions.php fix and debate on which one to use.
    Thanks for the help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Use with WP Page Widget’ is closed to new replies.