PluginProbe
Slider Ultimate / 2.2.10
Slider Ultimate v2.2.10
2.2.10 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 All 54 releases
ultimate-slider / lib / simple-admin-pages / classes / AdminPageSetting.SelectMenu.class.php
AdminPageSetting.SelectMenu.class.php
64 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Register, display and save a selection with a drop-down list of any post type
5 *
6 * This setting accepts the following arguments in its constructor function.
7 *
8 * $args = array(
9 * 'id' => 'setting_id', // Unique id
10 * 'title' => 'My Setting', // Title or label for the setting
11 * 'description' => 'Description', // Help text description
12 * 'blank_option' => true, // Whether or not to show a blank option
13 * 'args' => array(); // Arguments to pass to WordPress's get_post() function
14 * );
15 *
16 * @since 1.0
17 * @package Simple Admin Pages
18 */
19
20 class sapAdminPageSettingSelectMenu_2_6_19 extends sapAdminPageSetting_2_6_19 {
21
22 public $sanitize_callback = 'intval';
23
24 // Whether or not to display a blank option
25 public $blank_option = true;
26
27 /**
28 * An array of arguments accepted by get_posts().
29 * See: http://codex.wordpress.org/Template_Tags/get_posts
30 */
31 public $args = array();
32
33 /**
34 * Display this setting
35 * @since 1.0
36 */
37 public function display_setting() {
38
39 $menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
40 ?>
41
42 <fieldset <?php $this->print_conditional_data(); ?>>
43
44 <select name="<?php echo esc_attr( $this->get_input_name() ); ?>" id="<?php echo esc_attr( $this->get_input_name() ); ?>">
45
46 <?php if ( $this->blank_option === true ) : ?>
47 <option></option>
48 <?php endif; ?>
49
50 <?php foreach($menus as $menu){ ?>
51 <option value="<?php echo absint( $menu->term_id ); ?>" <?php selected( $this->value, $menu->term_id ); ?>><?php echo esc_attr( $menu->name ); ?></option>
52 <?php } ?>
53
54 </select>
55
56 </fieldset>
57
58 <?php
59 $this->display_description();
60
61 }
62
63 }
64