Plugin Directory

Changeset 2729665


Ignore:
Timestamp:
05/24/2022 05:37:19 PM (4 years ago)
Author:
eggnstone
Message:

v1.0.23: Added support for 404 page.

Location:
widgets-for-amazon/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • widgets-for-amazon/trunk/README.txt

    r2729599 r2729665  
    77Requires PHP: 7.0 
    88Tested up to: 5.9 
    9 Stable tag: 1.0.22
     9Stable tag: 1.0.23
    1010License: GPLv3 or later 
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5252== Changelog ==
    5353
    54 #### 1.0.22 - 2022-05-24
     54#### 1.0.23 - 2022-05-24
    5555
    5656- Added support for 404 page.
  • widgets-for-amazon/trunk/includes/Plugin.php

    r2729585 r2729665  
    99    public static function filter_get_search_form($form): string
    1010    {
    11         global $wp_query;
    12 
    1311        //Tools::log_function('filter_get_search_form');
    1412
    15         $is404Page = ($wp_query && $wp_query->query_vars && $wp_query->query_vars['error'] == '404');
    16         //Tools::log_debug('$is404Page: ' . $is404Page);
    17         if ($is404Page)
     13        if (is_404())
    1814        {
    1915            $showOn404Page = get_option(Constants::OPTION_SHOW_ON_404_PAGE_NAME, Constants::OPTION_SHOW_ON_404_PAGE_DEFAULT_VALUE);
     
    3430
    3531        // Determine plugin version for JSON request.
     32        if (!function_exists('get_plugin_data'))
     33            require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    3634        $plugin_data = get_plugin_data(plugin_dir_path(__DIR__) . Constants::PLUGIN_FILE_NAME);
    3735        $plugin_version = $plugin_data['Version'];
     
    4442        $html = self::create_search_box_html('sf-' . self::$search_form_search_box_index);
    4543
    46         if ($is404Page)
     44        if (is_404())
    4745        {
    4846            $query = $_SERVER['REQUEST_URI'];
     
    125123
    126124        // Determine plugin version for JSON request.
     125        if (!function_exists('get_plugin_data'))
     126            require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    127127        $plugin_data = get_plugin_data(plugin_dir_path(__DIR__) . Constants::PLUGIN_FILE_NAME);
    128128        $plugin_version = $plugin_data['Version'];
  • widgets-for-amazon/trunk/includes/Tools.php

    r2729563 r2729665  
    99        self::log_debug($function);
    1010
     11        self::log_debug('  is_404: ' . is_404());
    1112        self::log_debug('  is_active_widget: ' . is_active_widget());
    1213        self::log_debug('  is_archive: ' . is_archive());
  • widgets-for-amazon/trunk/widgets-for-amazon.php

    r2729599 r2729665  
    55 * Plugin URI: https://blog.eggnstone.com/blog/widgets-for-amazon-for-wordpress
    66 * Description: Widgets for Amazon by eggnstone
    7  * Version: 1.0.22
     7 * Version: 1.0.23
    88 * Author: eggnstone
    99 * Author URI: https://eggnstone.com
Note: See TracChangeset for help on using the changeset viewer.