inject_ignored_hooked_blocks_metadata_attributes()wp-includes/block-template-utils.php | Inject ignoredHookedBlocks metadata attributes into a template or template part.
|
wp_resolve_post_date()wp-includes/post.php | Uses wp_checkdate to return a valid Gregorian-calendar value for post_date.
|
wp_insert_site()wp-includes/ms-site.php | Inserts a new site into the database.
|
wp_update_site()wp-includes/ms-site.php | Updates a site in the database.
|
wp_create_user_request()wp-includes/user.php | Creates and logs a user request to perform a specific action.
|
wp_privacy_generate_personal_data_export_file()wp-admin/includes/privacy-tools.php | Generate the personal data export file.
|
WP_Customize_Manager::save_changeset_post()wp-includes/class-wp-customize-manager.php | Saves the post for the loaded changeset.
|
WP_REST_Comments_Controller::create_item()wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Creates a comment.
|
_wp_upload_dir()wp-includes/functions.php | A non-filtered, non-cached version of wp_upload_dir() that doesn’t check the path.
|
WP_Customize_Manager::customize_pane_settings()wp-includes/class-wp-customize-manager.php | Prints JavaScript settings for parent window.
|
populate_network()wp-admin/includes/schema.php | Populate network settings.
|
wp_dashboard_recent_posts()wp-admin/includes/dashboard.php | Generates Publishing Soon and Recently Published sections.
|
wp_install_defaults()wp-admin/includes/upgrade.php | Creates the initial content for a newly-installed site.
|
touch_time()wp-admin/includes/template.php | Prints out HTML form date elements for editing post or comment publish date.
|
media_handle_upload()wp-admin/includes/media.php | Saves a file submitted from a POST request and create an attachment post for it.
|
media_handle_sideload()wp-admin/includes/media.php | Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload() .
|
bulk_edit_posts()wp-admin/includes/post.php | Processes the post data for the bulk editing of posts.
|
post_submit_meta_box()wp-admin/includes/meta-boxes.php | Displays post submit form fields.
|
get_calendar()wp-includes/general-template.php | Displays calendar with days that have posts as links.
|
WP_Query::get_posts()wp-includes/class-wp-query.php | Retrieves an array of posts based on query variables.
|
date_i18n()wp-includes/functions.php | Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds.
|
get_month_link()wp-includes/link-template.php | Retrieves the permalink for the month archives with year.
|
get_day_link()wp-includes/link-template.php | Retrieves the permalink for the day archives with year and month.
|
get_year_link()wp-includes/link-template.php | Retrieves the permalink for the year archives.
|
WP_Date_Query::build_mysql_datetime()wp-includes/class-wp-date-query.php | Builds a MySQL format date/time based on some query parameters.
|
wp_insert_post()wp-includes/post.php | Inserts or update a post.
|
wp_update_post()wp-includes/post.php | Updates a post with new post data.
|
wpmu_log_new_registrations()wp-includes/ms-functions.php | Logs the user email, IP, and registration date of a new site.
|
wpmu_activate_signup()wp-includes/ms-functions.php | Activates a signup.
|
wpmu_signup_blog()wp-includes/ms-functions.php | Records site signup information for future activation.
|
wpmu_signup_user()wp-includes/ms-functions.php | Records user signup information for future activation.
|
wpmu_update_blogs_date()wp-includes/ms-blogs.php | Updates the last_updated field for the current site.
|
wp_xmlrpc_server::blogger_newPost()wp-includes/class-wp-xmlrpc-server.php | Creates a new post.
|
wp_new_comment()wp-includes/comment.php | Adds a new comment to the database.
|
wp_insert_comment()wp-includes/comment.php | Inserts a comment into the database.
|
The Date/Time component will be updated in WordPress 5.3, and there are some things that people should be aware of:
https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/
From the post:
Not recommended
Don’t retrieve time as WP timestamp:
Don’t localize time based on WP timestamp:
Don’t store WP timestamps persistently;
Don’t compare WP timestamps.
——————-
Recommended
Retrieve time as Unix timestamp or
DateTimeImmutable
object:Localize time based on Unix timestamp:
Store Unix timestamps or formats that are precise moment in time, such as
DATE_RFC3339
;Compare Unix timestamps,
DateTimeInterface
objects, or string–comparable dates in same time zone.Examine the results
The code snippet gives an Warning with “split” function because
the function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0.
Alternatives to this function include:
preg_split()
On using preg_split(), we get the required output. Code snippet below:
$blogtime = current_time( 'mysql' );
list( $today_year, $today_month, $today_day, $hour, $minute, $second ) = preg_split( "([^0-9])", $blogtime );
echo $hour;
For reference:
http://php.net/manual/en/function.split.php
Since version 5.3, the code below is discouraged as it will not return a Unix (UTC) timestamp.
Here’s the alternative solution:
PHP date formats accepted for $type are defined at http://php.net/manual/en/function.date.php#refsect1-function.date-parameters
When working with time functions, you must use
current_time('timestamp')
NOTtime()
.current_time('timestamp')
return blog specific timestamp that is set under Settings->General.time()
return the time based ondate.timezone
setting from php.ini.Conclusion:
time() !== current_time('timestamp') // There is a big chance that they are not equal
Always use: current_time(‘timestamp’)
This example gets the current time and assigns the parameters to variables.
Example of format of
current_time( 'mysql' )
:2005-08-05 10:41:13