Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I guess you've to be more specific what kind of functions exactly. Wordpress does not provide something like that out of the box, most PHP apps won't.</p> <p>I also think you're calling for trouble here when such apps aren't developed in mind for such environments.</p> <p>Here's an example trying to call "current_time()" from functions.php and the attempts I had to do just to realize it won't work that way:</p> <pre><code> php -r 'require "functions.php"; var_dump(current_time("mysql"));' </code></pre> <p>gives</p> <pre><code> Fatal error: Call to undefined function apply_filters() in functions.php on line 346 </code></pre> <p>Trying</p> <pre><code> php -r 'require "functions.php"; require "plugin.php"; var_dump(current_time("mysql"));' </code></pre> <p>gives</p> <pre><code> Fatal error: Call to undefined function wp_cache_get() in functions.php on line 351 </code></pre> <p>Trying</p> <pre><code> php -r 'require "functions.php"; require "plugin.php"; require "cache.php"; var_dump(current_time("mysql"));' </code></pre> <p>gives</p> <pre><code> Fatal error: Call to a member function get() on a non-object in cache.php on line 93 </code></pre> <p>Looking at the last error in the source I see</p> <pre><code> function wp_cache_get($id, $flag = '') { global $wp_object_cache; return $wp_object_cache->get($id, $flag); } </code></pre> <p>Using global variables makes testing in other environments a PITA if not impossible.</p> <p>If this is not what you're trying to do, you've to be more specific/detailed in your question.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload