Reputation: 752
I am trying to check if the current MU site_id is 389 or 545 and then load the custom fonts file.
This is my attempt to check if either of the 2 site_id's provided match what is in the $site_id
variable. No errors returned, it's just not matching and not loading the file. Anything obviously wrong?
$site_id = get_current_blog_id();
if( $site_id == array('389', '545') ) {
wp_enqueue_style('sage/custom-fonts.css', asset_path('styles/custom-fonts.css'), false, null);
}
This works fine:
if( $site_id == '389' ) {
But I want to check multiple ID's.
Upvotes: 1
Views: 218
Reputation: 718
Let's try the below code.
$site_id = get_current_blog_id(); // Returns Integer
$site_id_arr = array('389', '545');
if( in_array($site_id,$site_id_arr)) {
wp_enqueue_style('sage/custom-fonts.css', asset_path('styles/custom-fonts.css'), false, null);
}
Ref:
Upvotes: 2