Plugin Directory

Changeset 2034214


Ignore:
Timestamp:
02/19/2019 02:13:03 PM (7 years ago)
Author:
brandbrilliance
Message:

2.0.4 Fix index issues (no more notices)

Location:
post-state-tags
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • post-state-tags/tags/2.0.4/post-state-tags.php

    r1946967 r2034214  
    716716        {
    717717
    718             $color = $this->get_option( $status['option_handle'] , $section , $this->colors[$status['name']] );
     718            $defcolor = array_key_exists($status['name'], $this->colors) ? $this->colors[$status['name']] :  '';
     719            $color = $this->get_option( $status['option_handle'] , $section , $defcolor );
    719720        $css .= $this->color_builder($status['name'], $color);
    720721
    721             $icon = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     722            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     723            $icon = $this->get_option( $status['option_handle'] . $this->icon, $section,  $deficon);
    722724        $css .= $this->tag_builder($status['name'], $color, $icon);
    723725
     
    729731        foreach ($special as $status)
    730732        {
    731             $color = $this->get_option( $status['option_handle'] , $section , $this->colors[$status['name']] );
     733            $defcolor = array_key_exists($status['name'], $this->colors) ? $this->colors[$status['name']] :  '';
     734            $color = $this->get_option( $status['option_handle'] , $section , $defcolor );
    732735        $css .= $this->color_builder($status['name'], $color);
    733736
    734             $icon = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     737            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     738            $icon = $this->get_option( $status['option_handle'] . $this->icon, $section,  $deficon);
    735739        $css .= $this->tag_builder($status['name'], $color, $icon);
    736740        }
     
    743747            foreach ($custom as $status)
    744748            {
    745                 $color = $this->get_option( $status['option_handle'] , $section , $this->colors[$status['name']] );
     749                $defcolor = array_key_exists($status['name'], $this->colors) ? $this->colors[$status['name']] :  '';
     750                $color = $this->get_option( $status['option_handle'] , $section , $defcolor );
    746751            $css .= $this->color_builder($status['name'], $color);
    747752   
    748                 $icon = $this->get_option( $status['option_handle'] . $this->icon, $section, $this->icons[$status['name']] );
     753                $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     754                $icon = $this->get_option( $status['option_handle'] . $this->icon, $section,  $deficon);
    749755            $css .= $this->tag_builder($status['name'], $color, $icon);
    750756            }
     
    827833        foreach ($default as $status)
    828834        {
    829             $icon_list[ $status['option_handle'] . $this->icon ] = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );   
     835            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     836            $icon_list[ $status['option_handle'] . $this->icon ] = $this->get_option( $status['option_handle'] . $this->icon, $section, $deficon );
    830837        }
    831838
     
    835842        foreach ($special as $status)
    836843        {
    837             $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     844            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     845            $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section, $deficon );
    838846        }
    839847
     
    845853            foreach ($custom as $status)
    846854            {
    847                 $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     855                $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     856                $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section, $deficon );
    848857            }
    849858        }
     
    859868            return $post_states;
    860869   
     870//debug
     871//print_r($post_states);
     872
     873
    861874        if ( !empty($post_states) ) {
    862875           
  • post-state-tags/tags/2.0.4/readme.txt

    r1946963 r2034214  
    44Tags: wp-admin, admin, post state, color, post colours, list, highlight
    55Requires at least: 3.8
    6 Tested up to: 4.9.8
    7 Stable tag: 2.0.3
     6Tested up to: 5.0.3
     7Stable tag: 2.0.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9898== Changelog ==
    9999
     100= 2.0.4 =
     101* Fix check index values for icons and color with special custom statuses like WooCommerce
     102
    100103= 2.0.3 =
    101104* Replaced create_function in Settings API library with anonymous function
  • post-state-tags/trunk/post-state-tags.php

    r1946967 r2034214  
    716716        {
    717717
    718             $color = $this->get_option( $status['option_handle'] , $section , $this->colors[$status['name']] );
     718            $defcolor = array_key_exists($status['name'], $this->colors) ? $this->colors[$status['name']] :  '';
     719            $color = $this->get_option( $status['option_handle'] , $section , $defcolor );
    719720        $css .= $this->color_builder($status['name'], $color);
    720721
    721             $icon = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     722            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     723            $icon = $this->get_option( $status['option_handle'] . $this->icon, $section,  $deficon);
    722724        $css .= $this->tag_builder($status['name'], $color, $icon);
    723725
     
    729731        foreach ($special as $status)
    730732        {
    731             $color = $this->get_option( $status['option_handle'] , $section , $this->colors[$status['name']] );
     733            $defcolor = array_key_exists($status['name'], $this->colors) ? $this->colors[$status['name']] :  '';
     734            $color = $this->get_option( $status['option_handle'] , $section , $defcolor );
    732735        $css .= $this->color_builder($status['name'], $color);
    733736
    734             $icon = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     737            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     738            $icon = $this->get_option( $status['option_handle'] . $this->icon, $section,  $deficon);
    735739        $css .= $this->tag_builder($status['name'], $color, $icon);
    736740        }
     
    743747            foreach ($custom as $status)
    744748            {
    745                 $color = $this->get_option( $status['option_handle'] , $section , $this->colors[$status['name']] );
     749                $defcolor = array_key_exists($status['name'], $this->colors) ? $this->colors[$status['name']] :  '';
     750                $color = $this->get_option( $status['option_handle'] , $section , $defcolor );
    746751            $css .= $this->color_builder($status['name'], $color);
    747752   
    748                 $icon = $this->get_option( $status['option_handle'] . $this->icon, $section, $this->icons[$status['name']] );
     753                $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     754                $icon = $this->get_option( $status['option_handle'] . $this->icon, $section,  $deficon);
    749755            $css .= $this->tag_builder($status['name'], $color, $icon);
    750756            }
     
    827833        foreach ($default as $status)
    828834        {
    829             $icon_list[ $status['option_handle'] . $this->icon ] = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );   
     835            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     836            $icon_list[ $status['option_handle'] . $this->icon ] = $this->get_option( $status['option_handle'] . $this->icon, $section, $deficon );
    830837        }
    831838
     
    835842        foreach ($special as $status)
    836843        {
    837             $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     844            $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     845            $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section, $deficon );
    838846        }
    839847
     
    845853            foreach ($custom as $status)
    846854            {
    847                 $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section , $this->icons[$status['name']] );
     855                $deficon = array_key_exists($status['name'], $this->icons) ? $this->icons[$status['name']] :  '';
     856                $icon_list[ $status['option_handle'] . $this->icon] = $this->get_option( $status['option_handle'] . $this->icon, $section, $deficon );
    848857            }
    849858        }
     
    859868            return $post_states;
    860869   
     870//debug
     871//print_r($post_states);
     872
     873
    861874        if ( !empty($post_states) ) {
    862875           
  • post-state-tags/trunk/readme.txt

    r1946963 r2034214  
    44Tags: wp-admin, admin, post state, color, post colours, list, highlight
    55Requires at least: 3.8
    6 Tested up to: 4.9.8
    7 Stable tag: 2.0.3
     6Tested up to: 5.0.3
     7Stable tag: 2.0.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9898== Changelog ==
    9999
     100= 2.0.4 =
     101* Fix check index values for icons and color with special custom statuses like WooCommerce
     102
    100103= 2.0.3 =
    101104* Replaced create_function in Settings API library with anonymous function
Note: See TracChangeset for help on using the changeset viewer.