Last active
May 14, 2021 18:49
-
-
Save racmanuel/16b8f8a6b5cdaed26b076c7417745bf1 to your computer and use it in GitHub Desktop.
Get multiple specifics URL in Wordpress and Enqueue a Style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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