Plugin Directory

Changeset 1162285


Ignore:
Timestamp:
05/17/2015 07:41:25 PM (11 years ago)
Author:
mva7
Message:

date was inserted in menu items as well, fixed now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • the-holiday-calendar/trunk/the-holiday-calendar.php

    r1162273 r1162285  
    3333add_action( 'wp_enqueue_scripts', array( 'the_holiday_calendar', 'load_css' ) );
    3434add_filter( 'body_class', array( 'the_holiday_calendar', 'add_body_classes') );
    35 add_filter( 'the_title', array( 'the_holiday_calendar', 'override_title') );
     35add_filter( 'the_title', array( 'the_holiday_calendar', 'override_title'), 10, 2 );
    3636//add_action( 'template_redirect', array( 'the_holiday_calendar', 'override_template') );
    3737//add_filter( 'the_content', array( 'the_holiday_calendar', 'override_content') );
     
    174174    }
    175175   
    176     function override_title($title) {
     176    function override_title($title, $id) { 
     177        global $post;
    177178        if(get_post_type() == thc_constants::POSTTYPE)
    178179        {
     
    186187                    $title = $title . ' (' . self::get_requested_date() . ')';     
    187188                }
    188                 else if (thc_settings_helper::get_show_date_in_title() == 1 && is_single() && !request_helper::get_surpress_title_filter())
     189                else if (thc_settings_helper::get_show_date_in_title() == 1 && is_single() && !request_helper::get_surpress_title_filter() && $id == get_the_ID())
    189190                {
    190                     global $post;
    191191                   
    192192                    $event_date = get_post_meta( $post->ID, 'eventDate', true );
Note: See TracChangeset for help on using the changeset viewer.