Plugin Directory

Changeset 1260186


Ignore:
Timestamp:
10/06/2015 06:57:13 AM (10 years ago)
Author:
vidya_l
Message:

fixed error in admin menu area

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-page-title-with-icon/trunk/admin/functions.php

    r1257112 r1260186  
    7373
    7474/* Ouputs icon in Front End with page/post title*/
     75if(!is_admin())
    7576add_filter('the_title', 'display_pagetitle_icon');
     77
    7678function display_pagetitle_icon($title){
    77     global $post;
    78     /* get values from post meta*/
    79     $value = get_post_meta( $post->ID, '_wpptwi_icon', true );
    80     $icon_color = get_post_meta( $post->ID, '_wpptwi_icon_color', true );
    81     $icon_size = get_post_meta( $post->ID, '_wpptwi_icon_size', true );
     79        global $post;
     80        /* get values from post meta*/
     81        $value = get_post_meta( $post->ID, '_wpptwi_icon', true );
     82        $icon_color = get_post_meta( $post->ID, '_wpptwi_icon_color', true );
     83        $icon_size = get_post_meta( $post->ID, '_wpptwi_icon_size', true );
    8284
    83     /* escapes html entities*/
    84     $icon = esc_attr( $value );
    85     $icon_color = esc_attr( $icon_color );
    86     $icon_size = esc_attr( $icon_size );
     85        /* escapes html entities*/
     86        $icon = esc_attr( $value );
     87        $icon_color = esc_attr( $icon_color );
     88        $icon_size = esc_attr( $icon_size );
    8789
    88     /* checks if the icon is empty, title is in the loop*/ 
    89     if(!empty($icon) && in_the_loop()){
     90        /* checks if the icon is empty, title is in the loop*/ 
     91        if(!empty($icon) && in_the_loop()){
    9092
    91         /* check if this is the current page */
    92         if( is_page($post->ID) && $title == $post->post_title  )
     93            /* check if this is the current page */
     94            if( is_page($post->ID) && $title == $post->post_title  )
    9395
    94             return '<i class="fa '.$icon.'" style="color:'.$icon_color.'; font-size:'.$icon_size.'px"></i>  '.$title;
     96                return '<i class="fa '.$icon.'" style="color:'.$icon_color.'; font-size:'.$icon_size.'px"></i>  '.$title;
    9597
    96         /* check if this is the current post */
    97         else if( is_single($post->ID) && $title == $post->post_title  ){
     98            /* check if this is the current post */
     99            else if( is_single($post->ID) && $title == $post->post_title  ){
    98100
    99             return '<i class="fa '.$icon.'" style="color:'.$icon_color.'; font-size:'.$icon_size.'px"></i>  '.$title;
     101                return '<i class="fa '.$icon.'" style="color:'.$icon_color.'; font-size:'.$icon_size.'px"></i>  '.$title;
     102            }
     103
     104            /* else return title */
     105            else{
     106                return $title; 
     107            }
    100108        }
    101 
    102         /* else return title */
    103109        else{
    104110            return $title; 
    105111        }
    106     }
    107     else{
    108         return $title; 
    109     }
    110112   
    111113}
Note: See TracChangeset for help on using the changeset viewer.