Skip to content

Instantly share code, notes, and snippets.

@racmanuel
Last active May 14, 2021 18:49
Show Gist options
  • Save racmanuel/16b8f8a6b5cdaed26b076c7417745bf1 to your computer and use it in GitHub Desktop.
Save racmanuel/16b8f8a6b5cdaed26b076c7417745bf1 to your computer and use it in GitHub Desktop.
Get multiple specifics URL in Wordpress and Enqueue a Style
<?php
$urls = array(
'vendor-dashboard',
'vendor-dashboard/product',
'vendor-dashboard/order',
'vendor-dashboard/settings',
'vendor-dashboard/rating',
'vendor-dashboard/wcv_refund_request',
);
foreach ($urls as $url => $url_result) {
if (strpos($_SERVER["REQUEST_URI"], $url_result) != false) {
//url contains 'vendors-dashboard/array($urls)'
wp_enqueue_style('vendors-dashboard', get_stylesheet_directory_uri() . '/assets/css/marketplace-vendors-dashboard.css', array(), '1.0', 'all');
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment