This repository has been archived by the owner. It is now read-only.

Gallery Widget #120

Merged
merged 43 commits into from Sep 19, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+7 −16
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Register gallery widget CSS via wp_default_styles() and enqueue in wi…

…dget
  • Loading branch information...
westonruter committed Sep 11, 2017
commit 2e8c03a0ed0b1a5e3da6c9685577cfe3bad7c8f5
Copy path View file
@@ -100,28 +100,18 @@ function wp32417_add_default_filters() {
*/
function wp32417_default_styles( WP_Styles $styles ) {
$handle = 'media-widgets';
$src = plugin_dir_url( __FILE__ ) . 'wp-admin/css/widgets/media-widgets.css';
if ( ! WP_CORE_MEDIA_WIDGETS_MERGED ) {
$src = plugin_dir_url( __FILE__ ) . 'wp-admin/css/widgets/media-widgets.css';
$styles->add( $handle, $src, array( 'media-views' ) );
}
}
add_action( 'wp_default_styles', 'wp32417_default_styles' );
/**
* Register gallery widget preview styles.
*
* @codeCoverageIgnore
*/
function wp32417_enqueue_gallery_styles() {
$handle = 'media-gallery-widget';
$src = plugin_dir_url( __FILE__ ) . 'wp-admin/css/widgets/media-gallery-widget.css';
wp_enqueue_style( $handle, $src );
}
if ( ! WP_CORE_GALLERY_WIDGET_MERGED ) {
add_action( 'customize_controls_print_styles', 'wp32417_enqueue_gallery_styles' );
if ( ! WP_CORE_GALLERY_WIDGET_MERGED ) {
$src = plugin_dir_url( __FILE__ ) . 'wp-admin/css/widgets/media-gallery-widget.css';
$styles->add( $handle, $src, array( 'media-views' ) );
}
}
add_action( 'wp_default_styles', 'wp32417_default_styles' );
/**
* Style fixes for default themes.
@@ -127,6 +127,7 @@ public function enqueue_admin_scripts() {
$handle = 'media-gallery-widget';
wp_enqueue_script( $handle );
wp_enqueue_style( $handle );
$exported_schema = array();
foreach ( $this->get_instance_schema() as $field => $field_schema ) {
ProTip! Use n and p to navigate between commits in a pull request.