I have an array simmilar to this:
$scripts_to_load = array(
'css' => array(
array(
'name'=>'core-css',
'path'=>get_bloginfo('stylesheet_url')
),
array(
'name'=>'media-query-css',
'path'=>get_template_directory_uri() . '/assets/mediaquery.css'
),
),
);
The above is how assets are stored.
I'd like to writer a function that takes type, css or js and a name, the type will find either css or js and then the name will be used to each for a key that matches the name key in one of the arrays, if it s found that array will be unset.
So what I have, is nothing accept: public function remove_asset($type, $name){}, so If I pass in remove_asset('css', 'media-query-css') the array should then look like:
$scripts_to_load = array(
'css' => array(
array(
'name'=>'core-css',
'path'=>get_bloginfo('stylesheet_url')
),
),
);
I am just not sure how to do that ... I can find the $type just fine, but its finding the $name that's giving me troubles and then unsetting that array.