2013-02-19 109 views
1

這裏是打印的片斷關閉的$ wp_scripts從這個對象/數組中提取數據?怎麼辦呢

WP_Scripts Object 
(

[base_url] => http://***** 
[content_url] => http://***** 
[default_version] => 3.5.1 
[in_footer] => Array 
    (
    ) 

[concat] => 
[concat_version] => 
[do_concat] => 
[print_html] => 
[print_code] => 
[ext_handles] => 
[ext_version] => 
[default_dirs] => Array 
    (
     [0] => /wp-admin/js/ 
     [1] => /wp-includes/js/ 
    ) 

[registered] => Array 
    (
     [utils] => _WP_Dependency Object 
      (
       [handle] => utils 
       [src] => /wp-includes/js/utils.min.js 
       [deps] => Array 
        (
        ) 

我怎麼會提取一些數據,例如「/wp-includes/js/utils.min.js」?

感謝

+0

通過->

訪問數組元素訪問對象屬性,你要提取什麼目前還不清楚,舉美國的例子輸入和預期的輸出 – VladL 2013-02-19 16:45:40

回答

2
$wp_scripts->registered['utils']->src 

通過[/* String or integer here*/]

0
$object = new WP_Scripts; 
$src = $object->registered['utils']->src;