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

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack_Core_API_Module_Data_Endpoint::akismet_is_active_and_registered() – Is Akismet registered and active?

You appear to be a bot. Output may be restricted

Description

Is Akismet registered and active?

Usage

$bool|WP_Error = Jetpack_Core_API_Module_Data_Endpoint::akismet_is_active_and_registered();

Parameters

Returns

bool|WP_Error True if Akismet is active and registered. Otherwise, a WP_Error instance with the corresponding error.

Source

File name: jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
Lines:

1 to 16 of 16
  private function akismet_is_active_and_registered() {
    if ( is_wp_error( $akismet_exists = $this->akismet_class_exists() ) ) {
      return $akismet_exists;
    }

    // What about if Akismet is put in a sub-directory or maybe in mu-plugins?
    require_once WP_PLUGIN_DIR . '/akismet/class.akismet.php';
    require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php';
    $akismet_key = Akismet::verify_key( Akismet::get_api_key() );

    if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) {
      return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) );
    }

    return true;
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 27 November 2019 | Last updated: 27 November 2019

Primary Sidebar

Information

Function name: Jetpack_Core_API_Module_Data_Endpoint::akismet_is_active_and_registered
Class ref: Jetpack_Core_API_Module_Data_Endpoint
Plugin ref: Jetpack
Version: 9.2
Sourcefile: _inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
File ref: _inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
Deprecated?: No
API Letters: A,C,D,J,M

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6
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:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites