本文整理汇总了PHP中vc_taxonomies_types函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_taxonomies_types函数的具体用法?PHP vc_taxonomies_types怎么用?PHP vc_taxonomies_types使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vc_taxonomies_types函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vc_autocomplete_categ_field_render
function vc_autocomplete_categ_field_render($term)
{
$vc_taxonomies_types = vc_taxonomies_types();
$terms = get_categories(array('include' => array($term['value']), 'hide_empty' => false));
$data = false;
if (is_array($terms) && 1 === count($terms)) {
$term = $terms[0];
$data = vc_get_term_object($term);
}
return $data;
}
示例2: vc_autocomplete_taxonomies_field_search
/**
* @since 4.5.2
*
* @param $search_string
*
* @return array|bool
*/
function vc_autocomplete_taxonomies_field_search($search_string)
{
$data = array();
$vc_filter_by = vc_post_param('vc_filter_by', '');
$vc_taxonomies_types = strlen($vc_filter_by) > 0 ? array($vc_filter_by) : array_keys(vc_taxonomies_types());
$vc_taxonomies = get_terms($vc_taxonomies_types, array('hide_empty' => false, 'search' => $search_string));
if (is_array($vc_taxonomies) && !empty($vc_taxonomies)) {
foreach ($vc_taxonomies as $t) {
if (is_object($t)) {
$data[] = vc_get_term_object($t);
}
}
}
return $data;
}
示例3: vc_get_term_object
/**
* Since
*
* @since 4.5.3
*
* @param $term
*
* @return array
*/
function vc_get_term_object($term)
{
$vc_taxonomies_types = vc_taxonomies_types();
return array('label' => $term->name, 'value' => $term->term_id, 'group_id' => $term->taxonomy, 'group' => isset($vc_taxonomies_types[$term->taxonomy], $vc_taxonomies_types[$term->taxonomy]->labels, $vc_taxonomies_types[$term->taxonomy]->labels->name) ? $vc_taxonomies_types[$term->taxonomy]->labels->name : __('Taxonomies', 'js_composer'));
}
示例4: vc_autocomplete_taxonomies_field_search
/**
* @since 4.5.2
*
* @param $search_string
*
* @return array|bool
*/
function vc_autocomplete_taxonomies_field_search($search_string)
{
$data = array();
$vc_taxonomies_types = vc_taxonomies_types();
$vc_taxonomies = get_terms(array_keys($vc_taxonomies_types), array('hide_empty' => false, 'search' => $search_string));
if (is_array($vc_taxonomies) && !empty($vc_taxonomies)) {
foreach ($vc_taxonomies as $t) {
if (is_object($t)) {
$data[] = vc_get_term_object($t);
}
}
}
return $data;
}
示例5: get_post_types
$post_types = get_post_types(array());
$post_types_list = array();
$excluded_post_types = array('revision', 'nav_menu_item', 'vc_grid_item');
if (is_array($post_types) && !empty($post_types)) {
foreach ($post_types as $post_type) {
if (!in_array($post_type, $excluded_post_types)) {
$label = ucfirst($post_type);
$post_types_list[] = array($post_type, $label);
}
}
}
$post_types_list[] = array('custom', __('Custom query', 'js_composer'));
$post_types_list[] = array('ids', __('List of IDs', 'js_composer'));
$taxonomies_for_filter = array();
if ('vc_edit_form' === vc_post_param('action')) {
$vc_taxonomies_types = vc_taxonomies_types();
if (is_array($vc_taxonomies_types) && !empty($vc_taxonomies_types)) {
foreach ($vc_taxonomies_types as $t => $data) {
if ('post_format' !== $t && is_object($data)) {
$taxonomies_for_filter[$data->labels->name] = $t;
}
}
}
}
$grid_cols_list = array(array('label' => '6', 'value' => 2), array('label' => '4', 'value' => 3), array('label' => '3', 'value' => 4), array('label' => '2', 'value' => 6), array('label' => '1', 'value' => 12));
$btn3_params = vc_map_integrate_shortcode('vc_btn', 'btn_', __('Load More Button', 'js_composer'), array('exclude' => array('link', 'css', 'el_class', 'css_animation')), array('element' => 'style', 'value' => array('load-more')));
foreach ($btn3_params as $key => $value) {
if ('btn_title' == $value['param_name']) {
$btn3_params[$key]['value'] = __('Load more', 'js_composer');
} else {
if ('btn_color' == $value['param_name']) {