// set here if the slider is reponsive or not $this->responsive_sliders[ $slider_type ] = true; // add the slider fields for the admin yit_add_slider_config( $slider_type, array( array( 'type' => 'simple-text', 'desc' => sprintf( __( 'Configure the slider in <a href="%s">uSquare Slider</a> page and then select below the slider to use for this slider.', 'yit' ), admin_url( 'admin.php?page=usquare' ) ) ), array( 'id' => 'slider_name', 'name' => __('Select the slider', 'yit'), 'desc' => __('Select the slider you want to show when you want to show this slider.', 'yit'), 'type' => 'select', 'options' => yit_get_usquare_sliders() ) )); function yit_get_usquare_sliders() { global $wpdb; if ( ! yit_if_thereis_usquareslider() ) { return array(); } $prefix = $wpdb->prefix; $usquares = $wpdb->get_results("SELECT * FROM " . $prefix . "usquare ORDER BY id"); if (count($usquares) == 0) { return array(); }
<?php /** * @package WordPress * @subpackage Your Inspiration Themes */ define('YIT_USQUARE_DIR', dirname(__FILE__)); define('YIT_USQUARE_URL', YIT_THEME_SLIDERS_URL . '/' . $slider_type); // set here if the slider is reponsive or not $this->responsive_sliders[$slider_type] = true; // add the slider fields for the admin yit_add_slider_config($slider_type, array(array('type' => 'simple-text', 'desc' => sprintf(__('Configure the slider in <a href="%s">uSquare Slider</a> page and then select below the slider to use for this slider.', 'yit'), admin_url('admin.php?page=usquare'))), array('id' => 'slider_name', 'name' => __('Select the slider', 'yit'), 'desc' => __('Select the slider you want to show when you want to show this slider.', 'yit'), 'type' => 'select', 'options' => yit_get_usquare_sliders()))); function yit_get_usquare_sliders() { global $wpdb; if (!yit_if_thereis_usquareslider()) { return array(); } $prefix = $wpdb->prefix; $usquares = $wpdb->get_results("SELECT * FROM " . $prefix . "usquare ORDER BY id"); if (count($usquares) == 0) { return array(); } $sliders = array(); foreach ($usquares as $usquare) { $sliders[$usquare->id] = $usquare->name ? $usquare->name : 'usquare #' . $usquare->id . ' (untitled)'; } return $sliders; } function yit_if_thereis_usquareslider() {