PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.4.8
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.4.8
0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 All 33 releases
← All changes | classes/api.php +12 -0 0.4.70.4.8 View file →
@@ -241,8 +241,20 @@
241 241 *
242 242 * @return mixed The result of the snippet execution.
243 243 * @throws Exception If the snippet cannot be executed.
244 244 */
245 + /**
246 + * Declare every active PHP function snippet in the current request so they can call
247 + * one another, without executing any of them. Idempotent and cheap (runs once per
248 + * request). executeSnippet()/executeSnippetByName() already call this internally, so
249 + * you only need it to make function snippets callable from your own custom PHP.
250 + *
251 + * @return void
252 + */
253 + public function loadFunctions() {
254 + $this->core->define_all_functions();
255 + }
256 +
245 257 public function executeSnippetByName( $name, $args = [] ) {
246 258 try {
247 259 if ( empty( $name ) ) {
248 260 throw new Exception( 'The snippet name is required.' );