wp-includes/ms-site.php:
wp_insert_site()
|
Inserts a new site into the database.
|
wp-includes/ms-site.php:
wp_update_site()
|
Updates a site in the database.
|
wp-includes/user.php:
wp_create_user_request()
|
Create and log a user request to perform a specific action.
|
wp-admin/includes/privacy-tools.php:
wp_privacy_generate_personal_data_export_file()
|
Generate the personal data export file.
|
wp-admin/includes/class-wp-community-events.php:
WP_Community_Events::trim_events()
|
Prepares the event list for presentation.
|
wp-includes/class-wp-customize-manager.php:
WP_Customize_Manager::save_changeset_post()
|
Save the post for the loaded changeset.
|
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
WP_REST_Comments_Controller::create_item()
|
Creates a comment.
|
wp-includes/functions.php:
_wp_upload_dir()
|
A non-filtered, non-cached version of wp_upload_dir() that doesn’t check the path.
|
wp-includes/class-wp-customize-manager.php:
WP_Customize_Manager::customize_pane_settings()
|
Print JavaScript settings for parent window.
|
wp-admin/includes/schema.php:
populate_network()
|
Populate network settings.
|
wp-admin/includes/dashboard.php:
wp_dashboard_recent_posts()
|
Generates Publishing Soon and Recently Published sections.
|
wp-admin/includes/upgrade.php:
wp_install_defaults()
|
Creates the initial content for a newly-installed site.
|
wp-admin/includes/template.php:
touch_time()
|
Print out HTML form date elements for editing post or comment publish date.
|
wp-admin/includes/media.php:
media_handle_upload()
|
Save a file submitted from a POST request and create an attachment post for it.
|
wp-admin/includes/media.php:
media_handle_sideload()
|
Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().
|
wp-admin/includes/meta-boxes.php:
post_submit_meta_box()
|
Displays post submit form fields.
|
wp-includes/general-template.php:
get_calendar()
|
Display calendar with days that have posts as links.
|
wp-includes/class-wp-query.php:
WP_Query::get_posts()
|
Retrieves an array of posts based on query variables.
|
wp-includes/functions.php:
date_i18n()
|
Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds.
|
wp-includes/link-template.php:
get_month_link()
|
Retrieves the permalink for the month archives with year.
|
wp-includes/link-template.php:
get_day_link()
|
Retrieves the permalink for the day archives with year and month.
|
wp-includes/link-template.php:
get_year_link()
|
Retrieves the permalink for the year archives.
|
wp-includes/class-wp-date-query.php:
WP_Date_Query::build_mysql_datetime()
|
Builds a MySQL format date/time based on some query parameters.
|
wp-includes/post.php:
wp_insert_post()
|
Insert or update a post.
|
wp-includes/post.php:
wp_update_post()
|
Update a post with new post data.
|
wp-includes/ms-functions.php:
wpmu_log_new_registrations()
|
Logs the user email, IP, and registration date of a new site.
|
wp-includes/ms-functions.php:
wpmu_activate_signup()
|
Activate a signup.
|
wp-includes/ms-functions.php:
wpmu_signup_blog()
|
Record site signup information for future activation.
|
wp-includes/ms-functions.php:
wpmu_signup_user()
|
Record user signup information for future activation.
|
wp-includes/ms-blogs.php:
wpmu_update_blogs_date()
|
Update the last_updated field for the current site.
|
wp-includes/class-wp-xmlrpc-server.php:
wp_xmlrpc_server::blogger_newPost()
|
Creates new post.
|
wp-includes/comment.php:
wp_new_comment()
|
Adds a new comment to the database.
|
wp-includes/comment.php:
wp_insert_comment()
|
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
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