• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Akismet_Admin::admin_help() – Add help to the Akismet page

You appear to be a bot. Output may be restricted

Description

Add help to the Akismet page

Usage

$false = Akismet_Admin::admin_help();

Parameters

Returns

false if not the Akismet page

Source

File name: akismet/class.akismet-admin.php
Lines:

1 to 100 of 103
  public static function admin_help() {
    $current_screen = get_current_screen();

    // Screen Content
    if ( current_user_can( 'manage_options' ) ) {
      if ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) ) {
        //setup page
        $current_screen->add_help_tab(
          array(
            'id'    => 'overview',
            'title'    => __( 'Overview' , 'akismet'),
            'content'  =>
              '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
              '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
              '<p>' . esc_html__( 'On this page, you are able to set up the Akismet plugin.' , 'akismet') . '</p>',
          )
        );

        $current_screen->add_help_tab(
          array(
            'id'    => 'setup-signup',
            'title'    => __( 'New to Akismet' , 'akismet'),
            'content'  =>
              '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
              '<p>' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.' , 'akismet') . '</p>' .
              '<p>' . sprintf( __( 'Sign up for an account on %s to get an API Key.' , 'akismet'), '<a href="https://akismet.com/plugin-signup/" target="_blank">Akismet.com</a>' ) . '</p>',
          )
        );

        $current_screen->add_help_tab(
          array(
            'id'    => 'setup-manual',
            'title'    => __( 'Enter an API Key' , 'akismet'),
            'content'  =>
              '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
              '<p>' . esc_html__( 'If you already have an API key' , 'akismet') . '</p>' .
              '<ol>' .
                '<li>' . esc_html__( 'Copy and paste the API key into the text field.' , 'akismet') . '</li>' .
                '<li>' . esc_html__( 'Click the Use this Key button.' , 'akismet') . '</li>' .
              '</ol>',
          )
        );
      }
      elseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' ) {
        //stats page
        $current_screen->add_help_tab(
          array(
            'id'    => 'overview',
            'title'    => __( 'Overview' , 'akismet'),
            'content'  =>
              '<p><strong>' . esc_html__( 'Akismet Stats' , 'akismet') . '</strong></p>' .
              '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
              '<p>' . esc_html__( 'On this page, you are able to view stats on spam filtered on your site.' , 'akismet') . '</p>',
          )
        );
      }
      else {
        //configuration page
        $current_screen->add_help_tab(
          array(
            'id'    => 'overview',
            'title'    => __( 'Overview' , 'akismet'),
            'content'  =>
              '<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
              '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
              '<p>' . esc_html__( 'On this page, you are able to update your Akismet settings and view spam stats.' , 'akismet') . '</p>',
          )
        );

        $current_screen->add_help_tab(
          array(
            'id'    => 'settings',
            'title'    => __( 'Settings' , 'akismet'),
            'content'  =>
              '<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
              ( Akismet::predefined_api_key() ? '' : '<p><strong>' . esc_html__( 'API Key' , 'akismet') . '</strong> - ' . esc_html__( 'Enter/remove an API key.' , 'akismet') . '</p>' ) .
              '<p><strong>' . esc_html__( 'Comments' , 'akismet') . '</strong> - ' . esc_html__( 'Show the number of approved comments beside each comment author in the comments list page.' , 'akismet') . '</p>' .
              '<p><strong>' . esc_html__( 'Strictness' , 'akismet') . '</strong> - ' . esc_html__( 'Choose to either discard the worst spam automatically or to always put all spam in spam folder.' , 'akismet') . '</p>',
          )
        );

        if ( ! Akismet::predefined_api_key() ) {
          $current_screen->add_help_tab(
            array(
              'id'    => 'account',
              'title'    => __( 'Account' , 'akismet'),
              'content'  =>
                '<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
                '<p><strong>' . esc_html__( 'Subscription Type' , 'akismet') . '</strong> - ' . esc_html__( 'The Akismet subscription plan' , 'akismet') . '</p>' .
                '<p><strong>' . esc_html__( 'Status' , 'akismet') . '</strong> - ' . esc_html__( 'The subscription status - active, cancelled or suspended' , 'akismet') . '</p>',
            )
          );
        }
      }
    }

    // Help Sidebar
    $current_screen->set_help_sidebar(
      '<p><strong>' . esc_html__( 'For more information:' , 'akismet') . '</strong></p>' .
      '<p><a href="https://akismet.com/faq/" target="_blank">'     . esc_html__( 'Akismet FAQ' , 'akismet') . '</a></p>' .
 
[1] [2] Next »

 View on GitHub View on Trac

Published: 19th December 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: Akismet_Admin::admin_help
Class ref: Akismet_Admin
Plugin ref: Akismet
Version: 5.0.1
Sourcefile: class.akismet-admin.php
File ref: class.akismet-admin.php
Deprecated?: No
API Letters: A,H

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.27
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites