Skip to content

Instantly share code, notes, and snippets.

@peterchester
Last active December 28, 2015 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterchester/7441906 to your computer and use it in GitHub Desktop.
Save peterchester/7441906 to your computer and use it in GitHub Desktop.
WordPress Image Widget support for SiteOrigin's Page Builder plugin. Put this in your functions.php file if you want the Image Widget (http://wordpress.org/plugins/image-widget/) to work with Page Builder (http://siteorigin.com/page-builder/).
/**
* Enqueue the necessary javascript to support the Image Widget in Site Origin's Page Builder
*/
function tribe_image_widget_siteorigin_page_builder_support() {
global $wp_widget_factory;
if ( isset( $wp_widget_factory->widgets ) && isset( $wp_widget_factory->widgets['Tribe_Image_Widget'] ) ) {
add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $wp_widget_factory->widgets['Tribe_Image_Widget'], 'admin_setup' ) );
}
}
add_action('widgets_init', 'tribe_image_widget_siteorigin_page_builder_support', 999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment