Plugin Directory

Changeset 2788848

Timestamp:
09/22/2022 05:59:18 PM (23 months ago)
Author:
kbrownkd
Message:

Fix a bug that broke some admin page links when Jetpack plugins are active.

Location:
akismet/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • akismet/trunk/akismet.php

    r2788833 r2788848  
    77Plugin URI: https://akismet.com/
    88Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
    9 Version: 5.0.1a1
     9Version: 5.0.1a
    1010Author: Automattic
    1111Author URI: https://automattic.com/wordpress-plugins/
     
    3838}
    3939
    40 define( 'AKISMET_VERSION', '5.0.1a1' );
     40define( 'AKISMET_VERSION', '5.0.1a' );
    4141define( 'AKISMET__MINIMUM_WP_VERSION', '5.0' );
    4242define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • akismet/trunk/class.akismet-admin.php

    r2753903 r2788848  
    7575            delete_option( 'Activated_Akismet' );
    7676            if ( ! headers_sent() ) {
    77                 wp_redirect( add_query_arg( array( 'page' => 'akismet-key-config', 'view' => 'start' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) ) );
     77                $admin_url = self::get_page_url( 'init' );
     78                wp_redirect( $admin_url );
    7879            }
    7980        }
     
    9192
    9293    public static function admin_menu() {
    93         if ( class_exists( 'Jetpack' ) )
     94        if ( class_exists( 'Jetpack' ) )
    9495            add_action( 'jetpack_admin_menu', array( 'Akismet_Admin', 'load_menu' ) );
    95         else
     96       
    9697            self::load_menu();
     98
    9799    }
    98100
     
    405407
    406408            if ( ! Akismet::get_api_key() ) {
    407                 $link = add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) );
     409                $link = );
    408410                $classes[] = 'ajax-disabled';
    409411            }
     
    826828        $args = array( 'page' => 'akismet-key-config' );
    827829
    828         if ( $page == 'stats' )
     830        if ( $page == 'stats' )
    829831            $args = array( 'page' => 'akismet-key-config', 'view' => 'stats' );
    830         elseif ( $page == 'delete_key' )
     832       
    831833            $args = array( 'page' => 'akismet-key-config', 'view' => 'start', 'action' => 'delete-key', '_wpnonce' => wp_create_nonce( self::NONCE ) );
    832 
    833         $url = add_query_arg( $args, class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) );
    834 
    835         return $url;
     834        } elseif ( $page === 'init' ) {
     835            $args = array( 'page' => 'akismet-key-config', 'view' => 'start' );
     836        }
     837
     838        return add_query_arg( $args, menu_page_url( 'akismet-key-config', false ) );
    836839    }
    837840   
  • akismet/trunk/readme.txt

    r2788833 r2788848  
    3535*Release Date - TBD*
    3636
    37 * Add an empty state for the Statistics section on the admin page.
     37* Added an empty state for the Statistics section on the admin page.
     38* Fixed a bug that broke some admin page links when Jetpack plugins are active.
    3839
    3940= 5.0 =
Note: See TracChangeset for help on using the changeset viewer.