當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WPBMap::user_categories方法代碼示例

本文整理匯總了PHP中WPBMap::user_categories方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPBMap::user_categories方法的具體用法?PHP WPBMap::user_categories怎麽用?PHP WPBMap::user_categories使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WPBMap的用法示例。


在下文中一共展示了WPBMap::user_categories方法的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_categories方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。