Plugin Directory

Changeset 2247720


Ignore:
Timestamp:
02/20/2020 06:52:40 PM (6 years ago)
Author:
saroyaboy
Message:

Bug resolve for unknown ID field on non-id pages

Location:
color-your-bar
Files:
9 added
2 edited

Legend:

Unmodified
Added
Removed
  • color-your-bar/trunk/color-your-bar.php

    r2204720 r2247720  
    66 * Author: Darshan Saroya
    77 * Author URI: http://darshansaroya.com
    8  * Version: 1.3
     8 * Version: 1.4
    99 * Text Domain: color-your-bar
    1010 * Domain Path: languages
     
    2424 * @package Color Your Bar
    2525 * @author Darshan Saroya
    26  * @version 1.2
     26 * @version 1.4
    2727 */
    2828
     
    4343
    4444function cyb_add_head_tag(){
     45    $enable_cyb= get_option('cyb-switch');
     46    if($enable_cyb!='0'){
    4547    global $post;
    46     $cyb_post = get_post_type($post->ID);
    4748    $cyb_post_type = get_option( 'cyb-post-type');
    48     $enable_cyb= get_option('cyb-switch');
    49     $cyb_color= get_option('cyb-color');
    50     if(null !== $cyb_post_type && is_array($cyb_post_type)){
    51         foreach ($cyb_post_type as $post_type ) {
    52             if($cyb_post == $post_type){
     49    $cyb_color= get_option('cyb-color', esc_html('#ffffff'));
     50    if($post):
     51        $cyb_post = get_post_type($post->ID);
     52        if(null !== $cyb_post_type && is_array($cyb_post_type)){
     53            foreach ($cyb_post_type as $post_type ) {
    5354                $color = get_post_meta( $post->ID, 'cyb-color', true );
    54                 if(null !== $color){
     55                if($cyb_post == $post_type && $color !=''){
    5556                    $cyb_color = $color;
    5657                }
    5758            }
    5859        }
    59     }
    60     if($enable_cyb!='0'){ ?>
    61     <meta name="theme-color" content="<?php echo esc_html( $cyb_color ); ?>">
     60    endif; ?>
     61    <meta name="theme-color" content="<?php echo esc_attr( $cyb_color ); ?>">
    6262    <meta name="apple-mobile-web-app-capable" content="yes">
    6363    <meta name="apple-mobile-web-app-status-bar-style" content="black">
     
    101101           
    102102                // Add the submit button to serialize the options
    103                 submit_button();
    104                
     103                submit_button();
    105104            ?>         
    106105        </form>
  • color-your-bar/trunk/readme.txt

    r2204720 r2247720  
    4141== Changelog ==
    4242
    43 = 1.2 =
     43= 1.4 =
     44Bug fixes for non-id pages.
     45
     46= 1.3 =
    4447Compatibility to WordPress 5.3
    4548Meta Box Added: Now you can color every single page/post chrome bar.
Note: See TracChangeset for help on using the changeset viewer.