Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 114 characters in body
Source Link
Knott
  • 454
  • 2
  • 7
  • 27

I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts:

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}
add_action( 'wp_print_scripts', 'my_detected_scripts' );

Then:

echo my_detected_scripts()

How can get the handles of all front-end enqueued scripts only?

Thanks in advance!

Edit: Something strange which is that the function echoing the admin script handles without using add_action

I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts:

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}
add_action( 'wp_print_scripts', 'my_detected_scripts' );

Then:

echo my_detected_scripts()

How can get the handles of all front-end enqueued scripts only?

Thanks in advance!

Edit: Something strange which is that the function echoing the admin script handles without using add_action

I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts:

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}

Then:

echo my_detected_scripts()

How can get the handles of all front-end enqueued scripts only?

Thanks in advance!

improved question content
Source Link
Knott
  • 454
  • 2
  • 7
  • 27

How do I display the handle for all frontendfront-end enqueued scripts in plugin options page?

I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts:

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}
add_action( 'wp_print_scripts', 'my_detected_scripts' );

Then:

echo my_detected_scripts()

How can get the handles of all frontendfront-end enqueued scripts only?

Thanks in advance!

Edit: Something strange which is that the function echoing the admin script handles without using add_action

How do I display the handle for all frontend enqueued scripts in plugin options page?

I use the following function to display all the scripts handles in plugin options page but it display only the handles of admin:

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}
add_action( 'wp_print_scripts', 'my_detected_scripts' );

Then:

echo my_detected_scripts()

How can get the handles of all frontend enqueued scripts only?

Thanks in advance!

How do I display the handle for all front-end enqueued scripts in plugin options page?

I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts:

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}
add_action( 'wp_print_scripts', 'my_detected_scripts' );

Then:

echo my_detected_scripts()

How can get the handles of all front-end enqueued scripts only?

Thanks in advance!

Edit: Something strange which is that the function echoing the admin script handles without using add_action

Source Link
Knott
  • 454
  • 2
  • 7
  • 27

How do I display the handle for all frontend enqueued scripts in plugin options page?

I use the following function to display all the scripts handles in plugin options page but it display only the handles of admin:

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}
add_action( 'wp_print_scripts', 'my_detected_scripts' );

Then:

echo my_detected_scripts()

How can get the handles of all frontend enqueued scripts only?

Thanks in advance!