• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP papi_render_html_tag函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中papi_render_html_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP papi_render_html_tag函数的具体用法?PHP papi_render_html_tag怎么用?PHP papi_render_html_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了papi_render_html_tag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     $value = papi_cast_string_value($this->get_value());
     $options_html = [];
     // Override selected setting with
     // database value if not empty.
     if (!papi_is_empty($value)) {
         $settings->selected = $value;
     }
     $classes = 'papi-fullwidth';
     if ($settings->select2) {
         $classes .= ' papi-component-select2';
     }
     if (!empty($settings->placeholder)) {
         $options_html[] = papi_html_tag('option', ['value' => '', $settings->placeholder]);
     }
     // Create option html tags for all items.
     foreach ($this->get_items() as $key => $value) {
         $key = is_numeric($key) ? $value : $key;
         if (papi_is_empty($key)) {
             continue;
         }
         $options_html[] = papi_html_tag('option', ['selected' => $value === $settings->selected ? 'selected' : null, 'value' => $value, papi_convert_to_string($key)]);
     }
     papi_render_html_tag('select', ['class' => $classes, 'data-allow-clear' => true, 'data-placeholder' => $settings->placeholder, 'data-width' => '100%', 'id' => $this->html_id(), 'name' => $this->html_name(), $options_html]);
 }
开发者ID:ekandreas,项目名称:papi,代码行数:30,代码来源:class-papi-property-dropdown.php


示例2: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     $value = $this->get_value();
     $settings_json = ['i18n' => ['previousMonth' => __('Previous Month', 'papi'), 'nextMonth' => __('Next Month', 'papi'), 'midnight' => __('Midnight', 'papi'), 'months' => [__('January', 'papi'), __('February', 'papi'), __('March', 'papi'), __('April', 'papi'), __('May', 'papi'), __('June', 'papi'), __('July', 'papi'), __('August', 'papi'), __('September', 'papi'), __('October', 'papi'), __('November', 'papi'), __('December', 'papi')], 'noon' => __('Noon', 'papi'), 'weekdays' => [__('Sunday', 'papi'), __('Monday', 'papi'), __('Tuesday', 'papi'), __('Wednesday', 'papi'), __('Thursday', 'papi'), __('Friday', 'papi'), __('Saturday', 'papi')], 'weekdaysShort' => [__('Sun', 'papi'), __('Mon', 'papi'), __('Tue', 'papi'), __('Wed', 'papi'), __('Thu', 'papi'), __('Fri', 'papi'), __('Sat', 'papi')]]];
     // Remove i18n setting if it exists.
     if (isset($settings->i18n)) {
         unset($settings->i18n);
     }
     // Remove default time format if show time is false.
     if (isset($settings->show_time) && !$settings->show_time && isset($settings->format)) {
         $settings->format = trim(str_replace('hh:mm:ss', '', $settings->format));
     }
     // Convert all sneak case key to camel case.
     foreach ((array) $settings as $key => $val) {
         if (!is_string($key)) {
             continue;
         }
         if ($key = papi_camel_case($key)) {
             $settings_json[$key] = $val;
         }
     }
     // Papi has `use24Hours` as key and Pikaday has `use24hour`.
     // This code will fix it.
     if (isset($settings_json['use24Hours'])) {
         $settings_json['use24hour'] = $settings_json['use24Hours'];
         unset($settings_json['use24Hours']);
     }
     papi_render_html_tag('input', ['class' => 'papi-property-datetime', 'data-settings' => (object) $settings_json, 'id' => $this->html_id(), 'name' => $this->html_name(), 'type' => 'text', 'value' => $value]);
 }
开发者ID:wp-papi,项目名称:papi,代码行数:33,代码来源:class-papi-property-datetime.php


示例3: html

 /**
  * Render property html.
  */
 public function html()
 {
     $options = $this->get_options();
     papi_render_html_tag('div', ['class' => 'papi-property-divider', 'data-papi-rule' => $this->html_name(), sprintf('<h3><span>%s</span></h3>', $options->title)]);
     if (!papi_is_empty($options->description)) {
         echo sprintf('<p>%s</p>', $options->description);
     }
 }
开发者ID:ekandreas,项目名称:papi,代码行数:11,代码来源:class-papi-property-divider.php


示例4: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     papi_render_html_tag('input', ['class' => $settings->mediauploader ? 'papi-url-media-input' : null, 'id' => $this->html_id(), 'name' => $this->html_name(), 'type' => 'url', 'value' => $this->get_value()]);
     if ($settings->mediauploader) {
         echo '&nbsp;';
         papi_render_html_tag('input', ['class' => 'button papi-url-media-button', 'data-papi-action' => 'mediauploader', 'id' => $this->html_id(), 'name' => $this->html_name() . '_button', 'type' => 'button', 'value' => __('Select file', 'papi')]);
     }
 }
开发者ID:ekandreas,项目名称:papi,代码行数:12,代码来源:class-papi-property-url.php


示例5: html

 /**
  * Render property html.
  */
 public function html()
 {
     $options = $this->get_options();
     $text = '';
     $options->description = $options->slug;
     if (!papi_is_empty($options->description)) {
         $text = sprintf('<p>%s</p>', $options->description);
     }
     papi_render_html_tag('div', ['class' => 'papi-property-divider', 'data-papi-rule' => esc_attr($this->html_name()), sprintf('<h3><span>%s</span></h3>%s', esc_html($options->title), $text)]);
 }
开发者ID:wp-papi,项目名称:papi,代码行数:13,代码来源:class-papi-property-divider.php


示例6: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     $html = papi_maybe_get_callable_value($settings->html);
     if ($settings->save) {
         $value = $this->get_value();
         if (!empty($value) && is_string($value)) {
             $html = $value;
         }
         papi_render_html_tag('input', ['name' => esc_attr($this->html_name()), 'type' => 'hidden', 'value' => $html]);
     }
     papi_render_html_tag('div', ['data-papi-rule' => esc_attr($this->html_name()), 'class' => 'property-html', $html]);
 }
开发者ID:wp-papi,项目名称:papi,代码行数:16,代码来源:class-papi-property-html.php


示例7: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     $value = $this->get_value();
     // If range type is used change the default values if empty.
     if ($settings->type === 'range') {
         $settings->max = papi_is_empty($settings->max) ? 100 : $settings->max;
         $settings->min = papi_is_empty($settings->min) ? 0 : $settings->min;
         $settings->step = papi_is_empty($settings->step) ? 1 : $settings->step;
     }
     if ($settings->min !== 0 && $value < $settings->min) {
         $value = $settings->min;
     }
     papi_render_html_tag('input', ['id' => $this->html_id(), 'max' => $settings->max, 'min' => $settings->min, 'name' => $this->html_name(), 'step' => $settings->step, 'type' => $settings->type, 'value' => $value]);
 }
开发者ID:ekandreas,项目名称:papi,代码行数:18,代码来源:class-papi-property-number.php


示例8: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     $value = papi_cast_string_value($this->get_value());
     // Override selected setting with
     // database value if not null.
     if (!papi_is_empty($value)) {
         $settings->selected = $value;
     }
     foreach ($settings->items as $key => $value) {
         $key = is_numeric($key) ? $value : $key;
         papi_render_html_tag('label', ['class' => 'light', 'for' => $this->html_id($key), papi_render_html_tag('input', ['id' => $this->html_id($key), 'name' => $this->html_name(), 'type' => 'radio', 'checked' => $value === $settings->selected ? 'checked' : null, 'value' => $value]), papi_convert_to_string($key)]);
         papi_render_html_tag('br');
     }
 }
开发者ID:ekandreas,项目名称:papi,代码行数:18,代码来源:class-papi-property-radio.php


示例9: add_form_fields

    /**
     * Add form fields to edit tags page.
     */
    public function add_form_fields()
    {
        $html_name = esc_attr(papi_get_page_type_key());
        $taxonomy = papi_get_qs('taxonomy');
        $taxonomy_object = get_taxonomy($taxonomy);
        // Get only the taxonomy types that has the taxonomy.
        $taxonomy_types = array_filter($this->taxonomy_types, function ($taxonomy_type) use($taxonomy) {
            return in_array($taxonomy, $taxonomy_type->taxonomy, true) && $taxonomy_type->display($taxonomy);
        });
        $taxonomy_types = array_values($taxonomy_types);
        // Do not display empty select if no taxonomy types.
        if (empty($taxonomy_types)) {
            return;
        }
        // Prepare taxonomy types with standard taxonomy type.
        $taxonomy_types = $this->prepare_taxonomy_types($taxonomy_types);
        // Render a dropdown if more than one taxonomy types
        // exists on the taxonomy.
        if (count($taxonomy_types) > 1) {
            ?>
			<div class="form-field">
				<label for="<?php 
            echo esc_attr($html_name);
            ?>
">
					<?php 
            echo esc_html(sprintf(__('%s type', 'papi'), $taxonomy_object->labels->singular_name));
            ?>
				</label>
				<select name="<?php 
            echo esc_attr($html_name);
            ?>
" id="<?php 
            echo esc_attr($html_name);
            ?>
" data-papi-page-type-key="true">
					<?php 
            foreach ($taxonomy_types as $taxonomy_type) {
                papi_render_html_tag('option', ['data-redirect' => $taxonomy_type->redirect_after_create, 'value' => esc_attr($taxonomy_type->get_id()), esc_html($taxonomy_type->name)]);
            }
            ?>
				</select>
			</div>
			<?php 
        } else {
            papi_render_html_tag('input', ['data-redirect' => $taxonomy_types[0]->redirect_after_create, 'data-papi-page-type-key' => true, 'name' => esc_attr($html_name), 'type' => 'hidden', 'value' => esc_attr($taxonomy_types[0]->get_id())]);
        }
    }
开发者ID:wp-papi,项目名称:papi,代码行数:51,代码来源:class-papi-admin-entry-taxonomy.php


示例10: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     $value = papi_cast_string_value($this->get_value());
     // Override selected setting with
     // database value if not null.
     if (!papi_is_empty($value)) {
         $settings->selected = $value;
     }
     echo '<div class="papi-property-radio">';
     foreach ($settings->items as $key => $value) {
         $key = is_numeric($key) ? $value : $key;
         papi_render_html_tag('p', [papi_html_tag('label', ['class' => 'light', 'for' => esc_attr($this->html_id($key)), papi_html_tag('input', ['id' => esc_attr($this->html_id($key)), 'name' => esc_attr($this->html_name()), 'type' => 'radio', 'checked' => $value === $settings->selected, 'value' => $value]), esc_html(papi_convert_to_string($key))])]);
     }
     echo '</div>';
 }
开发者ID:wp-papi,项目名称:papi,代码行数:19,代码来源:class-papi-property-radio.php


示例11: html

    /**
     * Render property html.
     */
    public function html()
    {
        $layout = $this->get_setting('layout');
        $labels = $this->get_labels();
        $post_types = $this->get_post_types();
        $render_label = count($post_types) > 1;
        $advanced = $render_label && $layout === 'advanced';
        $single = $render_label && $layout !== 'advanced';
        $classes = count($post_types) > 1 ? '' : 'papi-fullwidth';
        $settings = $this->get_settings();
        $value = $this->get_value();
        $value = is_object($value) ? $value->ID : 0;
        $selected_label = array_shift($labels);
        $selected_post_type = get_post_type($value) ?: '';
        $posts = $this->get_posts($selected_post_type);
        if ($settings->select2) {
            $classes .= ' papi-component-select2';
        }
        ?>

		<div class="papi-property-post <?php 
        echo $advanced ? 'advanced' : '';
        ?>
">
			<?php 
        if ($advanced) {
            ?>
				<table class="papi-table">
					<tr>
						<td>
							<label for="<?php 
            echo esc_attr($this->html_id());
            ?>
_post_type">
								<?php 
            echo esc_html($settings->labels['select_post_type']);
            ?>
							</label>
						</td>
						<td>
							<select
								id="<?php 
            echo esc_attr($this->html_id());
            ?>
_post_type"
								class="<?php 
            echo esc_attr($classes);
            ?>
 papi-property-post-left"
								data-select-item="<?php 
            echo esc_attr($settings->labels['select_item']);
            ?>
"
								data-post-query='<?php 
            echo esc_attr(papi_maybe_json_encode($settings->query));
            ?>
'
								data-width="100%"
								>
								<?php 
            foreach ($labels as $post_type => $label) {
                papi_render_html_tag('option', ['value' => $post_type, 'selected' => $post_type === $selected_post_type, $label]);
                if ($selected) {
                    $selected_label = $label;
                }
            }
            ?>
							</select>
						</td>
					</tr>
					<tr>
					<td>
						<label for="<?php 
            echo esc_attr($this->html_id());
            ?>
_posts">
							<?php 
            echo esc_html(sprintf($settings->labels['select_item'], $selected_label));
            ?>
						</label>
					</td>
					<td>
			<?php 
        }
        ?>

			<select
				class="<?php 
        echo esc_attr($classes);
        ?>
  papi-property-post-right"
				id="<?php 
        echo esc_attr($this->html_id());
        ?>
_posts"
				name="<?php 
        echo esc_attr($this->html_name());
//.........这里部分代码省略.........
开发者ID:wp-papi,项目名称:papi,代码行数:101,代码来源:class-papi-property-post.php


示例12: esc_html

    echo esc_html(implode(', ', $post_types));
    ?>
				</td>
				<td>
					<?php 
    if (empty($page_type->template)) {
        _e('Page Type has no template file', 'papi');
    } else {
        if (!current_user_can('edit_themes') || defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT) {
            echo esc_html($page_type->template);
        } else {
            $theme_dir = get_template_directory();
            $theme_name = basename($theme_dir);
            $url = admin_url('theme-editor.php?file=' . $page_type->template . '&theme=' . $theme_name);
            if (file_exists($theme_dir . '/' . $page_type->template)) {
                papi_render_html_tag('a', ['href' => esc_attr($url), esc_html($page_type->template)]);
            } else {
                _e('Template file does not exist', 'papi');
            }
        }
    }
    ?>
				</td>
				<td>
					<?php 
    echo esc_html(papi_get_number_of_pages($page_type->get_id()));
    ?>
				</td>
			</tr>
		<?php 
}
开发者ID:KristoferN,项目名称:papi,代码行数:31,代码来源:management-start.php


示例13: render_repeater

    /**
     * Render repeater html.
     *
     * @param stdClass $options
     */
    protected function render_repeater($options)
    {
        ?>
		<div class="papi-property-repeater papi-property-repeater-top" data-limit="<?php 
        echo esc_attr($this->get_setting('limit'));
        ?>
">
			<table class="papi-table">
				<?php 
        $this->render_repeater_head();
        ?>

				<tbody class="repeater-tbody">
					<?php 
        $this->render_repeater_rows();
        ?>
				</tbody>
			</table>

			<div class="bottom">
				<?php 
        papi_render_html_tag('button', ['class' => 'button button-primary', 'data-papi-json' => sprintf('%s_repeater_json', $options->slug), 'type' => 'button', esc_html($this->get_setting('add_new_label'))]);
        ?>
			</div>

			<?php 
        /* Default repeater value */
        ?>

			<input type="hidden" data-papi-rule="<?php 
        echo esc_attr($options->slug);
        ?>
" name="<?php 
        echo esc_attr($options->slug);
        ?>
[]" />
		</div>
		<?php 
    }
开发者ID:nlemoine,项目名称:papi,代码行数:44,代码来源:class-papi-property-repeater.php


示例14: html

    /**
     * Render property html.
     */
    public function html()
    {
        $css_classes = '';
        $labels = $this->get_labels();
        $settings = $this->get_settings();
        $slug = $this->html_name();
        $value = papi_to_array($this->get_value());
        // Keep only valid objects.
        $value = array_filter($value, function ($item) {
            return is_object($item) && isset($item->id) && !empty($item->id);
        });
        $show_button = empty($value);
        if ($settings->multiple) {
            $css_classes .= ' multiple ';
            $slug .= '[]';
            $show_button = true;
        }
        ?>

		<div class="papi-property-file <?php 
        echo esc_attr($css_classes);
        ?>
" data-file-type="<?php 
        echo esc_attr($this->file_type);
        ?>
">
			<p class="papi-file-select <?php 
        echo $show_button ? '' : 'papi-hide';
        ?>
">
				<?php 
        if (!$settings->multiple) {
            echo esc_html($labels['no_file']) . '&nbsp;';
        }
        papi_render_html_tag('input', ['name' => esc_attr($slug), 'type' => 'hidden', 'value' => '']);
        papi_render_html_tag('button', ['data-slug' => esc_attr($slug), 'class' => 'button', 'type' => 'button', esc_html($labels['add'])]);
        ?>
			</p>
			<div class="attachments">
				<?php 
        if (is_array($value)) {
            foreach ($value as $file) {
                $url = wp_get_attachment_thumb_url($file->id);
                if (empty($url)) {
                    $url = wp_mime_type_icon($file->id);
                }
                ?>
						<div class="attachment">
							<a class="check" href="#">&times;</a>
							<div class="attachment-preview">
								<div class="thumbnail">
									<div class="centered">
										<?php 
                papi_render_html_tag('img', ['alt' => esc_attr($file->alt), 'src' => esc_attr($url)]);
                papi_render_html_tag('input', ['name' => esc_attr($slug), 'type' => 'hidden', 'value' => esc_attr($file->id)]);
                ?>
									</div>
									<?php 
                if ($this->file_type === 'file') {
                    ?>
										<div class="filename">
											<div><?php 
                    echo esc_html(basename($file->file));
                    ?>
</div>
										</div>
									<?php 
                }
                ?>
								</div>
							</div>
						</div>
					<?php 
            }
        }
        ?>
			</div>
			<div class="clear"></div>
		</div>
	<?php 
    }
开发者ID:wp-papi,项目名称:papi,代码行数:84,代码来源:class-papi-property-file.php


示例15: render_repeater

    /**
     * Render repeater html.
     *
     * @param object $options
     */
    protected function render_repeater($options)
    {
        $layouts = $this->get_settings_layouts();
        ?>
		<div class="papi-property-flexible papi-property-repeater-top" data-limit="<?php 
        echo esc_attr($this->get_setting('limit'));
        ?>
">
			<table class="papi-table">
				<tbody class="repeater-tbody flexible-tbody">
					<?php 
        $this->render_repeater_row();
        ?>
				</tbody>
			</table>

			<div class="bottom">
				<div class="flexible-layouts-btn-wrap">
					<div class="flexible-layouts papi-hide">
						<div class="flexible-layouts-arrow"></div>
						<ul>
							<?php 
        foreach ($layouts as $layout) {
            papi_render_html_tag('li', [papi_html_tag('a', ['data-layout' => esc_html($layout['slug']), 'data-papi-json' => sprintf('%s_repeater_json', $options->slug), 'href' => '#', 'role' => 'button', 'tabindex' => 0, esc_html($layout['title'])])]);
        }
        ?>
						</ul>
					</div>

					<?php 
        papi_render_html_tag('button', ['class' => 'button button-primary', 'type' => 'button', esc_html($this->get_setting('add_new_label'))]);
        ?>
				</div>
			</div>

			<?php 
        /* Default repeater value */
        ?>

			<input type="hidden" data-papi-rule="<?php 
        echo esc_attr($options->slug);
        ?>
" name="<?php 
        echo esc_attr($this->get_slug());
        ?>
[]" />
		</div>
		<?php 
    }
开发者ID:nlemoine,项目名称:papi,代码行数:54,代码来源:class-papi-property-flexible.php


示例16: html

 /**
  * Render property html.
  */
 public function html()
 {
     papi_render_html_tag('textarea', ['class' => 'papi-property-text', 'id' => esc_attr($this->html_id()), 'name' => esc_attr($this->html_name()), $this->get_value()]);
 }
开发者ID:wp-papi,项目名称:papi,代码行数:7,代码来源:class-papi-property-text.php


示例17: html

 /**
  * Render property html.
  */
 public function html()
 {
     $settings = $this->get_settings();
     $value = $this->get_value();
     papi_render_html_tag('div', ['class' => 'papi-property-color-picker', papi_html_tag('input', ['data-palettes' => $settings->palettes, 'id' => $this->html_id(), 'name' => $this->html_name(), 'type' => $settings->show_input === true ? 'text' : 'hidden', 'value' => $value])]);
 }
开发者ID:ekandreas,项目名称:papi,代码行数:9,代码来源:class-papi-property-color.php


示例18: edit_form_after_title

 /**
  * Output Papi page type hidden field.
  *
  * This will only output on a post type page.
  */
 public function edit_form_after_title()
 {
     wp_nonce_field('papi_save_data', 'papi_meta_nonce');
     if ($value = esc_attr(papi_get_entry_type_id())) {
         papi_render_html_tag('input', ['data-papi-page-type-key' => true, 'name' => esc_attr(papi_get_page_type_key()), 'type' => 'hidden', 'value' => $value]);
     }
 }
开发者ID:nlemoine,项目名称:papi,代码行数:12,代码来源:class-papi-admin.php


示例19: html

    /**
     * Render property html.
     */
    public function html()
    {
        $settings = $this->get_settings();
        $value = $this->get_value();
        if (is_object($value)) {
            $value = $value->term_id;
        } else {
            $value = 0;
        }
        $classes = 'papi-fullwidth';
        if ($settings->select2) {
            $classes = ' papi-component-select2';
        }
        ?>
		<div class="papi-property-term">
		<?php 
        if (empty($settings->taxonomy)) {
            ?>
			<p><?php 
            _e('No taxonomy defined for term property', 'papi');
            ?>
</p>
		<?php 
        } elseif (!term_exists($settings->taxonomy)) {
            ?>
			<p><?php 
            echo esc_html(sprintf(__('The taxonomy "%s" does not exists', 'papi'), $settings->taxonomy));
            ?>
</p>
		<?php 
        } else {
            $terms = $this->get_terms($settings);
            ?>
			<select
				id="<?php 
            echo $this->html_id();
            ?>
"
				name="<?php 
            echo $this->html_name();
            ?>
"
				class="<?php 
            echo $classes;
            ?>
"
				data-allow-clear="true"
				data-placeholder="<?php 
            echo isset($settings->placeholder) ? $settings->placeholder : '';
            ?>
"
				data-width="100%">

				<?php 
            if (isset($settings->placeholder)) {
                ?>
					<option value=""></option>
				<?php 
            }
            ?>

				<?php 
            foreach ($terms as $term_id => $term_name) {
                ?>
					<?php 
                papi_render_html_tag('option', ['value' => $term_id, 'selected' => $value === $term_id ? 'selected' : null, $term_name]);
                ?>
				<?php 
            }
            ?>

			</select>
		<?php 
        }
        ?>
		</div>
		<?php 
    }
开发者ID:ekandreas,项目名称:papi,代码行数:81,代码来源:class-papi-property-term.php


示例20: html

    /**
     * Render property html.
     */
    public function html()
    {
        $settings = $this->get_settings();
        $value = $this->get_value();
        if (is_object($value)) {
            $value = $value->ID;
        } else {
            $value = 0;
        }
        $posts = $this->get_posts($settings);
        $render_label = count($posts) > 1;
        $classes = 'papi-fullwidth';
        if ($settings->select2) {
            $classes = ' papi-component-select2';
        }
        ?>

		<div class="papi-property-post">
			<select
				id="<?php 
        echo $this->html_id();
        ?>
"
				name="<?php 
        echo $this->html_name();
        ?>
"
				class="<?php 
        echo $classes;
        ?>
"
				data-allow-clear="true"
				data-placeholder="<?php 
        echo $settings->placeholder;
        ?>
"
				data-width="100%">

				<?php 
        if (!empty($settings->placeholder)) {
            ?>
					<option value=""></option>
				<?php 
        }
        ?>

				<?php 
        foreach ($posts as $label => $items) {
            ?>

					<?php 
            if ($render_label && is_string($label)) {
                ?>
						<optgroup label="<?php 
                echo $label;
                ?>
">
					<?php 
            }
            ?>

					<?php 
            foreach ($items as $post) {
                if (papi_is_empty($post->post_title)) {
                    continue;
                }
                papi_render_html_tag('option', ['value' => $post->ID, 'selected' => $value === $post->ID ? 'selected' : null, $post->post_title]);
            }
            ?>

					<?php 
            if ($render_label) {
                ?>
						</optgroup>
					<?php 
            }
            ?>

				<?php 
        }
        ?>

			</select>
		</div>
		<?php 
    }
开发者ID:ekandreas,项目名称:papi,代码行数:89,代码来源:class-papi-property-post.php



注:本文中的papi_render_html_tag函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP papi_to_array函数代码示例发布时间:2022-05-15
下一篇:
PHP papi_property函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap