Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

No more get_option(‘date_time’) in WordPress 5.5?

Okay I found the issue, it’s like I thought. The problem is that get_option( 'date_time' ) return just false.

The change happened in the funtion get_the_date().

In WordPress 5.4 is looked like that in the general-template.php:

function get_the_date( $format="", $post = null ) {
    $post = get_post( $post );

    if ( ! $post ) {
        return false;
    }

    if ( '' == $format ) {
        $the_date = get_post_time( get_option( 'date_format' ), false, $post, true );
    } else {
        $the_date = get_post_time( $format, false, $post, true );
    }


    return apply_filters( 'get_the_date', $the_date, $format, $post );
}

Since WordPress 5.5 the general-template.php looks like that:

function get_the_date( $format="", $post = null ) {
    $post = get_post( $post );

    if ( ! $post ) {
        return false;
    }

    if ( '' === $format ) {
        $the_date = get_post_time( get_option( 'date_format' ), false, $post, true );
    } else {
        $the_date = get_post_time( $format, false, $post, true );
    }

    return apply_filters( 'get_the_date', $the_date, $format, $post );
}

The difference is just in the type true comparison operators

// WordPress 5.4
if ( '' == $format )

// vs

// WordPress 5.5
if ( '' === $format )

Bugfix?!

I think the correct solution would be to check for and empty or false $format. Something like that:

if ( '' === $format || false === $format )

Related Posts:

  1. How to get WordPress Time Zone setting?
  2. How to update custom fields using the wp_insert_post() function?
  3. Converting timestamps to local time with date_l18n()
  4. Limit the number of inactive widgets
  5. Custom plugin: Trying to show saved data on frontend
  6. Get meta_id along with meta_key and meta_value
  7. PHP function showing wrong time in WordPress
  8. Remove/unset options field from backend Settings->General?
  9. How can merge two arrays values in one array and save in database
  10. Site Title and Tagline in Theme Options Page
  11. Check if user already visited this post today
  12. Display all meta for a post?
  13. Editor role cannot save custom theme options
  14. How to get year, month and hour in WordPress?
  15. How to display multiple Post meta_key/meta_values by SQL query
  16. the_post_thumbnail() based on the Post ID
  17. WordPress customizer: load controls in a custom div
  18. How to use multiple query with same meta key
  19. How to update single value in multi dimensional Post Meta?
  20. Site Title and Tagline in Pagelines DMS Options Panel
  21. Enqueue Javascript Correctly for 3.5
  22. Why does this echo values in the wrong order?
  23. Why is my get_post_meta always empty
  24. Compare two meta key values against each other inside the get_posts array?
  25. WordPress returns a wrong date
  26. How can update custom meta for all posts
  27. How to check for WordPress timezone type?
  28. Passing array in add_option()
  29. Implement a multi-value input field where the number of entries is not limited
  30. Select dropdown not showing selected value php
  31. Unable to set right time in admin and frontend template
  32. Use ajax to update_post_meta
  33. How do I output a database option that is an array into a get_posts array?
  34. Delete option value from array using update_option()
  35. Convert a date to ISO8601 date format
  36. How to get bool with `get_option()` when already registered setting with type `boolean`
  37. is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
  38. wrong php date()?
  39. how to increase custom post value by one most efficiently?
  40. Batch update a post meta field value of each post in Post Type
  41. How to Display Image Meta underneath EVERY image in EVERY post
  42. Settings API – sanitize_callback is not called and it leads to an incorrect behavior
  43. Change description on specific WooCommerce product status change
  44. Store and Work with huge array in WP [closed]
  45. Use WP_Query in shortcode
  46. SQL QUERY – Select a value directly from the database
  47. Get Current User Id Inside a Loop Returns 0 For a Shortcode
  48. display month in french in wordpress/php?
  49. Random order of WP_Query results with highest meta value
  50. Adding Default Settings to Theme My Login plugin
  51. How to add values to media “whitelist_options” in wp-admin/options.php template?
  52. Displaying the Month and Year that a page was Created?
  53. The text box have space character
  54. how to remove metadata from the posts of my blog?
  55. How can I create a list of page titles from custom meta values?
  56. Trying to remove post thumbnail with plugin
  57. Randomly Assign an Image’s Alt Text Based on Data From Post
  58. Get date numerical and separate?
  59. Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
  60. Ajax – Call to undefined function get_option()
  61. Multiple options not staying selected after saving
  62. Sort custom meta column by other meta value
  63. Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
  64. How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
  65. Creating user status mode in WordPress
  66. Need help with Google drive API [closed]
  67. Whitelisting items from custom options page
  68. Print last modified date only on posts
  69. Options API get_option() and update_option() Not Correctly Updating or Returning
  70. Setting default category base on theme activation
  71. Archive post by meta value + 24hours
  72. WordPress update_post_meta updating with empty meta_value field [closed]
  73. Error: options page not found
  74. How to store options in an array
  75. how to update and display an option without reloading the page
  76. Saving plugin settings – ERROR: options page not found
  77. Security for data obtained from the database
  78. Is it possible to retrieve all posts with a certain value for metadata?
  79. Get post id within comments loop
  80. Pull GetOption() variable into jQuery dynamically created html
  81. Filtering a Database Query
  82. Time & Date on Post – Time Ago Custom Function
  83. Non-Closing PHP Query in WordPress Loop
  84. Find hours between post_date and post_date_gmt
  85. 3 different times on my WordPress website
  86. Is a series of update_option calls safe, performance wise?
  87. wp-options keep crashing please help
  88. Querying Database with wpdb
  89. WP_OPTIONS table, active_plugins entry [closed]
  90. Warning: Illegal string offset on theme options page [closed]
  91. update_post_meta only updating on last loop of foreach
  92. Link blogname and blogdescription to the Options Framework
  93. retain querystring values when savincustom options in admin
  94. how to get serialized post meta
  95. How to use two meta_compare in an array?
  96. How to get User Time Zone in WordPress?
  97. Check If Post Was Published More Than 6 Months Ago Using get_the_date
  98. How to Change CSS Colors from Custom Plugin Settings Page
  99. How do I check or test a WordPress Auto Year Change Script?
  100. Decimal values via get_option() with custom local (decimal point = comma)
Categories PHP Tags date-time, options, php, post-meta
How to get a specific string from a url
Get /users/me details from WordPress backend

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress