| @@ -23,9 +23,9 @@ | ||
| 23 | 23 | if ( $snippet['blocked'] ) { |
| 24 | 24 | // Determine the reason for blocking |
| 25 | 25 | $page = isset( $_GET["page"] ) ? sanitize_text_field( $_GET["page"] ) : null; |
| 26 | 26 | $is_settings_page = ( $page === 'mwcode_settings' ); |
| 27 | - $is_rest = MeowCommon_Helpers::is_rest(); | |
| 27 | + $is_rest = MeowKit_MWCODE_Helpers::is_rest(); | |
| 28 | 28 | $is_rest_whitelisted = Meow_MWCODE_Core::is_white_listed_rest(); |
| 29 | 29 | |
| 30 | 30 | $reason = ''; |
| 31 | 31 | if ( $is_settings_page ) { |
| @@ -56,10 +56,12 @@ | ||
| 56 | 56 | continue; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $current_mwcode_snippet = $snippet; |
| 60 | - | |
| 61 | 60 | |
| 61 | + // Remember we ran this global so load_global_snippets() won't run it a second time. | |
| 62 | + $mwcode_core->loaded_global_ids[] = $snippet['id']; | |
| 63 | + | |
| 62 | 64 | ob_start( ); |
| 63 | 65 | |
| 64 | 66 | try { |
| 65 | 67 | $mwcode_core->log( "Executing snippet: " . $snippet['name'] . " (ID: " . $snippet['id'] . ")" ); |
| @@ -88,9 +90,9 @@ | ||
| 88 | 90 | } |
| 89 | 91 | |
| 90 | 92 | |
| 91 | 93 | // In admin or Rest API request ( REQUEST URI begins with '/wp-json/' ) |
| 92 | -if ( is_admin( ) || MeowCommon_Helpers::is_rest( ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) { | |
| 94 | +if ( is_admin( ) || MeowKit_MWCODE_Helpers::is_rest( ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) { | |
| 93 | 95 | global $mwcode_core; |
| 94 | 96 | $mwcode_core = new Meow_MWCODE_Core( ); |
| 95 | 97 | } |
| 96 | 98 | |