[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

These functions are needed to load WordPress.

File Size: 2018 lines (56 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 18 files
 wp-includes/class-wp-textdomain-registry.php
 wp-includes/l10n.php
 wp-includes/class-wp-locale.php
 wp-includes/pomo/mo.php
 wp-includes/l10n/class-wp-translation-file-php.php
 wp-includes/class-wpdb.php
 wp-includes/kses.php
 wp-includes/l10n/class-wp-translation-file.php
 wp-includes/l10n/class-wp-translation-file-mo.php
 wp-includes/version.php
 wp-includes/pluggable.php
 wp-includes/cache.php
 wp-includes/l10n/class-wp-translations.php
 wp-includes/class-wp-locale-switcher.php
 wp-includes/plugin.php
 wp-includes/l10n/class-wp-translation-controller.php
 wp-includes/functions.php
 wp-includes/cache-compat.php

Defines 58 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_get_development_mode()
  wp_is_development_mode()
  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_login()
  is_admin()
  is_blog_admin()
  is_network_admin()
  is_user_admin()
  is_multisite()
  absint()
  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
Returns the HTTP protocol sent by the server.

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

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


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.


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

Dies if requirements are not met.


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'.

return: string The current environment type.

wp_get_development_mode()   X-Ref
Retrieves the current development mode.

The development mode affects how certain parts of the WordPress application behave,
which is relevant when developing for WordPress.

Development mode can be set via the `WP_DEVELOPMENT_MODE` constant in `wp-config.php`.
Possible values are 'core', 'plugin', 'theme', 'all', or an empty string to disable
development mode. 'all' is a special value to signify that all three development modes
('core', 'plugin', and 'theme') are enabled.

Development mode is considered separately from `WP_DEBUG` and wp_get_environment_type().
It does not affect debugging output, but rather functional nuances in WordPress.

This function retrieves the currently set development mode value. To check whether
a specific development mode is enabled, use wp_is_development_mode().

return: string The current development mode.

wp_is_development_mode( $mode )   X-Ref
Checks whether the site is in the given development mode.

return: bool True if the given mode is covered by the current development mode, false otherwise.
param: string $mode Development mode to check for. Either 'core', 'plugin', 'theme', or 'all'.

wp_favicon_request()   X-Ref
Ensures all of WordPress is not loaded when handling a favicon.ico request.

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


wp_maintenance()   X-Ref
Dies 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).


wp_is_maintenance_mode()   X-Ref
Checks 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.

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

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

return: float Seconds since the PHP script started.

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

return: bool Always returns true.

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

return: string The "second.microsecond" finished time calculation. The number is formatted
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.

wp_debug_mode()   X-Ref
Sets 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.


wp_set_lang_dir()   X-Ref
Sets 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`.


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


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

Columns not listed here default to `%s`.


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

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

wp_start_object_cache()   X-Ref
Starts 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.


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

Dies with an error message when Multisite is enabled.


wp_get_mu_plugins()   X-Ref
Retrieves 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.

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

wp_get_active_and_valid_plugins()   X-Ref
Retrieves 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`.

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.

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

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.

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.

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

wp_is_recovery_mode()   X-Ref
Determines whether WordPress is in Recovery Mode.

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

return: bool

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

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.

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

wp_set_internal_encoding()   X-Ref
Sets 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.


wp_magic_quotes()   X-Ref
Adds 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.


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


wp_clone( $input_object )   X-Ref
Clones an object.

return: object The cloned object.
param: object $input_object The object to clone.

is_login()   X-Ref
Determines whether the current request is for the login screen.

return: bool True if inside WordPress login screen, false otherwise.

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.

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

is_blog_admin()   X-Ref
Determines 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.

return: bool True if inside WordPress site administration pages.

is_network_admin()   X-Ref
Determines 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.

return: bool True if inside WordPress network administration pages.

is_user_admin()   X-Ref
Determines 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.

return: bool True if inside WordPress user administration pages.

is_multisite()   X-Ref
Determines whether Multisite is enabled.

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

absint( $maybeint )   X-Ref
Converts a value to non-negative integer.

return: int A non-negative integer.
param: mixed $maybeint Data you wish to have converted to a non-negative integer.

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

return: int Site ID.

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

return: int The ID of the current network.

wp_load_translations_early()   X-Ref
Attempts 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.


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

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

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

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

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.

return: int An integer byte value.
param: string $value A (PHP ini) byte value, either shorthand or ordinary.

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

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

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

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.

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.

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.

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

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

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

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


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

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.

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.

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.

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

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

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.

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



Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref