by rush-intely | Apr 6, 2022 | WordPress
Post Views: 10 If you want to make a URL relative from the WordPress root, you can use the following WordPress function. <?php $full_url = “https://intelyblog.com/how-to-programmatically-add-a-wordpress-admin-user-using-functions-php/”;...
by rush-intely | Apr 5, 2022 | PHP
Post Views: 6 Normal way of writing an if else statement <?php $result = ”; $count = 55; $target = 70; if($count >= $target) { $result = ‘High’; } else { $result = ‘Low’; } ?> Now let’s see how the above can be written in a...
by rush-intely | Feb 28, 2022 | WordPress
Post Views: 18 Step 1: Open your theme’s functions.php using a editor. Step 2:Paste the following code at the bottom of the functions.php (need to remove once the user is added) add_action(‘init’, ‘create_my_custom_admin_user’); function...
by rush-intely | Sep 11, 2021 | PHP
Post Views: 18 function checkRemoteFileExists($remoteFile) { $ch = curl_init($remoteFile); curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($code == 400) { $status = true; } else { $status = false; }...
by rush-intely | Sep 7, 2021 | PHP
Post Views: 14 Step 1: Deciding on the SSL protocol whether the site using http or https. if(isset($_SERVER[’HTTPS’]) && $_SERVER[’HTTPS’] === ‘on’) { $url = ‘https’; } else { $url = ‘http’; }...