@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Make sure there is an action first |
| 4 | -if ( ! isset( $_REQUEST['action'] ) ) { |
|
| 4 | +if ( ! isset( $_REQUEST[ 'action' ] ) ) { |
|
| 5 | 5 | die( '0' ); |
| 6 | 6 | } |
| 7 | 7 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * This is just an example of a secrept WordPress feature called "fast ajax" |
| 28 | 28 | */ |
| 29 | -add_action( 'wp_ajax_example', function () { |
|
| 29 | +add_action( 'wp_ajax_example', function() { |
|
| 30 | 30 | // Include the now instantiated global $wpdb Class for use |
| 31 | 31 | global $wpdb; |
| 32 | 32 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | // ========= ! DO NOT EDIT THE CODE BELOW ! ========= // |
| 44 | 44 | |
| 45 | 45 | try { |
| 46 | - $action_name = sprintf( 'wp_ajax_%s', $_REQUEST['action'] ); |
|
| 46 | + $action_name = sprintf( 'wp_ajax_%s', $_REQUEST[ 'action' ] ); |
|
| 47 | 47 | do_action( $action_name ); |
| 48 | 48 | die( '0' ); |
| 49 | 49 | } catch ( \Exception $ex ) { |