本文整理汇总了PHP中wpl_global::get_wp_pages方法的典型用法代码示例。如果您正苦于以下问题:PHP wpl_global::get_wp_pages方法的具体用法?PHP wpl_global::get_wp_pages怎么用?PHP wpl_global::get_wp_pages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wpl_global
的用法示例。
在下文中一共展示了wpl_global::get_wp_pages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate_pages_selectbox
/**
* List the layouts in <option> fields
* @author Howard <howard@realtyna.com>
* @param array $instance
* @param string $field_name
* @return string
*/
public function generate_pages_selectbox($instance, $field_name = 'wpltarget')
{
$pages = wpl_global::get_wp_pages();
$data = '';
foreach ($pages as $page) {
$data .= '<option ';
if (isset($instance[$field_name]) and $page->ID == $instance[$field_name]) {
$data .= 'selected="selected" ';
}
$data .= 'value="' . $page->ID . '"';
$data .= '>';
$data .= substr($page->post_title, 0, 100);
$data .= '</option>';
}
return $data;
}
示例2: generate_pages_selectbox
/**
* List WP Pages in <option> fields
* @author Howard <howard@realtyna.com>
* @param int $selected
* @return string
*/
public static function generate_pages_selectbox($selected)
{
$pages = wpl_global::get_wp_pages();
$output = '';
foreach ($pages as $page) {
$output .= '<option ';
if (isset($selected) and $page->ID == $selected) {
$output .= 'selected="selected" ';
}
$output .= 'value="' . $page->ID . '">';
$output .= substr($page->post_title, 0, 100);
$output .= '</option>';
}
return $output;
}
示例3: elseif
</span>
<?php
}
?>
<span class="ajax-inline-save" id="wpl_ajax_loader_<?php
echo $setting_record->id;
?>
"></span>
</div>
</div>
<?php
$done_this = true;
} elseif ($type == 'wppages' and !$done_this) {
$show_empty = isset($options['show_empty']) ? $options['show_empty'] : NULL;
$wp_pages = wpl_global::get_wp_pages();
?>
<div class="prow wpl_setting_form_container wpl_st_type<?php
echo $setting_record->type;
?>
wpl_st_<?php
echo $setting_record->setting_name;
?>
" id="wpl_st_<?php
echo $setting_record->id;
?>
">
<div class="select-wp">
<label for="wpl_st_form_element<?php
echo $setting_record->id;
?>