Plugin Directory

Changeset 2544357


Ignore:
Timestamp:
06/08/2021 02:11:35 PM (5 years ago)
Author:
jojoee
Message:

Release 1.2.7

Location:
grayscale-body/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • grayscale-body/trunk/grayscale-body.php

    r2508518 r2544357  
    44Plugin URI: https://wordpress.org/plugins/grayscale-body/
    55Description: Automatically turn the site to grayscale
    6 Version: 1.2.6
     6Version: 1.2.7
    77Author: Nathachai Thongniran
    88Author URI: http://jojoee.com/
     
    112112  }
    113113
     114  public function gsb_add_scripts( $is_enable_switcher = TRUE ) {
     115    if ( $is_enable_switcher ) {
     116      wp_enqueue_style( 'gsb-main-style', plugins_url( 'css/main.css', __FILE__ ) );
     117      wp_enqueue_script( 'gsb-main-script', plugins_url( 'js/main.js', __FILE__ ), array(), '120', TRUE );
     118
     119    } else {
     120      wp_enqueue_style( 'gsb-main-style-noswitcher', plugins_url( 'css/main-noswitcher.css', __FILE__ ) );
     121    }
     122  }
     123
    114124  public function gsb_enqueue_scripts() {
    115125    global $post;
     
    122132    $is_ignored_post    = in_array( $post_id, $ignored_post_ids );
    123133
    124     if ( $is_enabled && ! $is_ignored_post ) {
    125       if ( $is_enable_switcher ) {
    126         wp_enqueue_style( 'gsb-main-style', plugins_url( 'css/main.css', __FILE__ ) );
    127         wp_enqueue_script( 'gsb-main-script', plugins_url( 'js/main.js', __FILE__ ), array(), '120', TRUE );
    128 
     134    if ( $is_enabled ) {
     135      // some list-page or archive-page returns a post_id, so we need to address it first
     136      if ( is_single() ) {
     137        if ( ! $is_ignored_post ) {
     138          $this->gsb_add_scripts( $is_enable_switcher );
     139        }
    129140      } else {
    130         wp_enqueue_style( 'gsb-main-style-noswitcher', plugins_url( 'css/main-noswitcher.css', __FILE__ ) );
     141        $this->gsb_add_scripts( $is_enable_switcher );
    131142      }
    132143    }
  • grayscale-body/trunk/readme.txt

    r2508518 r2544357  
    55Tags: grayscale, black, white, black and white, site, convert, conversion, CSS, CSS3, filter
    66Requires at least: 3.0.1
    7 Tested up to: 5.7
     7Tested up to: 5.7.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5353
    5454== Upgrade Notice ==
     55
     56= 1.2.7 =
     57* Fix bug, "ignored post ids" feature must ignore archive or listing page
    5558
    5659= 1.2.6 =
Note: See TracChangeset for help on using the changeset viewer.