/** * The template tag to use. * This will load all images according to a slideshow id and show them * as such. */ function mief_slideshow($slideshow = 1) { $photos = mief_slideshow_get_images($slideshow); $slideshow = mief_get_slideshow($slideshow); $params = array('h' => 350, 'w' => 1000); if (!empty($slideshow->settings['width'])) { $params['w'] = (int) $slideshow->settings['width']; } if (!empty($slideshow->settings['height'])) { $params['h'] = (int) $slideshow->settings['height']; } wp_enqueue_script('jquery'); wp_enqueue_script('mief_slider_slider', MIEF_SLIDER_ASSETS_DIR . 'js/slider.js'); wp_enqueue_style('mief_slider', MIEF_SLIDER_ASSETS_DIR . 'style/slider.css'); wp_localize_script('mief_slider_slider', 'miefSlideShowParams', $params); require_once plugin_dir_path(__FILE__) . 'templates/slideshow.php'; }
/** * The options screen for uploading new images to the slideshow * * @return void */ function mief_plugin_options() { /** @var wpdb */ global $wpdb; mief_slideshow_detect_upload(); mief_slideshow_detect_form(); if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } $page = mief_get_page(); switch ($page) { case 'upload': $photos = mief_slideshow_get_images(mief_get_slideshow_mid()); $slideshow = mief_get_slideshow(mief_get_slideshow_mid()); require_once plugin_dir_path(__FILE__) . '/templates/upload.php'; break; default: $slideshows = mief_get_all_slideshows(); require_once plugin_dir_path(__FILE__) . '/templates/index.php'; } }