Skip to content

Commit

Permalink
Merge pull request #31 from globalis-ms/develop
Browse files Browse the repository at this point in the history
version 0.3.4
  • Loading branch information
pierre-dargham authored Feb 14, 2019
2 parents 0822b04 + fb56185 commit fa1bade
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/functions-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,22 @@ function override_php_limits(int $time_limit = 604800, string $memory_limit = '5
set_time_limit($time_limit);
}

/**
* Check if current request is from command line
*
* @return bool
*/
function is_cli()
{
return PHP_SAPI === 'cli';
}

/**
* Check if current request is in frontend
*
* @return bool
*/
function is_frontend()
{
return !is_admin() && !wp_doing_ajax() && !wp_doing_cron();
return !is_cli() && !is_admin() && !wp_doing_ajax() && !wp_doing_cron();
}

0 comments on commit fa1bade

Please sign in to comment.