1

Here is a snippet of the print off of $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
                    (
                    )

How would i Extract some data, for example "/wp-includes/js/utils.min.js"??

Thanks

1
  • it's not clear what do you want to extract, give us example input and expected output Commented Feb 19, 2013 at 16:45

2 Answers 2

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

Accessing object properties via ->

Accessing array elements via [/* String or integer here*/]

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.