[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> load.php (summary)

These functions are needed to load WordPress.

File Size: 1781 lines (50 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 12 files
 wp-includes/functions.php
 wp-includes/wp-db.php
 wp-includes/class-wp-locale-switcher.php
 wp-includes/cache-compat.php
 wp-includes/plugin.php
 wp-includes/pomo/mo.php
 wp-includes/version.php
 wp-includes/cache.php
 wp-includes/class-wp-locale.php
 wp-includes/kses.php
 wp-includes/pluggable.php
 wp-includes/l10n.php

Defines 54 functions

  wp_get_server_protocol()
  wp_fix_server_vars()
  wp_populate_basic_auth_from_authorization_header()
  wp_check_php_mysql_versions()
  wp_get_environment_type()
  wp_favicon_request()
  wp_maintenance()
  wp_is_maintenance_mode()
  timer_float()
  timer_start()
  timer_stop()
  wp_debug_mode()
  wp_set_lang_dir()
  require_wp_db()
  wp_set_wpdb_vars()
  wp_using_ext_object_cache()
  wp_start_object_cache()
  wp_not_installed()
  wp_get_mu_plugins()
  wp_get_active_and_valid_plugins()
  wp_skip_paused_plugins()
  wp_get_active_and_valid_themes()
  wp_skip_paused_themes()
  wp_is_recovery_mode()
  is_protected_endpoint()
  is_protected_ajax_action()
  wp_set_internal_encoding()
  wp_magic_quotes()
  shutdown_action_hook()
  wp_clone()
  is_admin()
  is_blog_admin()
  is_network_admin()
  is_user_admin()
  is_multisite()
  get_current_blog_id()
  get_current_network_id()
  wp_load_translations_early()
  wp_installing()
  is_ssl()
  wp_convert_hr_to_bytes()
  wp_is_ini_value_changeable()
  wp_doing_ajax()
  wp_using_themes()
  wp_doing_cron()
  is_wp_error()
  wp_is_file_mod_allowed()
  wp_start_scraping_edited_file_errors()
  wp_finalize_scraping_edited_file_errors()
  wp_is_json_request()
  wp_is_jsonp_request()
  wp_is_json_media_type()
  wp_is_xml_request()
  wp_is_site_protected_by_basic_auth()

Functions
Functions that are not part of a class:

wp_get_server_protocol()   X-Ref
Return the HTTP protocol sent by the server.

since: 4.4.0
return: string The HTTP protocol. Default: HTTP/1.0.

wp_fix_server_vars()   X-Ref
Fix `$_SERVER` variables for various setups.

since: 3.0.0

wp_populate_basic_auth_from_authorization_header()   X-Ref
Populates the Basic Auth server details from the Authorization header.

Some servers running in CGI or FastCGI mode don't pass the Authorization
header on to WordPress.  If it's been rewritten to the `HTTP_AUTHORIZATION` header,
fill in the proper $_SERVER variables instead.

since: 5.6.0

wp_check_php_mysql_versions()   X-Ref
Check for the required PHP version, and the MySQL extension or
a database drop-in.

Dies if requirements are not met.

since: 3.0.0

wp_get_environment_type()   X-Ref
Retrieves the current environment type.

The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable,
or a constant of the same name.

Possible values are 'local', 'development', 'staging', and 'production'.
If not set, the type defaults to 'production'.

since: 5.5.0
since: 5.5.1 Added the 'local' type.
since: 5.5.1 Removed the ability to alter the list of types.
return: string The current environment type.

wp_favicon_request()   X-Ref
Don't load all of WordPress when handling a favicon.ico request.

Instead, send the headers for a zero-length favicon and bail.

since: 3.0.0

wp_maintenance()   X-Ref
Die with a maintenance message when conditions are met.

The default message can be replaced by using a drop-in (maintenance.php in
the wp-content directory).

since: 3.0.0

wp_is_maintenance_mode()   X-Ref
Check if maintenance mode is enabled.

Checks for a file in the WordPress root directory named ".maintenance".
This file will contain the variable $upgrading, set to the time the file
was created. If the file was created less than 10 minutes ago, WordPress
is in maintenance mode.

since: 5.5.0
return: bool True if maintenance mode is enabled, false otherwise.

timer_float()   X-Ref
Get the time elapsed so far during this PHP script.

Uses REQUEST_TIME_FLOAT that appeared in PHP 5.4.0.

since: 5.8.0
return: float Seconds since the PHP script started.

timer_start()   X-Ref
Start the WordPress micro-timer.

since: 0.71
return: bool Always returns true.

timer_stop( $display = 0, $precision = 3 )   X-Ref
Retrieve or display the time from the page start to when function is called.

since: 0.71
param: int|bool $display   Whether to echo or return the results. Accepts 0|false for return,
param: int      $precision The number of digits from the right of the decimal to display.
return: string The "second.microsecond" finished time calculation. The number is formatted

wp_debug_mode()   X-Ref
Set PHP error reporting based on WordPress debug settings.

Uses three constants: `WP_DEBUG`, `WP_DEBUG_DISPLAY`, and `WP_DEBUG_LOG`.
All three can be defined in wp-config.php. By default, `WP_DEBUG` and
`WP_DEBUG_LOG` are set to false, and `WP_DEBUG_DISPLAY` is set to true.

When `WP_DEBUG` is true, all PHP notices are reported. WordPress will also
display internal notices: when a deprecated WordPress function, function
argument, or file is used. Deprecated code may be removed from a later
version.

It is strongly recommended that plugin and theme developers use `WP_DEBUG`
in their development environments.

`WP_DEBUG_DISPLAY` and `WP_DEBUG_LOG` perform no function unless `WP_DEBUG`
is true.

When `WP_DEBUG_DISPLAY` is true, WordPress will force errors to be displayed.
`WP_DEBUG_DISPLAY` defaults to true. Defining it as null prevents WordPress
from changing the global configuration setting. Defining `WP_DEBUG_DISPLAY`
as false will force errors to be hidden.

When `WP_DEBUG_LOG` is true, errors will be logged to `wp-content/debug.log`.
When `WP_DEBUG_LOG` is a valid path, errors will be logged to the specified file.

Errors are never displayed for XML-RPC, REST, `ms-files.php`, and Ajax requests.

since: 3.0.0
since: 5.1.0 `WP_DEBUG_LOG` can be a file path.

wp_set_lang_dir()   X-Ref
Set the location of the language directory.

To set directory manually, define the `WP_LANG_DIR` constant
in wp-config.php.

If the language directory exists within `WP_CONTENT_DIR`, it
is used. Otherwise the language directory is assumed to live
in `WPINC`.

since: 3.0.0

require_wp_db()   X-Ref
Load the database class file and instantiate the `$wpdb` global.

since: 2.5.0

wp_set_wpdb_vars()   X-Ref
Set the database table prefix and the format specifiers for database
table columns.

Columns not listed here default to `%s`.

since: 3.0.0

wp_using_ext_object_cache( $using = null )   X-Ref
Toggle `$_wp_using_ext_object_cache` on and off without directly
touching global.

since: 3.7.0
param: bool $using Whether external object cache is being used.
return: bool The current 'using' setting.

wp_start_object_cache()   X-Ref
Start the WordPress object cache.

If an object-cache.php file exists in the wp-content directory,
it uses that drop-in as an external object cache.

since: 3.0.0

wp_not_installed()   X-Ref
Redirect to the installer if WordPress is not installed.

Dies with an error message when Multisite is enabled.

since: 3.0.0

wp_get_mu_plugins()   X-Ref
Retrieve an array of must-use plugin files.

The default directory is wp-content/mu-plugins. To change the default
directory manually, define `WPMU_PLUGIN_DIR` and `WPMU_PLUGIN_URL`
in wp-config.php.

since: 3.0.0
return: string[] Array of absolute paths of files to include.

wp_get_active_and_valid_plugins()   X-Ref
Retrieve an array of active and valid plugin files.

While upgrading or installing WordPress, no plugins are returned.

The default directory is `wp-content/plugins`. To change the default
directory manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL`
in `wp-config.php`.

since: 3.0.0
return: string[] Array of paths to plugin files relative to the plugins directory.

wp_skip_paused_plugins( array $plugins )   X-Ref
Filters a given list of plugins, removing any paused plugins from it.

since: 5.2.0
param: string[] $plugins Array of absolute plugin main file paths.
return: string[] Filtered array of plugins, without any paused plugins.

wp_get_active_and_valid_themes()   X-Ref
Retrieves an array of active and valid themes.

While upgrading or installing WordPress, no themes are returned.

since: 5.1.0
return: string[] Array of absolute paths to theme directories.

wp_skip_paused_themes( array $themes )   X-Ref
Filters a given list of themes, removing any paused themes from it.

since: 5.2.0
param: string[] $themes Array of absolute theme directory paths.
return: string[] Filtered array of absolute paths to themes, without any paused themes.

wp_is_recovery_mode()   X-Ref
Is WordPress in Recovery Mode.

In this mode, plugins or themes that cause WSODs will be paused.

since: 5.2.0
return: bool

is_protected_endpoint()   X-Ref
Determines whether we are currently on an endpoint that should be protected against WSODs.

since: 5.2.0
return: bool True if the current endpoint should be protected.

is_protected_ajax_action()   X-Ref
Determines whether we are currently handling an Ajax action that should be protected against WSODs.

since: 5.2.0
return: bool True if the current Ajax action should be protected.

wp_set_internal_encoding()   X-Ref
Set internal encoding.

In most cases the default internal encoding is latin1, which is
of no use, since we want to use the `mb_` functions for `utf-8` strings.

since: 3.0.0

wp_magic_quotes()   X-Ref
Add magic quotes to `$_GET`, `$_POST`, `$_COOKIE`, and `$_SERVER`.

Also forces `$_REQUEST` to be `$_GET + $_POST`. If `$_SERVER`,
`$_COOKIE`, or `$_ENV` are needed, use those superglobals directly.

since: 3.0.0

shutdown_action_hook()   X-Ref
Runs just before PHP shuts down execution.

since: 1.2.0

wp_clone( $object )   X-Ref
Copy an object.

since: 2.7.0
param: object $object The object to clone.
return: object The cloned object.

is_admin()   X-Ref
Determines whether the current request is for an administrative interface page.

Does not check if the user is an administrator; use current_user_can()
for checking roles and capabilities.

For more information on this and similar theme functions, check out
the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
Conditional Tags} article in the Theme Developer Handbook.

since: 1.5.1
return: bool True if inside WordPress administration interface, false otherwise.

is_blog_admin()   X-Ref
Whether the current request is for a site's administrative interface.

e.g. `/wp-admin/`

Does not check if the user is an administrator; use current_user_can()
for checking roles and capabilities.

since: 3.1.0
return: bool True if inside WordPress blog administration pages.

is_network_admin()   X-Ref
Whether the current request is for the network administrative interface.

e.g. `/wp-admin/network/`

Does not check if the user is an administrator; use current_user_can()
for checking roles and capabilities.

Does not check if the site is a Multisite network; use is_multisite()
for checking if Multisite is enabled.

since: 3.1.0
return: bool True if inside WordPress network administration pages.

is_user_admin()   X-Ref
Whether the current request is for a user admin screen.

e.g. `/wp-admin/user/`

Does not check if the user is an administrator; use current_user_can()
for checking roles and capabilities.

since: 3.1.0
return: bool True if inside WordPress user administration pages.

is_multisite()   X-Ref
If Multisite is enabled.

since: 3.0.0
return: bool True if Multisite is enabled, false otherwise.

get_current_blog_id()   X-Ref
Retrieve the current site ID.

since: 3.1.0
return: int Site ID.

get_current_network_id()   X-Ref
Retrieves the current network ID.

since: 4.6.0
return: int The ID of the current network.

wp_load_translations_early()   X-Ref
Attempt an early load of translations.

Used for errors encountered during the initial loading process, before
the locale has been properly detected and loaded.

Designed for unusual load sequences (like setup-config.php) or for when
the script will then terminate with an error, otherwise there is a risk
that a file can be double-included.

since: 3.4.0

wp_installing( $is_installing = null )   X-Ref
Check or set whether WordPress is in "installation" mode.

If the `WP_INSTALLING` constant is defined during the bootstrap, `wp_installing()` will default to `true`.

since: 4.4.0
param: bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off.
return: bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will

is_ssl()   X-Ref
Determines if SSL is used.

since: 2.6.0
since: 4.6.0 Moved from functions.php to load.php.
return: bool True if SSL, otherwise false.

wp_convert_hr_to_bytes( $value )   X-Ref
Converts a shorthand byte value to an integer byte value.

since: 2.3.0
since: 4.6.0 Moved from media.php to load.php.
param: string $value A (PHP ini) byte value, either shorthand or ordinary.
return: int An integer byte value.

wp_is_ini_value_changeable( $setting )   X-Ref
Determines whether a PHP ini value is changeable at runtime.

since: 4.6.0
param: string $setting The name of the ini setting to check.
return: bool True if the value is changeable at runtime. False otherwise.

wp_doing_ajax()   X-Ref
Determines whether the current request is a WordPress Ajax request.

since: 4.7.0
return: bool True if it's a WordPress Ajax request, false otherwise.

wp_using_themes()   X-Ref
Determines whether the current request should use themes.

since: 5.1.0
return: bool True if themes should be used, false otherwise.

wp_doing_cron()   X-Ref
Determines whether the current request is a WordPress cron request.

since: 4.8.0
return: bool True if it's a WordPress cron request, false otherwise.

is_wp_error( $thing )   X-Ref
Checks whether the given variable is a WordPress Error.

Returns whether `$thing` is an instance of the `WP_Error` class.

since: 2.1.0
param: mixed $thing The variable to check.
return: bool Whether the variable is an instance of WP_Error.

wp_is_file_mod_allowed( $context )   X-Ref
Determines whether file modifications are allowed.

since: 4.8.0
param: string $context The usage context.
return: bool True if file modification is allowed, false otherwise.

wp_start_scraping_edited_file_errors()   X-Ref
Start scraping edited file errors.

since: 4.9.0

wp_finalize_scraping_edited_file_errors( $scrape_key )   X-Ref
Finalize scraping for edited file errors.

since: 4.9.0
param: string $scrape_key Scrape key.

wp_is_json_request()   X-Ref
Checks whether current request is a JSON request, or is expecting a JSON response.

since: 5.0.0
return: bool True if `Accepts` or `Content-Type` headers contain `application/json`.

wp_is_jsonp_request()   X-Ref
Checks whether current request is a JSONP request, or is expecting a JSONP response.

since: 5.2.0
return: bool True if JSONP request, false otherwise.

wp_is_json_media_type( $media_type )   X-Ref
Checks whether a string is a valid JSON Media Type.

since: 5.6.0
param: string $media_type A Media Type string to check.
return: bool True if string is a valid JSON Media Type.

wp_is_xml_request()   X-Ref
Checks whether current request is an XML request, or is expecting an XML response.

since: 5.2.0
return: bool True if `Accepts` or `Content-Type` headers contain `text/xml`

wp_is_site_protected_by_basic_auth( $context = '' )   X-Ref
Checks if this site is protected by HTTP Basic Auth.

At the moment, this merely checks for the present of Basic Auth credentials. Therefore, calling
this function with a context different from the current context may give inaccurate results.
In a future release, this evaluation may be made more robust.

Currently, this is only used by Application Passwords to prevent a conflict since it also utilizes
Basic Auth.

since: 5.6.1
param: string $context The context to check for protection. Accepts 'login', 'admin', and 'front'.
return: bool Whether the site is protected by Basic Auth.



Generated: Tue Nov 12 01:00:02 2024 Cross-referenced by PHPXref 0.7.1