/**
         * Add an admin notice to FooGallery pages when Polylang setting media_support is set
         */
        function admin_notice()
        {
            if (FOOGALLERY_CPT_GALLERY === foo_current_screen_post_type()) {
                $options = get_option('polylang');
                if (array_key_exists('media_support', $options) && 1 === $options['media_support']) {
                    ?>
					<div class="notice error">
						<p>
							<strong><?php 
                    _e('FooGallery + Polylang Alert : ', 'foogallery');
                    ?>
</strong>
							<?php 
                    _e('We noticed that you have Polylang installed and you have chosen to activate languages and translations for media.', 'foogallery');
                    ?>
<br />
							<?php 
                    _e('This may cause empty galleries on translated pages! To disable this feature, please visit Settings -> Languages -> Settings Tab.', 'foogallery');
                    ?>
						</p>
					</div>
					<?php 
                }
            }
        }
 public function include_required_scripts()
 {
     //only include scripts if we on the foogallery page
     if (FOOGALLERY_CPT_GALLERY === foo_current_screen_post_type()) {
         //zeroclipboard needed for copy to clipboard functionality
         $url = FOOGALLERY_URL . 'lib/zeroclipboard/ZeroClipboard.min.js';
         wp_enqueue_script('foogallery-zeroclipboard', $url, array('jquery'), FOOGALLERY_VERSION);
         //spectrum needed for the colorpicker field
         $url = FOOGALLERY_URL . 'lib/spectrum/spectrum.js';
         wp_enqueue_script('foogallery-spectrum', $url, array('jquery'), FOOGALLERY_VERSION);
         $url = FOOGALLERY_URL . 'lib/spectrum/spectrum.css';
         wp_enqueue_style('foogallery-spectrum', $url, array(), FOOGALLERY_VERSION);
         //include any admin js required for the templates
         foreach (foogallery_gallery_templates() as $template) {
             $admin_js = foo_safe_get($template, 'admin_js');
             if ($admin_js) {
                 wp_enqueue_script('foogallery-gallery-admin-' . $template['slug'], $admin_js, array('jquery'), FOOGALLERY_VERSION);
             }
         }
     }
 }
Ejemplo n.º 3
0
 function admin_print_styles()
 {
     //add a general admin stylesheet
     $this->register_and_enqueue_css('admin.css');
     //if we are on the current plugin's settings page then check for file /css/admin-settings.css
     if (foo_check_plugin_settings_page($this->plugin_slug)) {
         $this->register_and_enqueue_css('admin-settings.css');
         //Media Uploader Style
         wp_enqueue_style('thickbox');
     }
     //add any scripts for the current post type /css/admin-foobar.css
     $post_type = foo_current_screen_post_type();
     if (!empty($post_type)) {
         $this->register_and_enqueue_css('admin-' . $post_type . '.css');
     }
     //finally try add any styles for the current screen id /css/admin-screen-id.css
     $this->register_and_enqueue_css('admin-' . foo_current_screen_id() . '.css');
     do_action($this->plugin_slug . '-admin_print_styles');
 }
Ejemplo n.º 4
0
 public function include_required_scripts()
 {
     if (FOOGALLERY_CPT_ALBUM === foo_current_screen_post_type()) {
         //include album selection script
         $url = FOOGALLERY_ALBUM_URL . 'js/admin-foogallery-album.js';
         wp_enqueue_script('admin-foogallery-album', $url, array('jquery', 'jquery-ui-core', 'jquery-ui-sortable'), FOOGALLERY_VERSION);
         //include album selection css
         $url = FOOGALLERY_ALBUM_URL . 'css/admin-foogallery-album.css';
         wp_enqueue_style('admin-foogallery-album', $url, array(), FOOGALLERY_VERSION);
         //zeroclipboard needed for copy to clipboard functionality
         $url = FOOGALLERY_URL . 'lib/zeroclipboard/ZeroClipboard.min.js';
         wp_enqueue_script('foogallery-zeroclipboard', $url, array('jquery'), FOOGALLERY_VERSION);
         //spectrum needed for the colorpicker field
         $url = FOOGALLERY_URL . 'lib/spectrum/spectrum.js';
         wp_enqueue_script('foogallery-spectrum', $url, array('jquery'), FOOGALLERY_VERSION);
         $url = FOOGALLERY_URL . 'lib/spectrum/spectrum.css';
         wp_enqueue_style('foogallery-spectrum', $url, array(), FOOGALLERY_VERSION);
     }
 }