Title: Ignoring second parameter get_the_date
Last modified: August 21, 2016

---

# Ignoring second parameter get_the_date

 *  [tblancog](https://wordpress.org/support/users/tblancog/)
 * (@tblancog)
 * [12 years ago](https://wordpress.org/support/topic/ignoring-second-parameter-get_the_date/)
 * Hello there Alessandro,
 * It seems that get_the_date function (frontend.php line 1012) was not taking the
   second parameter $d, causing me some trouble cause it showed me full format date
   like this: “22 ABRIL, 2014” when php’s date function was passing date(“J”). I
   just had to add this line to get it fixed, this works for me right now:
 * if(!empty($d)) $format = $d;
 * Just to let you know that this might be a bug.
 * [https://wordpress.org/plugins/ceceppa-multilingua/](https://wordpress.org/plugins/ceceppa-multilingua/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [12 years ago](https://wordpress.org/support/topic/ignoring-second-parameter-get_the_date/#post-4997221)
 * Thanks for report, just to be sure that next update will not break your website…
   Can you check if the file frontend.php contained in the zip works for you?
 * [http://www.alessandrosenese.eu/wp-content/uploads/2014/06/frontend.php_.zip](http://www.alessandrosenese.eu/wp-content/uploads/2014/06/frontend.php_.zip)
 *  Thread Starter [tblancog](https://wordpress.org/support/users/tblancog/)
 * (@tblancog)
 * [12 years ago](https://wordpress.org/support/topic/ignoring-second-parameter-get_the_date/#post-4997239)
 * Sorry, it didn’t work. It seems that $format is not empty in the function:
    function
   get_the_date( $the_date, $d ) { global $post;
 *  $format = CMLLanguage::get_current()->cml_date_format;
    if( empty( $format )){
   if( ! empty( $d ) ) $format = $d; else $format = CMLUtils::get_date_format();}
 *  $the_date = mysql2date( $format, $post->post_date );
 *  return $the_date;
    }
 * I vardumped $format and it showed: STRING(6) “J F, Y”.
    You can see how the dates
   behaves here: [http://dev.softclear.net/dev2/es/blog/](http://dev.softclear.net/dev2/es/blog/)
 *  Thread Starter [tblancog](https://wordpress.org/support/users/tblancog/)
 * (@tblancog)
 * [12 years ago](https://wordpress.org/support/topic/ignoring-second-parameter-get_the_date/#post-4997349)
 * With your approach i had to change your code with this:
 *     ```
       if( empty( $format ) ) {
           $format = CMLUtils::get_date_format();
       }else{
           if( !empty( $d ) )
               $format = $d;
       }
       ```
   
 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [12 years ago](https://wordpress.org/support/topic/ignoring-second-parameter-get_the_date/#post-4997432)
 * Ok, changed 🙂
    Thanks 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Ignoring second parameter get_the_date’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ceceppa-multilingua_4faedb.svg)
 * [Ceceppa Multilingua](https://wordpress.org/plugins/ceceppa-multilingua/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ceceppa-multilingua/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ceceppa-multilingua/)
 * [Active Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ceceppa-multilingua/reviews/)

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [format](https://wordpress.org/support/topic-tag/format/)
 * [get_the_date](https://wordpress.org/support/topic-tag/get_the_date/)

 * 4 replies
 * 2 participants
 * Last reply from: [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/ignoring-second-parameter-get_the_date/#post-4997432)
 * Status: not resolved