当前位置: 首页>>代码示例>>PHP>>正文


PHP WPBMap::user_sc方法代码示例

本文整理汇总了PHP中WPBMap::user_sc方法的典型用法代码示例。如果您正苦于以下问题:PHP WPBMap::user_sc方法的具体用法?PHP WPBMap::user_sc怎么用?PHP WPBMap::user_sc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WPBMap的用法示例。


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

示例1: generateUserData

 public static function generateUserData($force = false)
 {
     if (!$force && self::$user_sc !== false && self::$user_categories !== false) {
         return true;
     }
     $settings = self::getSettings();
     self::$user_sc = self::$user_categories = self::$user_sorted_sc = array();
     foreach (self::$sc_row as $values) {
         $name = $values['base'];
         if (!isset($settings[self::$user_role]['shortcodes']) || isset($settings[self::$user_role]['shortcodes'][$name]) && (int) $settings[self::$user_role]['shortcodes'][$name] == 1) {
             if ($name != 'vc_column' && (!isset($values['content_element']) || $values['content_element'] === true)) {
                 $categories = isset($values['category']) ? $values['category'] : '_other_category_';
                 $values['_category_ids'] = array();
                 if (is_array($categories)) {
                     foreach ($categories as $c) {
                         if (array_search($c, self::$user_categories) === false) {
                             self::$user_categories[] = $c;
                         }
                         $values['_category_ids'][] = md5($c);
                         // array_search($category, self::$categories);
                     }
                 } else {
                     if (array_search($categories, self::$user_categories) === false) {
                         self::$user_categories[] = $categories;
                     }
                     $values['_category_ids'][] = md5($categories);
                     // array_search($category, self::$categories);
                 }
             }
             self::$user_sc[$name] = $values;
             self::$user_sorted_sc[] = $values;
         }
     }
     usort(self::$user_sorted_sc, array("WPBMap", "sort"));
 }
开发者ID:ConceptHaus,项目名称:huasca,代码行数:35,代码来源:mapper.php

示例2: generateUserData

 public static function generateUserData()
 {
     if (self::$user_sc !== false && self::$user_categories !== false) {
         return true;
     }
     $settings = self::getSettings();
     self::$user_sc = self::$user_categories = array();
     foreach (self::$sc as $name => $values) {
         if (!isset($settings[self::$user_role]['shortcodes']) || isset($settings[self::$user_role]['shortcodes'][$name]) && (int) $settings[self::$user_role]['shortcodes'][$name] == 1) {
             self::$user_sc[$name] = $values;
             if ($name != 'vc_column' && (!isset($values['content_element']) || $values['content_element'] === true)) {
                 $category = isset($values['category']) ? $values['category'] : '_other_category_';
                 if (array_search($category, self::$user_categories) === false) {
                     self::$user_categories[] = $category;
                 }
             }
         }
     }
 }
开发者ID:unisexx,项目名称:drtooth,代码行数:19,代码来源:mapper.php

示例3: dropAllShortcodes

 public static function dropAllShortcodes()
 {
     if (!self::$is_init) {
         vc_mapper()->addActivity('mapper', 'drop_all_shortcodes', array());
         return false;
     }
     foreach (self::$sc as $name => $data) {
         visual_composer()->removeShortCode($name);
     }
     self::$sc = array();
     self::$user_sc = self::$user_categories = self::$user_sorted_sc = false;
     return true;
 }
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:13,代码来源:class-wpb-map.php

示例4: generateUserData

 /**
  * Generates list of shortcodes taking into account the access rules for shortcodes from VC Settings page.
  *
  * This method parses the list of mapped shortcodes and creates categories list for users.
  *
  * @static
  *
  * @param bool $force - force data generation even data already generated.
  */
 protected static function generateUserData($force = false)
 {
     if (!$force && self::$user_sc !== false && self::$user_categories !== false) {
         return;
     }
     $settings = self::getSettings();
     self::$user_sc = self::$user_categories = self::$user_sorted_sc = array();
     foreach (self::$sc as $name => $values) {
         if (in_array($name, array('vc_column', 'vc_row', 'vc_row_inner', 'vc_column_inner')) || !isset($settings[self::$user_role]['shortcodes']) || isset($settings[self::$user_role]['shortcodes'][$name]) && (int) $settings[self::$user_role]['shortcodes'][$name] == 1) {
             if (!isset($values['content_element']) || $values['content_element'] === true) {
                 $categories = isset($values['category']) ? $values['category'] : '_other_category_';
                 $values['_category_ids'] = array();
                 if (is_array($categories)) {
                     foreach ($categories as $c) {
                         if (array_search($c, self::$user_categories) === false) {
                             self::$user_categories[] = $c;
                         }
                         $values['_category_ids'][] = md5($c);
                         // array_search($category, self::$categories);
                     }
                 } else {
                     if (array_search($categories, self::$user_categories) === false) {
                         self::$user_categories[] = $categories;
                     }
                     $values['_category_ids'][] = md5($categories);
                     // array_search($category, self::$categories);
                 }
             }
             self::$user_sc[$name] = $values;
             self::$user_sorted_sc[] = $values;
         }
     }
     $sort = new Vc_Sort(self::$user_sorted_sc);
     self::$user_sorted_sc = $sort->sortByKey();
 }
开发者ID:chicosilva,项目名称:olharambiental,代码行数:44,代码来源:class-wpb-map.php


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