Must use Plugin not updating HTML code in head

I have solved my problem by adding $myCode -> change_url(); and add_action(‘wp_head’, array($myCode, ‘print_header_scripts’)); <?php class some_code { function change_url() { $domain_name = $_SERVER[‘SERVER_NAME’]; $country_code = get_country_code(); if ($country_code == “PK”) { header(“location: http://///////////////”); exit(); } else if ($country_code == “AU” && $domain_name !== “au.cacricketbats.com”) { header(“location: https:///////////////////” . parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH)); exit(); } } function … Read more

Add OR in mu-plugin to check if one of multiple users is the logged in user

Your question boils down to simple PHP. It is basically how to avoid ‘AdminUser’ !== $user->user_login || ‘AdminUser2’ !== $user->user_login || ‘AdminUser3’ !== $user->user_login || ‘AdminUser4’ !== $user->user_login || etc. One way to solve this is use in_array() instead: $allowed_users = [ ‘AdminUser’, ‘AdminUser2’, ‘AdminUser3’, // etc ]; $user = wp_get_current_user(); if($user && isset($user->user_login) && … Read more

Code Executing Too Late?

Per comments, declare it global before using in both (or all) places: global $sitetype; if ( $_SERVER[“HTTP_HOST”] === “domain1.com” ) { $sitetype = one; } //etc and global $sitetype; if ( $sitetype == all ){ echo “site type 1”; } //etc