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


PHP WP_Dependencies類代碼示例

本文整理匯總了PHP中WP_Dependencies的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Dependencies類的具體用法?PHP WP_Dependencies怎麽用?PHP WP_Dependencies使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了WP_Dependencies類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_broken_dependencies

 protected function get_broken_dependencies(_WP_Dependency $item, WP_Dependencies $dependencies)
 {
     $broken = array();
     foreach ($item->deps as $handle) {
         if ($dep = $dependencies->query($handle)) {
             $broken = array_merge($broken, $this->get_broken_dependencies($dep, $dependencies));
         } else {
             $broken[] = $item->handle;
         }
     }
     return $broken;
 }
開發者ID:giridhar9,項目名稱:Portfolio,代碼行數:12,代碼來源:assets.php

示例2: test_query_and_registered_enqueued

 /**
  * @ticket 21741
  */
 function test_query_and_registered_enqueued()
 {
     $dep = new WP_Dependencies();
     $this->assertTrue($dep->add('one', ''));
     $this->assertInstanceOf('_WP_Dependency', $dep->query('one'));
     $this->assertInstanceOf('_WP_Dependency', $dep->query('one', 'registered'));
     $this->assertInstanceOf('_WP_Dependency', $dep->query('one', 'scripts'));
     $this->assertFalse($dep->query('one', 'enqueued'));
     $this->assertFalse($dep->query('one', 'queue'));
     $dep->enqueue('one');
     $this->assertTrue($dep->query('one', 'enqueued'));
     $this->assertTrue($dep->query('one', 'queue'));
     $dep->dequeue('one');
     $this->assertFalse($dep->query('one', 'queue'));
     $this->assertInstanceOf('_WP_Dependency', $dep->query('one'));
     $dep->remove('one');
     $this->assertFalse($dep->query('one'));
 }
開發者ID:boonebgorges,項目名稱:develop.wordpress,代碼行數:21,代碼來源:dependencies.php

示例3: get_dependents

 protected static function get_dependents(_WP_Dependency $script, WP_Dependencies $dependencies)
 {
     // @TODO move this into the collector
     $dependents = array();
     $handles = array_unique(array_merge($dependencies->queue, $dependencies->done));
     foreach ($handles as $handle) {
         if ($item = $dependencies->query($handle)) {
             if (in_array($script->handle, $item->deps)) {
                 $dependents[] = $handle;
             }
         }
     }
     sort($dependents);
     return $dependents;
 }
開發者ID:giridhar9,項目名稱:Portfolio,代碼行數:15,代碼來源:assets.php

示例4:

 function all_deps($handles, $recursion = false)
 {
     $r = parent::all_deps($handles, $recursion);
     if (!$recursion) {
         $this->to_do = apply_filters('print_scripts_array', $this->to_do);
     }
     return $r;
 }
開發者ID:nurpax,項目名稱:saastafi,代碼行數:8,代碼來源:class.wp-scripts.php

示例5: all_deps

 /**
  * @param mixed $handles
  * @param bool $recursion
  * @param mixed $group
  * @return bool
  */
 public function all_deps($handles, $recursion = false, $group = false)
 {
     $r = parent::all_deps($handles, $recursion);
     if (!$recursion) {
         /**
          * Filter the array of enqueued styles before processing for output.
          *
          * @since 2.6.0
          *
          * @param array $to_do The list of enqueued styles about to be processed.
          */
         $this->to_do = apply_filters('print_styles_array', $this->to_do);
     }
     return $r;
 }
開發者ID:pwsclau,項目名稱:kurastar_dev,代碼行數:21,代碼來源:class.wp-styles.php

示例6: all_deps

 public function all_deps($handles, $recursion = false, $group = false)
 {
     $r = parent::all_deps($handles, $recursion);
     if (!$recursion) {
         /**
          * Filter the list of script dependencies left to print.
          *
          * @since 2.3.0
          *
          * @param array $to_do An array of script dependencies.
          */
         $this->to_do = apply_filters('print_scripts_array', $this->to_do);
     }
     return $r;
 }
開發者ID:dshkwnds,項目名稱:Dockerfiles,代碼行數:15,代碼來源:class.wp-scripts.php


注:本文中的WP_Dependencies類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。