php - Wordpress plugin, can't echo the array -


i'm trying remove css files , out put full path, i'm trying:

$cssarray = array();  add_action( 'wp_print_styles', 'removestyles', 100 );  function removestyles() {     global $wp_styles;      foreach( $wp_styles->queue $handle ){         wp_dequeue_style($handle);         $src = $wp_styles->registered[$handle]->src;         array_push($cssarray, $src);     } }    add_action('wp_head','hook_css');  function hook_css() {      $output = "<tag1>";      foreach ($cssarray $csses => $css) {         $output .= $css;     }      $output .= "</tag1>";  } 

the result <tag1></tag1>.

i tried print_r $cssarray array, looks empty. doing wrong?

as per comment, think $cssarray you've declared isn't available functions. try making global.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -