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
Post a Comment