当前位置: 首页>>代码示例>>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;未经允许,请勿转载。