PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
← All changes | classes/Controllers/Admin/SettingsPage.php +23 -0 trunk2.6.1 View file →
@@ -23,8 +23,13 @@
23 23 */
24 24 public function init() {
25 25 add_action( 'admin_menu', [ $this, 'register_page' ], 999 );
26 26 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
27 + // These are here to listen for incoming webhooks from the Upgrader service when user chooses to install Pro.
28 + add_action( 'wp_ajax_content_control_connect_verify_connection', [ $this, 'process_verify_connection' ] );
29 + add_action( 'wp_ajax_nopriv_content_control_connect_verify_connection', [ $this, 'process_verify_connection' ] );
30 + add_action( 'wp_ajax_content_control_connect_webhook', [ $this, 'process_webhook' ] );
31 + add_action( 'wp_ajax_nopriv_content_control_connect_webhook', [ $this, 'process_webhook' ] );
27 32 }
28 33
29 34 /**
30 35 * Register admin options pages.
@@ -68,6 +73,24 @@
68 73 wp_enqueue_editor();
69 74 wp_tinymce_inline_scripts();
70 75
71 76 wp_enqueue_script( 'content-control-settings-page' );
77 + }
78 +
79 + /**
80 + * Verify the connection.
81 + *
82 + * @return void
83 + */
84 + public function process_verify_connection() {
85 + $this->container->get( 'connect' )->process_verify_connection();
86 + }
87 +
88 + /**
89 + * Listen for incoming secure webhooks from the API server.
90 + *
91 + * @return void
92 + */
93 + public function process_webhook() {
94 + $this->container->get( 'connect' )->process_webhook();
72 95 }
73 96 }