コード例 #1
0
ファイル: drupalexp.php プロジェクト: jesusone/fptcity
 /**
  * Add Shortcode Params
  *
  * @return none
  */
 function zoShortcodeAddParams()
 {
     $extra_params_folder = get_template_directory() . '/vc_params';
     $files = zoFileScanDirectory($extra_params_folder, '/^zo_.*\\.php/');
     if (!empty($files)) {
         foreach ($files as $file) {
             if (WPBMap::exists($file->name)) {
                 include $file->uri;
                 if (isset($params) && is_array($params)) {
                     foreach ($params as $param) {
                         if (is_array($param)) {
                             $param['group'] = __('Template', ZO_NAME);
                             $param['edit_field_class'] = isset($param['edit_field_class']) ? $param['edit_field_class'] . ' zo_custom_param vc_col-sm-12 vc_column' : 'zo_custom_param vc_col-sm-12 vc_column';
                             $param['class'] = 'zo-extra-param';
                             if (isset($param['template']) && !empty($param['template'])) {
                                 if (!is_array($param['template'])) {
                                     $param['template'] = array($param['template']);
                                 }
                                 $param['dependency'] = array("element" => "zo_template", "value" => $param['template']);
                             }
                             vc_add_param($file->name, $param);
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: modifications.php プロジェクト: SayenkoDesign/ividf
/**
 * Sort WPB Elements
 */
function om_wpb_sort_elements()
{
    $elements = array('vc_row', 'vc_column_text', 'vc_separator', 'vc_text_separator', 'om_icon_separator', 'vc_message', 'vc_facebook', 'vc_tweetmeme', 'vc_googleplus', 'vc_pinterest', 'vc_toggle', 'vc_single_image', 'vc_gallery', 'vc_images_carousel', 'vc_tabs', 'vc_tour', 'vc_accordion', 'vc_btn', 'vc_cta', 'vc_icon', 'vc_video', 'vc_gmaps', 'vc_raw_html', 'vc_raw_js', 'vc_flickr', 'vc_progress_bar', 'vc_pie', 'vc_empty_space', 'vc_custom_heading', 'om_box', 'om_counter', 'om_a_button', 'om_pricing_table', 'om_pricing_table_column', 'om_html_table', 'om_posts', 'om_testimonials', 'om_portfolio', 'om_logos', 'om_chart', 'om_person', 'om_click_box', 'om_moving_box', 'om_click_icon_box', 'om_click_icon_box2', 'om_teaser');
    $elements = array_reverse($elements);
    $w = 10;
    foreach ($elements as $v) {
        if (WPBMap::exists($v)) {
            vc_map_update($v, array('weight' => $w));
            $w += 10;
        }
    }
}