init_hooks(); } } /** * Initiate hooks. */ private function init_hooks() { add_action( 'admin_menu', [ $this, 'add_menu' ] ); add_action( 'admin_init', [ $this, 'init_settings' ] ); } /** * Init admin menu. */ public function add_menu() { add_submenu_page( 'anycomment-dashboard', __( 'Integration', "anycomment" ), __( 'Integration', "anycomment" ), 'manage_options', $this->page_slug, [ $this, 'page_html' ] ); } /** * {@inheritdoc} */ public function init_settings() { add_settings_section( 'section_integration', __( 'Generic', "anycomment" ), function () { ?>
= __( 'Integration with other plugin and/or services.', "anycomment" ) ?>
page_slug ); $this->render_fields( $this->page_slug, 'section_integration', [ [ 'id' => self::OPTION_AKISMET, 'title' => __( 'Akismet Anti-Spam', "anycomment" ), 'callback' => 'input_checkbox', 'description' => esc_html( __( 'Filter all new comments through Akismet Anti-Spam plugin.', "anycomment" ) ) ], ] ); } /** * Check whether Akismet filtration enabled or not. * * @return bool */ public static function isAkismetOn() { return static::instance()->getOption( self::OPTION_AKISMET ) !== null; } } endif;