本文整理汇总了PHP中UniteFunctionsWPRev::getPostTypesAssoc方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsWPRev::getPostTypesAssoc方法的具体用法?PHP UniteFunctionsWPRev::getPostTypesAssoc怎么用?PHP UniteFunctionsWPRev::getPostTypesAssoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsWPRev
的用法示例。
在下文中一共展示了UniteFunctionsWPRev::getPostTypesAssoc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UniteSettingsAdvancedRev
<?php
//set "slider_main" settings
$sliderMainSettings = new UniteSettingsAdvancedRev();
$sliderMainSettings->addTextBox("title", "", __("Slider Title", REVSLIDER_TEXTDOMAIN), array("description" => __("The title of the slider. Example: Slider1", REVSLIDER_TEXTDOMAIN), "required" => "true"));
$sliderMainSettings->addTextBox("alias", "", __("Slider Alias", REVSLIDER_TEXTDOMAIN), array("description" => __("The alias that will be used for embedding the slider. Example: slider1", REVSLIDER_TEXTDOMAIN), "required" => "true"));
$sliderMainSettings->addTextBox("shortcode", "", __("Slider Shortcode", REVSLIDER_TEXTDOMAIN), array("readonly" => true, "class" => "code", "hidden" => true));
//source type
$arrSourceTypes = array("posts" => __("Posts", REVSLIDER_TEXTDOMAIN), "specific_posts" => __("Specific Posts", REVSLIDER_TEXTDOMAIN), "gallery" => __("Gallery", REVSLIDER_TEXTDOMAIN));
$sliderMainSettings->addRadio("source_type", $arrSourceTypes, __("Source Type", REVSLIDER_TEXTDOMAIN), "gallery", array("hidden" => true));
$sliderMainSettings->startBulkControl("source_type", UniteSettingsRev::CONTROL_TYPE_SHOW, "posts");
//post types
$arrPostTypes = UniteFunctionsWPRev::getPostTypesAssoc(array("post"));
$arrParams = array("args" => "multiple size='5'");
$sliderMainSettings->addSelect("post_types", $arrPostTypes, __("Post Types", REVSLIDER_TEXTDOMAIN), "post", $arrParams);
//post categories
$arrParams = array("args" => "multiple size='7'");
$sliderMainSettings->addSelect("post_category", array(), __("Post Categories", REVSLIDER_TEXTDOMAIN), "", $arrParams);
//sort by
$arrSortBy = UniteFunctionsWPRev::getArrSortBy();
//events integration
if (UniteEmRev::isEventsExists()) {
$arrEventsFilter = UniteEmRev::getArrFilterTypes();
$sliderMainSettings->addHr();
$sliderMainSettings->addSelect("events_filter", $arrEventsFilter, __("Filter Events By", REVSLIDER_TEXTDOMAIN), UniteEmRev::DEFAULT_FILTER);
$sliderMainSettings->addHr();
//add values to sortby array
$arrEMSortBy = UniteEmRev::getArrSortBy();
$arrSortBy = $arrSortBy + $arrEMSortBy;
}
$sliderMainSettings->addSelect("post_sortby", $arrSortBy, __("Sort Posts By", REVSLIDER_TEXTDOMAIN), RevSlider::DEFAULT_POST_SORTBY);
//sort direction