/** * Displays the post template meta box. * * @since 1.2.0 * @access public * @param object $object * @param array $box * @return void */ function hybrid_meta_box_post_display_template($post, $box) { $templates = hybrid_get_post_templates($post->post_type); $post_template = hybrid_get_post_template($post->ID); wp_nonce_field(basename(__FILE__), 'hybrid-post-template-nonce'); ?> <p> <select name="hybrid-post-template" class="widefat"> <option value=""></option> <?php foreach ($templates as $label => $template) { ?> <option value="<?php echo esc_attr($template); ?> " <?php selected($post_template, $template); ?> ><?php echo esc_html($label); ?> </option> <?php } ?> </select> </p> <?php }
/** * downloads_by_category function. * * @access public * @param int $show_counts (default: 1) * @param int $hierarchical (default: 1) * @param int $show_uncategorized (default: 1) * @param string $orderby (default: '') * @return void */ public function downloads_by_category($show_counts = 1, $hierarchical = 1, $show_uncategorized = 1, $orderby = '') { global $typenow, $wp_query; if ($typenow != 'dlm_download') { return; } include_once 'class-dlm-category-walker.php'; $r = array(); $r['pad_counts'] = 1; $r['hierarchical'] = $hierarchical; $r['hide_empty'] = 1; $r['show_count'] = $show_counts; $r['selected'] = isset($wp_query->query['dlm_download_category']) ? $wp_query->query['dlm_download_category'] : ''; $r['menu_order'] = false; if ($orderby == 'order') { $r['menu_order'] = 'asc'; } elseif ($orderby) { $r['orderby'] = $orderby; } $terms = get_terms('dlm_download_category', $r); if (!$terms) { return; } $output = "<select name='dlm_download_category' id='dropdown_dlm_download_category'>"; $output .= '<option value="" ' . selected(isset($_GET['dlm_download_category']) ? $_GET['dlm_download_category'] : '', '', false) . '>' . __('Select a category', 'download-monitor') . '</option>'; $output .= $this->walk_category_dropdown_tree($terms, 0, $r); $output .= "</select>"; echo $output; }
function socialeyes_theme_settings_style_box() { ?> <p><label><?php _e('Stylesheet', 'genesis'); ?> : <select name="<?php echo GENESIS_SETTINGS_FIELD; ?> [style_selection]"> <option style="padding-right:10px;" value=""><?php _e('Blue'); ?> </option> <option style="padding-right:10px;" value="social-pink" <?php selected('social-pink', genesis_get_option('style_selection')); ?> ><?php _e('Pink'); ?> </option> </select> </label></p> <p><span class="description">Please select the Social Eyes color style from the drop down list and save your settings.</span></p> <?php }
function rum_post_cta_meta_box_list() { global $post; // store global post object for later resetting after our query // using wp_reset_postdata() doesn't work so we are manually resetting the global $post_old = $post; // initialize variables $options = ''; // get plugin option array and store in a variable $plugin_option_array = get_option('rum_post_cta_plugin_options'); // fetch values from the plugin option variable array $post_cta_post_type = $plugin_option_array['post_type']; // retrieve the custom meta box value $post_cta_id = get_post_meta($post->ID, 'rum_post_cta_id', true); // set query arguments $args = array('post_type' => $post_cta_post_type, 'nopaging' => true); // execute the query $cta_post_query = new WP_Query($args); // The Loop while ($cta_post_query->have_posts()) { $cta_post_query->the_post(); $post_title = get_the_title(); $post_ID = get_the_id(); $options .= '<option value="' . esc_attr($post_ID) . '" ' . selected($post_cta_id, $post_ID) . '>' . $post_title . '</option>'; } // restore the global $post variable of the main query loop // wp_reset_postdata(); doesn't work so we are manually resetting it back // restore global post object $post = $post_old; setup_postdata($post); return $options; }
public function display() { $this->echoOptionHeader(); ?> <select name="<?php echo $this->getID(); ?> "><?php foreach ($this->settings['options'] as $value => $label) { // this is if we have option groupings if (is_array($label)) { ?> <optgroup label="<?php echo $value; ?> "><?php foreach ($label as $subValue => $subLabel) { printf("<option value=\"%s\" %s>%s</option>", $subValue, selected($this->getValue(), $subValue, false), $subLabel); } ?> </optgroup><?php // this is for normal list of options } else { printf("<option value=\"%s\" %s>%s</option>", $value, selected($this->getValue(), $value, false), $label); } } ?> </select><?php $this->echoOptionFooter(); }
function wpce_app_render() { $app = get_option('wpce_app'); $apps = wpce_apps(); ?> <select name="wpce_app" style="width: 300px;"> <option value="">Select an app</option> <?php foreach ($apps as $slug => $name) { ?> <option value="<?php echo $slug; ?> " <?php selected($app, $slug); ?> ><?php echo $name; ?> </option> <?php } ?> </select> <?php }
/** * Date dropdown */ function date_dropdown($limit = 0, $name = '', $table = '', $column = '', $id = '', $field = '', $bool = '') { if ($id != '') { $bind = [":id" => $id]; $array = []; $q = DB::inst()->select($table, "{$column} = :id", "", "*", $bind); foreach ($q as $r) { $array[] = $r; } $date = explode("-", $r[$field]); } /*years*/ $html_output = ' <select name="' . $name . 'Year"' . $bool . ' class="selectpicker form-control" data-style="btn-info" data-size="10" data-live-search="true">' . "\n"; $html_output .= ' <option value=""> </option>' . "\n"; for ($year = 2000; $year <= date("Y") - $limit; $year++) { $html_output .= ' <option value="' . sprintf("%04s", $year) . '"' . selected(sprintf("%04s", $year), $date[0], false) . '>' . sprintf("%04s", $year) . '</option>' . "\n"; } $html_output .= ' </select>' . "\n"; /*months*/ $html_output .= ' <select name="' . $name . 'Month"' . $bool . ' class="selectpicker form-control" data-style="btn-info" data-size="10" data-live-search="true">' . "\n"; $html_output .= ' <option value=""> </option>' . "\n"; $months = array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); for ($month = 1; $month <= 12; $month++) { $html_output .= ' <option value="' . sprintf("%02s", $month) . '"' . selected(sprintf("%02s", $month), $date[1], false) . '>' . $months[$month] . '</option>' . "\n"; } $html_output .= ' </select>' . "\n"; /*days*/ $html_output .= ' <select name="' . $name . 'Day"' . $bool . ' class="selectpicker form-control" data-style="btn-info" data-size="10" data-live-search="true">' . "\n"; $html_output .= ' <option value=""> </option>' . "\n"; for ($day = 1; $day <= 31; $day++) { $html_output .= ' <option value="' . sprintf("%02s", $day) . '"' . selected(sprintf("%02s", $day), $date[2], false) . '>' . sprintf("%02s", $day) . '</option>' . "\n"; } $html_output .= ' </select>' . "\n"; return $html_output; }
/** * Render the content on the theme customizer page */ public function render_content() { if (empty($this->tags)) { return false; } ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <select name="<?php echo esc_attr($this->id); ?> " id="<?php echo esc_attr($this->id); ?> "> <?php foreach ($this->tags as $tag) { printf('<option value="%s" %s>%s</option>', $tag->term_id, selected($this->value(), $tag->term_id, false), $tag->name); } ?> </select> </label> <?php }
/** * Render this field. * * @access public */ public function render() { $field_value = $this->get_value(); ?> <select name="<?php echo $this->get_id(); ?> " id="<?php echo $this->get_id(); ?> " class="postform"> <?php foreach ($this->get_options() as $value => $text) { ?> <option value="<?php echo esc_attr($value); ?> " <?php selected($field_value, $value); echo $this->render_required(); ?> ><?php echo $text; ?> </option> <?php } ?> </select> <?php $this->render_help(); }
/** * draw field on post edit form * you can use $this->instance, $this->entry */ function field($args, $instance = array()) { extract($args); $values = array(); // prepare options array $v = explode("\n", $this->instance['settings']); foreach ($v as $val) { $val = trim($val); if (strpos($val, '|') !== FALSE) { $a = explode('|', $val); $values[$a[0]] = $a[1]; } elseif (!empty($val)) { $values[$val] = $val; } } echo $before_widget; echo $before_title . $this->instance['title'] . $after_title; echo '<div class="select-field">'; echo '<select name="' . $this->get_field_name('val') . '" id="' . $this->get_field_id('val') . '" style="width: 47%;">'; echo '<option value="">' . __('Select One', JCF_TEXTDOMAIN) . '</option>'; foreach ((array) $values as $key => $val) { echo '<option value="' . esc_attr($val) . '" ' . selected($val, $this->entry, false) . '>' . esc_html(ucfirst($key)) . '</option>' . "\n"; } echo '</select>' . "\n"; echo '</div>'; if ($this->instance['description'] != '') { echo '<p class="description">' . $this->instance['description'] . '</p>'; } echo $after_widget; }
/** * Text Color */ function sosimple_text_color_mb_field($post_id) { $field_name = 'text_color'; $value = get_post_meta($post_id, $field_name, true); ?> <p> <label for="<?php echo esc_attr($field_name); ?> "><strong><?php _e('Text Color', 'sosimple'); ?> </strong></label><br /> <select name="<?php echo esc_attr($field_name); ?> " id="<?php echo esc_attr($field_name); ?> " class="widefat"> <?php $options = array('text-dark' => __('Dark Text', 'sosimple'), 'text-light' => __('Light Text', 'sosimple')); foreach ($options as $option => $label) { printf('<option value="%1$s" %3$s>%2$s</option>', esc_attr($option), esc_html($label), selected($value, $option, false)); } ?> </select> </p> <?php }
/** * Operator drop down. * * Display a list of operators. * * @since 1.0.0 * * @param mixed $id ID of the current condition. * @param mixed $group Group the (condition) operator belongs to. * @param string $current_value Current operator value. */ function wcasv_condition_operator($id, $group = 0, $current_value = '==') { $operators = array('==' => __('Equal to', 'woocommerce-advanced-shipping-validation'), '!=' => __('Not equal to', 'woocommerce-advanced-shipping-validation'), '>=' => __('Greater or equal to', 'woocommerce-advanced-shipping-validation'), '<=' => __('Less or equal to ', 'woocommerce-advanced-shipping-validation')); $operators = apply_filters('woocommerce_Advanced_Shipping_Validation_operators', $operators); ?> <span class='wcasv-operator-wrap wcasv-operator-wrap-<?php echo absint($id); ?> '> <select class='wcasv-operator' name='conditions[<?php echo absint($group); ?> ][<?php echo absint($id); ?> ][operator]'><?php foreach ($operators as $key => $value) { ?> <option value='<?php echo esc_attr($key); ?> ' <?php selected($key, $current_value); ?> ><?php echo esc_html($value); ?> </option><?php } ?> </select> </span><?php }
function wc_display_yotpo_settings($success_type = false) { $yotpo_settings = get_option('yotpo_settings', wc_yotpo_get_degault_settings()); $app_key = $yotpo_settings['app_key']; $secret = $yotpo_settings['secret']; $language_code = $yotpo_settings['language_code']; $widget_tab_name = $yotpo_settings['widget_tab_name']; if (empty($yotpo_settings['app_key'])) { if ($success_type == 'b2c') { wc_yotpo_display_message('We have sent you a confirmation email. Please check and click on the link to get your app key and secret token to fill out below.', true); } else { wc_yotpo_display_message('Set your API key in order the Yotpo plugin to work correctly', false); } } $google_tracking_params = '&utm_source=yotpo_plugin_woocommerce&utm_medium=header_link&utm_campaign=woocommerce_customize_link'; if (!empty($yotpo_settings['app_key']) && !empty($yotpo_settings['secret'])) { $dashboard_link = '<a href="https://api.yotpo.com/users/b2blogin?app_key=' . $yotpo_settings['app_key'] . '&secret=' . $yotpo_settings['secret'] . $google_tracking_params . '" target="_blank">Yotpo Dashboard.</a></div>'; } else { $dashboard_link = "<a href='https://www.yotpo.com/?login=true{$google_tracking_params}' target='_blank'>Yotpo Dashboard.</a></div>"; } $read_only = isset($_POST['log_in_button']) || $success_type == 'b2c' ? '' : 'readonly'; $cradentials_location_explanation = isset($_POST['log_in_button']) ? "<tr valign='top'> \t\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t<th scope='row'><p class='description'>To get your api key and secret token <a href='https://www.yotpo.com/?login=true' target='_blank'>log in here</a> and go to your account settings.</p></th>\n\t \t\t \t\t\t\t\t\t\t </tr>" : ''; $submit_past_orders_button = $yotpo_settings['show_submit_past_orders'] ? "<input type='submit' name='yotpo_past_orders' value='Submit past orders' class='button-secondary past-orders-btn' " . disabled(true, empty($app_key) || empty($secret), false) . ">" : ''; $settings_html = "<div class='wrap'>" . screen_icon() . "<h2>Yotpo Settings</h2>\t\t\t\t\t\t \n\t\t\t <h4>To customize the look and feel of the widget, and to edit your Mail After Purchase settings, just head to the " . $dashboard_link . "</h4>\n\t\t\t <form method='post' id='yotpo_settings_form'>\n\t\t\t \t<table class='form-table'>" . wp_nonce_field('yotpo_settings_form') . "<fieldset>\n\t <tr valign='top'>\n\t \t<th scope='row'><div>If you would like to choose a set language, please type the 2-letter language code here. You can find the supported langauge codes <a class='y-href' href='http://support.yotpo.com/entries/21861473-Languages-Customization-' target='_blank'>here.</a></div></th>\n\t \t<td><div><input type='text' class='yotpo_language_code_text' name='yotpo_widget_language_code' maxlength='5' value='{$language_code}'/></div></td>\n\t </tr>\n\t\t\t \t <tr valign='top'> \t\n\t\t \t<th scope='row'><div>For multiple-language sites, mark this check box. This will choose the language according to the user's site language.</div></th>\n\t \t<td><input type='checkbox' name='yotpo_language_as_site' value='1' " . checked(1, $yotpo_settings['yotpo_language_as_site'], false) . "/></td>\t \n\t </tr>\n\t\t\t\t\t <tr valign='top'>\n\t\t \t\t <th scope='row'><div>Disable native reviews system:</div></th>\n\t\t \t\t <td><input type='checkbox' name='disable_native_review_system' value='1' " . checked(1, $yotpo_settings['disable_native_review_system'], false) . " /></td>\n\t\t \t\t </tr>\t \t \n\t \t <tr valign='top'>\t\t\t\n\t\t\t\t <th scope='row'><div>Select widget location</div></th>\n\t\t\t\t <td>\n\t\t\t\t <select name='yotpo_widget_location' class='yotpo-widget-location'>\n\t\t\t\t \t <option value='footer' " . selected('footer', $yotpo_settings['widget_location'], false) . ">Page footer</option>\n\t\t\t \t\t <option value='tab' " . selected('tab', $yotpo_settings['widget_location'], false) . ">Tab</option>\n\t\t\t \t <option value='other' " . selected('other', $yotpo_settings['widget_location'], false) . ">Other</option>\n\t\t\t\t </select>\n\t\t \t\t </td>\n\t\t \t\t </tr>\n\t\t \t\t <tr valign='top' class='yotpo-widget-location-other-explain'>\n \t\t<th scope='row'><p class='description'>In order to locate the widget in a custome location open 'wp-content/plugins/woocommerce/templates/content-single-product.php' and add the following line <code>wc_yotpo_show_widget();</code> in the requested location.</p></th>\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t </tr>\n\t\t \t\t <tr valign='top' class='yotpo-widget-tab-name'>\n\t\t \t\t <th scope='row'><div>Select tab name:</div></th>\n\t\t \t\t <td><div><input type='text' name='yotpo_widget_tab_name' value='{$widget_tab_name}' /></div></td>\n\t\t \t\t </tr>\n\t\t \t\t {$cradentials_location_explanation}\n\t\t\t\t\t <tr valign='top'>\n\t\t \t\t <th scope='row'><div>App key:</div></th>\n\t\t \t\t <td><div class='y-input'><input id='app_key' type='text' name='yotpo_app_key' value='{$app_key}' {$read_only} '/></div></td>\n\t\t \t\t </tr>\n\t\t\t\t\t <tr valign='top'>\n\t\t \t\t <th scope='row'><div>Secret token:</div></th>\n\t\t \t\t <td><div class='y-input'><input id='secret' type='text' name='yotpo_oauth_token' value='{$secret}' {$read_only} '/></div></td>\n\t\t \t\t </tr>\t\n\t\t \t\t <tr valign='top'>\n\t\t \t\t <th scope='row'><p class='description'>Yotpo's Bottom Line shows the star rating of the product and the number of reviews for the product. <a href='http://support.yotpo.com/entries/24467793-What-is-the-Yotpo-Bottomline-' target='_blank'>learn more.</a></p></th>\t\t \t\t \n\t\t \t\t </tr>\t\t\t\t \t \n\t\t\t\t\t <tr valign='top'>\n\t\t \t\t <th scope='row'><div>Enable bottom line in product page:</div></th>\n\t\t \t\t <td><input type='checkbox' name='yotpo_bottom_line_enabled_product' value='1' " . checked(1, $yotpo_settings['bottom_line_enabled_product'], false) . " /></td>\n\t\t \t\t </tr>\t\t\t\t\t \t \n\t\t\t\t\t <tr valign='top'>\n\t\t \t\t <th scope='row'><div>Enable bottom line in category page:</div></th>\n\t\t \t\t <td><input type='checkbox' name='yotpo_bottom_line_enabled_category' value='1' " . checked(1, $yotpo_settings['bottom_line_enabled_category'], false) . " />\t\t \t\t \n\t\t \t\t </td>\n\t\t \t\t </tr>\t\t\t\t\t \t \n\t\t </fieldset>\n\t\t </table></br>\t\t\t \t\t\n\t\t <div class='buttons-container'>\n\t\t <button type='button' id='yotpo-export-reviews' class='button-secondary' " . disabled(true, empty($app_key) || empty($secret), false) . ">Export Reviews</button>\n\t\t\t\t<input type='submit' name='yotpo_settings' value='Update' class='button-primary' id='save_yotpo_settings'/>{$submit_past_orders_button}\n\t\t\t </br></br><p class='description'>*Learn <a href='http://support.yotpo.com/entries/24454261-Exporting-reviews-for-Woocommerce' target='_blank'>how to export your existing reviews</a> into Yotpo.</p>\n\t\t\t</div>\n\t\t </form>\n\t\t <iframe name='yotpo_export_reviews_frame' style='display: none;'></iframe>\n\t\t <form action='' method='get' target='yotpo_export_reviews_frame' style='display: none;'>\n\t\t\t<input type='hidden' name='download_exported_reviews' value='true' />\n\t\t\t<input type='submit' value='Export Reviews' class='button-primary' id='export_reviews_submit'/>\n\t\t </form> \n\t\t</div>"; echo $settings_html; }
/** * Render users dropdown. * * @since 1.3.6 */ function bnfw_render_users_dropdown($selected_users) { global $wp_roles; ?> <optgroup label="User Roles"> <?php $roles = $wp_roles->get_names(); foreach ($roles as $role) { $selected = selected(true, in_array('role-' . $role, $selected_users), false); echo '<option value="role-', $role, '" ', $selected, '>', $role, '</option>'; } ?> </optgroup> <optgroup label="Users"> <?php $user_count = count_users(); // if there are more than 100 users then use AJAX to load them dynamically. // So just get only the selected users if (count($selected_users) > 0 && $user_count['total_users'] > 100) { $users = get_users(array('include' => $selected_users, 'order_by' => 'email', 'fields' => array('ID', 'user_login'))); } else { $users = get_users(array('order_by' => 'email', 'number' => 100, 'fields' => array('ID', 'user_login'))); } foreach ($users as $user) { $selected = selected(true, in_array($user->ID, $selected_users), false); echo '<option value="', $user->ID, '" ', $selected, '>', $user->user_login, '</option>'; } }
/** * Outputs a view template which can be used with wp.media.template */ function print_media_templates() { $default_gallery_type = apply_filters('jetpack_default_gallery_type', 'default'); ?> <script type="text/html" id="tmpl-jetpack-gallery-settings"> <label class="setting"> <span><?php _e('Type', 'themepacific_gallery'); ?> </span> <select class="type" name="type" data-setting="type"> <?php foreach ($this->gallery_types as $value => $caption) { ?> <option value="<?php echo esc_attr($value); ?> " <?php selected($value, $default_gallery_type); ?> ><?php echo esc_html($caption); ?> </option> <?php } ?> </select> </label> </script> <?php }
public function metabox($post_id = 0) { global $rcp_gifts; $is_gift = $rcp_gifts->is_gift_product($post_id); $is_multiuse = $rcp_gifts->is_gift_multiuse($post_id); $expires = $rcp_gifts->gift_expires($post_id); $gift_level = $rcp_gifts->gift_subscription_level($post_id); $levels = rcp_get_subscription_levels(); echo '<p>'; echo '<strong>' . __('Gift Creation', 'rcp-gifts') . '</strong><br/>'; echo '</p>'; echo '<p>'; echo '<input type="checkbox" name="_rcp_gift_product" id="_rcp_gift_product" value="1"' . checked(true, $is_gift, false) . '/>'; echo '<label for="_rcp_gift_product">' . __('Enable RCP Gift creation for this product', 'rcp-gifts') . '</label>'; echo '</p>'; // enable multi-use echo '<p>'; echo '<input type="checkbox" name="_rcp_gift_multiuse" id="_rcp_gift_multiuse" value="1"' . checked(true, $is_multiuse, false) . '/>'; echo '<label for="_rcp_gift_multiuse">' . __('Enable coupon to be used multiple times.', 'rcp-gifts') . '</label>'; echo '</p>'; // set expiration date echo '<p>'; echo '<input type="date" class="datepicker" name="_rcp_gift_expires" id="_rcp_gift_expires" value="' . esc_attr($expires) . '">'; echo '<label for="_rcp_gift_expires">' . __('Select optional expiration date.', 'rcp-gifts') . '</label>'; echo '</p>'; // choose subscription level echo '<p>'; echo '<select name="_rcp_gift_subscription_level" id="_rcp_gift_subscription_level"/> '; foreach ($levels as $level) { echo '<option value="' . absint($level->id) . '"' . selected($gift_level, $level->id, false) . '>' . $level->name . '</option>'; } echo '</select>'; echo '</p>'; }
function form($instance) { ?> <p><label for="<?php echo $this->get_field_id('ewic_shortcode'); ?> ">Select your Slider name and hit save button.<br /> <select id="<?php echo $this->get_field_id('ewic_shortcode'); ?> " name="<?php echo $this->get_field_name('ewic_shortcode'); ?> " > <?php global $post; $args = array('post_type' => 'easyimageslider', 'order' => 'ASC', 'posts_per_page' => -1, 'post_status' => 'publish'); $myposts = get_posts($args); foreach ($myposts as $post) { setup_postdata($post); echo '<option value=' . $post->ID . '' . selected($instance["ewic_shortcode"], $post->ID) . '>' . esc_html(esc_js(the_title(NULL, NULL, FALSE))) . '</option>'; } ?> </select></label></p> <?php }
/** * Render the control's content. * * Allows the content to be overriden without having to rewrite the wrapper. * * @since 01/13/2013 * @return void */ public function render_content() { if (empty($this->users)) { return false; } ?> <label> <span class="customize-control-title" ><?php echo esc_html($this->label); ?> </span> <select <?php $this->link(); ?> > <?php foreach ($this->users as $user) { printf('<option value="%s" %s>%s</option>', $user->data->ID, selected($this->value(), $user->data->ID, false), $user->data->display_name); } ?> </select> </label> <?php }
/** * Outputs the options form on admin * * @param array $instance The widget options */ public function form($instance) { $title = !empty($instance['title']) ? $instance['title'] : __(''); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>"> </p> <?php $source_type = !empty($instance['source_type']) ? $instance['source_type'] : 'video_file'; ?> <p> <label for="<?php echo $this->get_field_id('source_type'); ?>"><?php _e('Source Type:'); ?></label> <select name="<?php echo $this->get_field_name('title'); ?>" id="<?php echo $this->get_field_id('title'); ?>" onchange="WISGETSVIDEO.sourceType(this)"> <option value="video_file" <?php selected($source_type, 'video_file')?>><?php _e('Custom Fiels')?></option> <option value="youtube" <?php selected($source_type, 'youtube')?>><?php _e('YouTube')?></option> <option value="netflix" <?php selected($source_type, 'netflix')?>><?php _e('NetFlix')?></option> <option value="vimeo" <?php selected($source_type, 'vimeo')?>><?php _e('Vimeo')?></option> <option value="yahoo-screen" <?php selected($source_type, 'yahoo-screen')?>><?php _e(' Yahoo! Screen')?></option> <option value="dailymotion" <?php selected($source_type, 'dailymotion')?>><?php _e('DailyMotion')?></option> <option value="hulu" <?php selected($source_type, 'hulu')?>><?php _e('Hulu')?></option> </select> </p> <?php }
/** * @param $args * * @internal param array $name */ public function create_select_field($args) { $name = $args['name']; $current = $args['current']; $options = $args['options']; ?> <select name="<?php echo esc_attr($name); ?> " id="<?php echo esc_attr($name); ?> "> <?php foreach ($options as $option) { ?> <option value="<?php echo esc_attr($option['value']); ?> " <?php selected($current, $option['value']); ?> > <?php echo esc_html($option['label']); ?> </option> <?php } ?> </select> <?php }
public function form($instance) { $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '1')); $title = strip_tags($instance['title']); $id = isset($instance['id']) ? $instance['id'] : ''; echo '<p><label for="' . $this->get_field_id('title') . '">Title:</label> <input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($title) . '"> </p>'; global $wpdb; global $table_name_imap; $maps_created = $wpdb->get_results("SELECT * FROM {$table_name_imap}", ARRAY_A); $maps = array(); if (count($maps_created) >= 1) { echo ' <p> <label for="' . $this->get_field_id('id') . '">Map to display:</label> <select id="' . $this->get_field_id('id') . '" name="' . $this->get_field_name('id') . '">'; echo "<option value='0' " . selected($id, '0') . "> -- Select -- </option>"; foreach ($maps_created as $map) { echo "<option value='" . $map['id'] . "' " . selected($id, $map['id']) . "> " . $map['name'] . "</option>"; } echo '</select>'; } else { echo "<p>Please create a map first.</p>"; } }
/** * Outputs the list of continents and countries for use in dropdown boxes. * * @access public * @param string $selected_country (default: '') * @param bool $escape (default: false) * @return void */ public function country_dropdown_options($selected_country = '', $escape = false) { if ($this->continents) { foreach ($this->continents as $continent => $countries) { ?> <optgroup label="<?php echo $continent; ?> "> <?php foreach ($countries as $code => $country) { ?> <option value="<?php echo $code; ?> " <?php selected($selected_country, $code); ?> ><?php echo $country; ?> </option> <?php } ?> </optgroup> <?php } } }
/** * Adds the subscription level dropdown to the member directory edit screen. */ function jp_um_admin_extend_directory_options_general($this) { $post_id = get_the_ID(); $saved_level = get_post_meta($post_id, 'um_rcp_subscription_level', true); $saved_level = !empty($saved_level) ? absint($saved_level) : 'none'; ?> <p> <label class="um-admin-half">RCP Members to Display</label> <span class="um-admin-half"> <select name="um_rcp_subscription_level" id="um_rcp_subscription_level" class="umaf-selectjs um-adm-conditional" style="width: 300px" data-cond1='other' data-cond1-show='custom-field'> <option value="none" <?php selected('none', $saved_level); ?> >None</option> <?php foreach (rcp_get_subscription_levels() as $key => $level) { echo '<option value="' . $level->id . '" ' . selected($level->id, $saved_level) . '>' . $level->name . '</option>'; } ?> </select> </span> </p><div class="um-admin-clear"></div> <?php wp_nonce_field('um_rcp_subscription_level_nonce', 'um_rcp_subscription_level_nonce'); }
public function render_content() { if (empty($this->choices)) { return; } ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <select id="comment-display-control" <?php $this->link(); ?> multiple="multiple" style="height: 100%;"> <?php foreach ($this->choices as $value => $label) { $selected = in_array($value, $this->value()) ? selected(1, 1, false) : ''; echo '<option value="' . esc_attr($value) . '"' . $selected . '>' . $label . '</option>'; } ?> </select> </label> <?php }
/** * Render the content on the theme customizer page */ public function render_content() { if (!empty($this->menus)) { ?> <label> <span class="customize-menu-dropdown"><?php echo esc_html($this->label); ?> </span> <select name="<?php echo $this->id; ?> " id="<?php echo $this->id; ?> "> <?php foreach ($this->menus as $menu) { printf('<option value="%s" %s>%s</option>', $menu->term_id, selected($this->value(), $menu->term_id, false), $menu->name); } ?> </select> </label> <?php } }
/** * Erstellt den Metabox Content * * @param WP_Post $post */ public function render_meta_box_content($post) { $meta_element_class = get_post_meta($post->ID, 'custom_element_grid_class_meta_box', true); ?> <label>Welche Funktion soll dargestellt werden: </label> <select name="custom_element_grid_class" id="custom_element_grid_class"> <option value="Keine" <?php selected($meta_element_class, 'Keine'); ?> >Keine</option> <option value="Startseite" <?php selected($meta_element_class, 'Startseite'); ?> >Startseite</option> <option value="Dokumente" <?php selected($meta_element_class, 'Dokumente'); ?> >Dokumente</option> <option value="Gruppen" <?php selected($meta_element_class, 'Gruppen'); ?> >Gruppen</option> </select> <?php }
/** * Render the content of the category dropdown * * @return HTML */ public function render_content() { if (!empty($this->cats)) { ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <select <?php $this->link(); ?> > <?php // Add an empty default option printf('<option value="0">' . esc_html('Disable Featured Posts', 'wedge') . '</option>'); printf('<option value="0">--</option>'); foreach ($this->cats as $cat) { printf('<option value="%s" %s>%s</option>', $cat->term_id, selected($this->value(), $cat->term_id, false), $cat->name); } ?> </select> </label> <?php } }
/** * Function to render the content on the theme customizer page * * @access public * @since 1.0.0 * * @param null * @return void * */ public function render_content() { $coder_tags = get_tags(); if (!empty($coder_tags)) { ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <select <?php $this->link(); ?> > <?php $coder_default_value = $this->value(); if (-1 == $coder_default_value || empty($coder_default_value)) { $coder_default_selected = 1; } else { $coder_default_selected = 0; } printf('<option value="-1" %s>%s</option>', selected($coder_default_selected, 1, false), __('Select', 'coder-customizer-framework')); foreach ($coder_tags as $coder_post) { printf('<option value="%s" %s>%s</option>', $coder_tags->term_id, selected($this->value(), $coder_post->ID, false), $coder_tags->name); } ?> </select> </label> <?php } }
function render() { $class = isset($this->field['class']) ? $this->field['class'] : ''; if (!$this->value) { $this->value = $this->field['std']; } $this->field['options'] = snp_ml_get_mm_lists(); $class = isset($this->field['class']) ? 'class="' . $this->field['class'] . '" ' : ''; echo '<select id="' . $this->field['id'] . '" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . ']" ' . $class . 'rows="6" >'; if ($this->field['meta'] == 1) { echo '<option value="" ' . selected($this->value, '', false) . '>Use global settings</option>'; } if (count((array) $this->field['options']) == 0) { echo '<option value="" ' . selected($this->value, '', false) . '>--</option>'; } else { foreach ($this->field['options'] as $k => $v) { echo '<option value="' . $k . '" ' . selected($this->value, $k, false) . '>' . $v['name'] . '</option>'; } //foreach } echo '</select>'; if (!$this->field['meta']) { echo '<input type="button" rel-id="' . $this->field['id'] . '" class="button mymail_lists_gl" name="" value="Grab Lists" />'; } echo isset($this->field['desc']) && !empty($this->field['desc']) ? ' <span class="description">' . $this->field['desc'] . '</span>' : ''; }
/** * Display memberhsip limits field. * * @since 0.3.0 */ function pmprolpv_settings_field_limits($level_id) { $limit = get_option('pmprolpv_limit_' . $level_id); ?> <input size="2" type="text" id="level_<?php echo $level_id; ?> _views" name="pmprolpv_limit_<?php echo $level_id; ?> [views]" value="<?php echo $limit['views']; ?> "> <?php _e(' views per ', 'pmprolpv'); ?> <select name="pmprolpv_limit_<?php echo $level_id; ?> [period]" id="level_<?php echo $level_id; ?> _period"> <option value="hour" <?php selected($limit['period'], 'hour'); ?> ><?php _e('Hour', 'pmprolpv'); ?> </option> <option value="day" <?php selected($limit['period'], 'day'); ?> ><?php _e('Day', 'pmprolpv'); ?> </option> <option value="week" <?php selected($limit['period'], 'week'); ?> ><?php _e('Week', 'pmprolpv'); ?> </option> <option value="month" <?php selected($limit['period'], 'month'); ?> ><?php _e('Month', 'pmprolpv'); ?> </option> </select> <?php }