Addons.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Admin\Asset; |
| 4 | |
| 5 | use AC\Asset\Location; |
| 6 | use AC\Asset\Script; |
| 7 | |
| 8 | class Addons extends Script { |
| 9 | |
| 10 | public function __construct( $handle, Location $location = null ) { |
| 11 | parent::__construct( $handle, $location, [ 'jquery' ] ); |
| 12 | } |
| 13 | |
| 14 | public function register() { |
| 15 | parent::register(); |
| 16 | |
| 17 | wp_localize_script( $this->get_handle(), 'AC', [ |
| 18 | '_ajax_nonce' => wp_create_nonce( 'ac-ajax' ), |
| 19 | 'is_network_admin' => is_network_admin(), |
| 20 | ] ); |
| 21 | } |
| 22 | |
| 23 | } |