PublishPanel.php
757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace AIOSEO\Plugin\Common\Standalone;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
use AIOSEO\Plugin\Common\Models;
/**
* Handles the Publish Panel in the Block Editor.
*
* @since 4.2.0
*/
class PublishPanel {
/**
* Class constructor.
*
* @since 4.2.0
*/
public function __construct() {
if ( ! is_admin() || wp_doing_ajax() || wp_doing_cron() ) {
return;
}
add_action( 'admin_enqueue_scripts', [ $this, 'enqueueScript' ] );
}
/**
* Enqueues the script.
*
* @since 4.2.0
*
* @return void
*/
public function enqueueScript() {
if ( ! aioseo()->helpers->isScreenBase( 'post' ) ) {
return;
}
aioseo()->core->assets->load( 'src/vue/standalone/publish-panel/main.js' );
}
}