$temp_backups */ public function restore_temp_backup(array $temp_backups = array()) { } /** * Deletes a temporary backup. * * @since 6.3.0 * @since 6.6.0 Added the `$temp_backups` parameter. * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param array[] $temp_backups { * Optional. An array of temporary backups. * * @type array ...$0 { * Information about the backup. * * @type string $dir The temporary backup location in the upgrade-temp-backup directory. * @type string $slug The item's slug. * @type string $src The directory where the original is stored. For example, `WP_PLUGIN_DIR`. * } * } * @return bool|WP_Error True on success, false on early exit, otherwise WP_Error. * @phpstan-param array $temp_backups */ public function delete_temp_backup(array $temp_backups = array()) { } } /** * Core class used for updating core. * * It allows for WordPress to upgrade itself in combination with * the wp-admin/includes/update-core.php file. * * Note: Newly introduced functions and methods cannot be used here. * All functions must be present in the previous version being upgraded from * as this file is used there too. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. * * @see WP_Upgrader */ class Core_Upgrader extends \WP_Upgrader { /** * Initializes the upgrade strings. * * @since 2.8.0 */ public function upgrade_strings() { } /** * Upgrades WordPress core. * * @since 2.8.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * @global callable $_wp_filesystem_direct_method * * @param object $current Response object for whether WordPress is current. * @param array $args { * Optional. Arguments for upgrading WordPress core. Default empty array. * * @type bool $pre_check_md5 Whether to check the file checksums before * attempting the upgrade. Default true. * @type bool $attempt_rollback Whether to attempt to rollback the chances if * there is a problem. Default false. * @type bool $do_rollback Whether to perform this "upgrade" as a rollback. * Default false. * } * @return string|false|WP_Error New WordPress version on success, false or WP_Error on failure. * @phpstan-param array{ * pre_check_md5?: bool, * attempt_rollback?: bool, * do_rollback?: bool, * } $args */ public function upgrade($current, $args = array()) { } /** * Determines if this WordPress Core version should update to an offered version or not. * * @since 3.7.0 * * @param string $offered_ver The offered version, of the format x.y.z. * @return bool True if we should update to the offered version, otherwise false. */ public static function should_update_to_version($offered_ver) { } /** * Compares the disk file checksums against the expected checksums. * * @since 3.7.0 * * @global string $wp_version The WordPress version string. * @global string $wp_local_package Locale code of the package. * * @return bool True if the checksums match, otherwise false. */ public function check_files() { } } /** * The custom background class. * * @since 3.0.0 */ #[\AllowDynamicProperties] class Custom_Background { /** * Callback for administration header. * * @since 3.0.0 * @var callable */ public $admin_header_callback; /** * Callback for header div. * * @since 3.0.0 * @var callable */ public $admin_image_div_callback; /** * Constructor - Registers administration header callback. * * @since 3.0.0 * * @param callable $admin_header_callback Optional. Administration header callback. * Default empty string. * @param callable $admin_image_div_callback Optional. Custom image div output callback. * Default empty string. */ public function __construct($admin_header_callback = '', $admin_image_div_callback = '') { } /** * Sets up the hooks for the Custom Background admin page. * * @since 3.0.0 * @phpstan-return void */ public function init() { } /** * Sets up the enqueue for the CSS & JavaScript files. * * @since 3.0.0 */ public function admin_load() { } /** * Executes custom background modification. * * @since 3.0.0 * @phpstan-return void */ public function take_action() { } /** * Displays the custom background page. * * @since 3.0.0 */ public function admin_page() { } /** * Handles an Image upload for the background image. * * @since 3.0.0 * @phpstan-return void */ public function handle_upload() { } /** * Handles Ajax request for adding custom background context to an attachment. * * Triggers when the user adds a new background image from the * Media Manager. * * @since 4.1.0 * @phpstan-return never */ public function ajax_background_add() { } /** * @since 3.4.0 * @deprecated 3.5.0 * * @param array $form_fields * @return array $form_fields */ public function attachment_fields_to_edit($form_fields) { } /** * @since 3.4.0 * @deprecated 3.5.0 * * @param array $tabs * @return array $tabs */ public function filter_upload_tabs($tabs) { } /** * @since 3.4.0 * @deprecated 3.5.0 * @phpstan-return never */ public function wp_set_background_image() { } } /** * The custom header image class. * * @since 2.1.0 */ #[\AllowDynamicProperties] class Custom_Image_Header { /** * Callback for administration header. * * @since 2.1.0 * @var callable */ public $admin_header_callback; /** * Callback for header div. * * @since 3.0.0 * @var callable */ public $admin_image_div_callback; /** * Holds default headers. * * @since 3.0.0 * @var array */ public $default_headers = array(); /** * Constructor - Registers administration header callback. * * @since 2.1.0 * * @param callable $admin_header_callback Administration header callback. * @param callable $admin_image_div_callback Optional. Custom image div output callback. * Default empty string. */ public function __construct($admin_header_callback, $admin_image_div_callback = '') { } /** * Sets up the hooks for the Custom Header admin page. * * @since 2.1.0 * @phpstan-return void */ public function init() { } /** * Adds contextual help. * * @since 3.0.0 */ public function help() { } /** * Gets the current step. * * @since 2.6.0 * * @return int Current step. */ public function step() { } /** * Sets up the enqueue for the JavaScript files. * * @since 2.1.0 */ public function js_includes() { } /** * Sets up the enqueue for the CSS files. * * @since 2.7.0 */ public function css_includes() { } /** * Executes custom header modification. * * @since 2.6.0 * @phpstan-return void */ public function take_action() { } /** * Processes the default headers. * * @since 3.0.0 * * @global array $_wp_default_headers * @phpstan-return void */ public function process_default_headers() { } /** * Displays UI for selecting one of several default headers. * * Shows the random image option if this theme has multiple header images. * Random image option is on by default if no header has been set. * * @since 3.0.0 * * @param string $type The header type. One of 'default' (for the Uploaded Images control) * or 'uploaded' (for the Uploaded Images control). * @phpstan-param 'default'|'uploaded' $type */ public function show_header_selector($type = 'default') { } /** * Executes JavaScript depending on step. * * @since 2.1.0 */ public function js() { } /** * Displays JavaScript based on Step 1 and 3. * * @since 2.6.0 */ public function js_1() { } /** * Displays JavaScript based on Step 2. * * @since 2.6.0 */ public function js_2() { } /** * Displays first step of custom header image page. * * @since 2.1.0 */ public function step_1() { } /** * Displays second step of custom header image page. * * @since 2.1.0 */ public function step_2() { } /** * Uploads the file to be cropped in the second step. * * @since 3.4.0 */ public function step_2_manage_upload() { } /** * Displays third step of custom header image page. * * @since 2.1.0 * @since 4.4.0 Switched to using wp_get_attachment_url() instead of the guid * for retrieving the header image URL. */ public function step_3() { } /** * Displays last step of custom header image page. * * @since 2.1.0 */ public function finished() { } /** * Displays the page based on the current step. * * @since 2.1.0 */ public function admin_page() { } /** * Unused since 3.5.0. * * @since 3.4.0 * * @param array $form_fields * @return array $form_fields */ public function attachment_fields_to_edit($form_fields) { } /** * Unused since 3.5.0. * * @since 3.4.0 * * @param array $tabs * @return array $tabs */ public function filter_upload_tabs($tabs) { } /** * Chooses a header image, selected from existing uploaded and default headers, * or provides an array of uploaded header data (either new, or from media library). * * @since 3.4.0 * * @param mixed $choice Which header image to select. Allows for values of 'random-default-image', * for randomly cycling among the default images; 'random-uploaded-image', * for randomly cycling among the uploaded images; the key of a default image * registered for that theme; and the key of an image uploaded for that theme * (the attachment ID of the image). Or an array of arguments: attachment_id, * url, width, height. All are required. * @phpstan-param string|array{attachment_id: int<1, max>, url: string, width: int<0, max>, height: int<0, max>} $choice * @phpstan-return void */ public final function set_header_image($choice) { } /** * Removes a header image. * * @since 3.4.0 */ public final function remove_header_image() { } /** * Resets a header image to the default image for the theme. * * This method does not do anything if the theme does not have a default header image. * * @since 3.4.0 * @phpstan-return void */ public final function reset_header_image() { } /** * Calculates width and height based on what the currently selected theme supports. * * @since 3.9.0 * * @param array $dimensions * @return array dst_height and dst_width of header image. */ public final function get_header_dimensions($dimensions) { } /** * Creates an attachment 'object'. * * @since 3.9.0 * @deprecated 6.5.0 * * @param string $cropped Cropped image URL. * @param int $parent_attachment_id Attachment ID of parent image. * @return array An array with attachment object data. */ public final function create_attachment_object($cropped, $parent_attachment_id) { } /** * Inserts an attachment and its metadata. * * @since 3.9.0 * * @param array $attachment An array with attachment object data. * @param string $cropped File path to cropped image. * @return int Attachment ID. */ public final function insert_attachment($attachment, $cropped) { } /** * Gets attachment uploaded by Media Manager, crops it, then saves it as a * new object. Returns JSON-encoded object details. * * @since 3.9.0 * @phpstan-return never */ public function ajax_header_crop() { } /** * Given an attachment ID for a header image, updates its "last used" * timestamp to now. * * Triggered when the user tries adds a new header image from the * Media Manager, even if s/he doesn't save that change. * * @since 3.9.0 * @phpstan-return never */ public function ajax_header_add() { } /** * Given an attachment ID for a header image, unsets it as a user-uploaded * header image for the active theme. * * Triggered when the user clicks the overlay "X" button next to each image * choice in the Customizer's Header tool. * * @since 3.9.0 * @phpstan-return never */ public function ajax_header_remove() { } /** * Updates the last-used postmeta on a header image attachment after saving a new header image via the Customizer. * * @since 3.9.0 * * @param WP_Customize_Manager $wp_customize Customize manager. * @phpstan-return void */ public function customize_set_last_used($wp_customize) { } /** * Gets the details of default header images if defined. * * @since 3.9.0 * * @return array Default header images. */ public function get_default_header_images() { } /** * Gets the previously uploaded header images. * * @since 3.9.0 * * @return array Uploaded header images. */ public function get_uploaded_header_images() { } /** * Gets the ID of a previous crop from the same base image. * * @since 4.9.0 * * @param array $attachment An array with a cropped attachment object data. * @return int|false An attachment ID if one exists. False if none. */ public function get_previous_crop($attachment) { } } /** * Core class used for handling file uploads. * * This class handles the upload process and passes it as if it's a local file * to the Upgrade/Installer functions. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. */ #[\AllowDynamicProperties] class File_Upload_Upgrader { /** * The full path to the file package. * * @since 2.8.0 * @var string $package */ public $package; /** * The name of the file. * * @since 2.8.0 * @var string $filename */ public $filename; /** * The ID of the attachment post for this file. * * @since 3.3.0 * @var int $id */ public $id = 0; /** * Construct the upgrader for a form. * * @since 2.8.0 * * @param string $form The name of the form the file was uploaded from. * @param string $urlholder The name of the `GET` parameter that holds the filename. */ public function __construct($form, $urlholder) { } /** * Deletes the attachment/uploaded file. * * @since 3.2.2 * * @return bool Whether the cleanup was successful. */ public function cleanup() { } } /** * PemFTP base class * */ class ftp_base { var $LocalEcho; var $Verbose; var $OS_local; var $OS_remote; var $_lastaction; var $_errors; var $_type; var $_umask; var $_timeout; var $_passive; var $_host; var $_fullhost; var $_port; var $_datahost; var $_dataport; var $_ftp_control_sock; var $_ftp_data_sock; var $_ftp_temp_sock; var $_ftp_buff_size; var $_login; var $_password; var $_connected; var $_ready; var $_code; var $_message; var $_can_restore; var $_port_available; var $_curtype; var $_features; var $_error_array; var $AuthorizedTransferMode; var $OS_FullName; var $_eol_code; var $AutoAsciiExt; function __construct($port_mode = \FALSE, $verb = \FALSE, $le = \FALSE) { } function ftp_base($port_mode = \FALSE) { } function parselisting($line) { } function SendMSG($message = "", $crlf = \true) { } function SetType($mode = \FTP_AUTOASCII) { } function _settype($mode = \FTP_ASCII) { } function Passive($pasv = \NULL) { } function SetServer($host, $port = 21, $reconnect = \true) { } function SetUmask($umask = 022) { } function SetTimeout($timeout = 30) { } function connect($server = \NULL) { } function quit($force = \false) { } function login($user = \NULL, $pass = \NULL) { } function pwd() { } function cdup() { } function chdir($pathname) { } function rmdir($pathname) { } function mkdir($pathname) { } function rename($from, $to) { } function filesize($pathname) { } function abort() { } function mdtm($pathname) { } function systype() { } function delete($pathname) { } function site($command, $fnction = "site") { } function chmod($pathname, $mode) { } function restore($from) { } function features() { } function rawlist($pathname = "", $arg = "") { } function nlist($pathname = "", $arg = "") { } function is_exists($pathname) { } function file_exists($pathname) { } function fget($fp, $remotefile, $rest = 0) { } function get($remotefile, $localfile = \NULL, $rest = 0) { } function fput($remotefile, $fp, $rest = 0) { } function put($localfile, $remotefile = \NULL, $rest = 0) { } function mput($local = ".", $remote = \NULL, $continious = \false) { } function mget($remote, $local = ".", $continious = \false) { } function mdel($remote, $continious = \false) { } function mmkdir($dir, $mode = 0777) { } function glob($pattern, $handle = \NULL) { } function glob_pattern_match($pattern, $subject) { } function glob_regexp($pattern, $subject) { } function dirlist($remote) { } function _checkCode() { } function _list($arg = "", $cmd = "LIST", $fnction = "_list") { } function PushError($fctname, $msg, $desc = \false) { } function PopError() { } } /** * FTP implementation using fsockopen to connect. * * @package PemFTP * @subpackage Pure * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html * @license LGPL https://opensource.org/licenses/lgpl-license.html */ class ftp_pure extends \ftp_base { function __construct($verb = \FALSE, $le = \FALSE) { } function _settimeout($sock) { } function _connect($host, $port) { } function _readmsg($fnction = "_readmsg") { } function _exec($cmd, $fnction = "_exec") { } function _data_prepare($mode = \FTP_ASCII) { } function _data_read($mode = \FTP_ASCII, $fp = \NULL) { } function _data_write($mode = \FTP_ASCII, $fp = \NULL) { } function _data_write_block($mode, $block) { } function _data_close() { } function _quit($force = \FALSE) { } } /** * Socket Based FTP implementation * * @package PemFTP * @subpackage Socket * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html * @license LGPL https://opensource.org/licenses/lgpl-license.html */ class ftp_sockets extends \ftp_base { function __construct($verb = \FALSE, $le = \FALSE) { } function _settimeout($sock) { } function _connect($host, $port) { } function _readmsg($fnction = "_readmsg") { } function _exec($cmd, $fnction = "_exec") { } function _data_prepare($mode = \FTP_ASCII) { } function _data_read($mode = \FTP_ASCII, $fp = \NULL) { } function _data_write($mode = \FTP_ASCII, $fp = \NULL) { } function _data_write_block($mode, $block) { } function _data_close() { } function _quit() { } } class ftp extends \ftp_sockets { } /** * Translation Upgrader Skin for WordPress Translation Upgrades. * * @since 3.7.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php. * * @see WP_Upgrader_Skin */ class Language_Pack_Upgrader_Skin extends \WP_Upgrader_Skin { public $language_update = \null; public $done_header = \false; public $done_footer = \false; public $display_footer_actions = \true; /** * Constructor. * * Sets up the language pack upgrader skin. * * @since 3.7.0 * * @param array $args */ public function __construct($args = array()) { } /** * Performs an action before a language pack update. * * @since 3.7.0 */ public function before() { } /** * Displays an error message about the update. * * @since 3.7.0 * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support. * * @param string|WP_Error $errors Errors. */ public function error($errors) { } /** * Performs an action following a language pack update. * * @since 3.7.0 */ public function after() { } /** * Displays the footer following the bulk update process. * * @since 3.7.0 */ public function bulk_footer() { } } /** * Core class used for updating/installing language packs (translations) * for plugins, themes, and core. * * @since 3.7.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. * * @see WP_Upgrader */ class Language_Pack_Upgrader extends \WP_Upgrader { /** * Result of the language pack upgrade. * * @since 3.7.0 * @var array|WP_Error $result * @see WP_Upgrader::$result */ public $result; /** * Whether a bulk upgrade/installation is being performed. * * @since 3.7.0 * @var bool $bulk */ public $bulk = \true; /** * Asynchronously upgrades language packs after other upgrades have been made. * * Hooked to the {@see 'upgrader_process_complete'} action by default. * * @since 3.7.0 * * @param false|WP_Upgrader $upgrader Optional. WP_Upgrader instance or false. If `$upgrader` is * a Language_Pack_Upgrader instance, the method will bail to * avoid recursion. Otherwise unused. Default false. * @phpstan-return void */ public static function async_upgrade($upgrader = \false) { } /** * Initializes the upgrade strings. * * @since 3.7.0 */ public function upgrade_strings() { } /** * Upgrades a language pack. * * @since 3.7.0 * * @param string|false $update Optional. Whether an update offer is available. Default false. * @param array $args Optional. Other optional arguments, see * Language_Pack_Upgrader::bulk_upgrade(). Default empty array. * @return array|bool|WP_Error The result of the upgrade, or a WP_Error object instead. * @phpstan-param array{ * clear_update_cache?: bool, * } $args See Language_Pack_Upgrader::bulk_upgrade() */ public function upgrade($update = \false, $args = array()) { } /** * Upgrades several language packs at once. * * @since 3.7.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param object[] $language_updates Optional. Array of language packs to update. See {@see wp_get_translation_updates()}. * Default empty array. * @param array $args { * Other arguments for upgrading multiple language packs. Default empty array. * * @type bool $clear_update_cache Whether to clear the update cache when done. * Default true. * } * @return array|bool|WP_Error Will return an array of results, or true if there are no updates, * false or WP_Error for initial errors. * @phpstan-param array{ * clear_update_cache?: bool, * } $args */ public function bulk_upgrade($language_updates = array(), $args = array()) { } /** * Checks that the package source contains .mo and .po files. * * Hooked to the {@see 'upgrader_source_selection'} filter by * Language_Pack_Upgrader::bulk_upgrade(). * * @since 3.7.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param string|WP_Error $source The path to the downloaded package source. * @param string $remote_source Remote file source location. * @return string|WP_Error The source as passed, or a WP_Error object on failure. */ public function check_package($source, $remote_source) { } /** * Gets the name of an item being updated. * * @since 3.7.0 * * @param object $update The data for an update. * @return string The name of the item being updated. */ public function get_name_for_update($update) { } /** * Clears existing translations where this item is going to be installed into. * * @since 5.1.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param string $remote_destination The location on the remote filesystem to be cleared. * @return bool|WP_Error True upon success, WP_Error on failure. */ public function clear_destination($remote_destination) { } } class PclZip { var $zipname = ''; var $zip_fd = 0; var $error_code = 1; var $error_string = ''; var $magic_quotes_status; function __construct($p_zipname) { } public function PclZip($p_zipname) { } function create($p_filelist) { } function add($p_filelist) { } function listContent() { } function extract() { } function extractByIndex($p_index) { } function delete() { } function deleteByIndex($p_index) { } function properties() { } function duplicate($p_archive) { } function merge($p_archive_to_add) { } function errorCode() { } function errorName($p_with_code = \false) { } function errorInfo($p_full = \false) { } function privCheckFormat($p_level = 0) { } function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options = \false) { } function privOptionDefaultThreshold(&$p_options) { } function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options = \false) { } function privFileDescrExpand(&$p_filedescr_list, &$p_options) { } function privCreate($p_filedescr_list, &$p_result_list, &$p_options) { } function privAdd($p_filedescr_list, &$p_result_list, &$p_options) { } function privOpenFd($p_mode) { } function privCloseFd() { } function privAddList($p_filedescr_list, &$p_result_list, &$p_options) { } function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) { } function privAddFile($p_filedescr, &$p_header, &$p_options) { } function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) { } function privCalculateStoredFilename(&$p_filedescr, &$p_options) { } function privWriteFileHeader(&$p_header) { } function privWriteCentralFileHeader(&$p_header) { } function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) { } function privList(&$p_list) { } function privConvertHeader2FileInfo($p_header, &$p_info) { } function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { } function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { } function privExtractFileUsingTempFile(&$p_entry, &$p_options) { } function privExtractFileInOutput(&$p_entry, &$p_options) { } function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) { } function privReadFileHeader(&$p_header) { } function privReadCentralFileHeader(&$p_header) { } function privCheckFileHeaders(&$p_local_header, &$p_central_header) { } function privReadEndCentralDir(&$p_central_dir) { } function privDeleteByRule(&$p_result_list, &$p_options) { } function privDirCheck($p_dir, $p_is_dir = \false) { } function privMerge(&$p_archive_to_add) { } function privDuplicate($p_archive_filename) { } function privErrorLog($p_error_code = 0, $p_error_string = '') { } function privErrorReset() { } function privDisableMagicQuotes() { } function privSwapBackMagicQuotes() { } // -------------------------------------------------------------------------------- } /** * Plugin Installer Skin for WordPress Plugin Installer. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php. * * @see WP_Upgrader_Skin */ class Plugin_Installer_Skin extends \WP_Upgrader_Skin { public $api; public $type; public $url; public $overwrite; /** * Constructor. * * Sets up the plugin installer skin. * * @since 2.8.0 * * @param array $args */ public function __construct($args = array()) { } /** * Performs an action before installing a plugin. * * @since 2.8.0 */ public function before() { } /** * Hides the `process_failed` error when updating a plugin by uploading a zip file. * * @since 5.5.0 * * @param WP_Error $wp_error WP_Error object. * @return bool True if the error should be hidden, false otherwise. */ public function hide_process_failed($wp_error) { } /** * Performs an action following a plugin install. * * @since 2.8.0 * @phpstan-return void */ public function after() { } } /** * Plugin Upgrader Skin for WordPress Plugin Upgrades. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php. * * @see WP_Upgrader_Skin */ class Plugin_Upgrader_Skin extends \WP_Upgrader_Skin { /** * Holds the plugin slug in the Plugin Directory. * * @since 2.8.0 * * @var string */ public $plugin = ''; /** * Whether the plugin is active. * * @since 2.8.0 * * @var bool */ public $plugin_active = \false; /** * Whether the plugin is active for the entire network. * * @since 2.8.0 * * @var bool */ public $plugin_network_active = \false; /** * Constructor. * * Sets up the plugin upgrader skin. * * @since 2.8.0 * * @param array $args Optional. The plugin upgrader skin arguments to * override default options. Default empty array. */ public function __construct($args = array()) { } /** * Performs an action following a single plugin update. * * @since 2.8.0 */ public function after() { } } /** * Core class used for upgrading/installing plugins. * * It is designed to upgrade/install plugins from a local zip, remote zip URL, * or uploaded zip file. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. * * @see WP_Upgrader */ class Plugin_Upgrader extends \WP_Upgrader { /** * Plugin upgrade result. * * @since 2.8.0 * @var array|WP_Error $result * * @see WP_Upgrader::$result */ public $result; /** * Whether a bulk upgrade/installation is being performed. * * @since 2.9.0 * @var bool $bulk */ public $bulk = \false; /** * New plugin info. * * @since 5.5.0 * @var array $new_plugin_data * * @see check_package() */ public $new_plugin_data = array(); /** * Initializes the upgrade strings. * * @since 2.8.0 */ public function upgrade_strings() { } /** * Initializes the installation strings. * * @since 2.8.0 */ public function install_strings() { } /** * Install a plugin package. * * @since 2.8.0 * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional. * * @param string $package The full local path or URI of the package. * @param array $args { * Optional. Other arguments for installing a plugin package. Default empty array. * * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful. * Default true. * } * @return bool|WP_Error True if the installation was successful, false or a WP_Error otherwise. * @phpstan-param array{ * clear_update_cache?: bool, * } $args */ public function install($package, $args = array()) { } /** * Upgrades a plugin. * * @since 2.8.0 * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional. * * @param string $plugin Path to the plugin file relative to the plugins directory. * @param array $args { * Optional. Other arguments for upgrading a plugin package. Default empty array. * * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful. * Default true. * } * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise. * @phpstan-param array{ * clear_update_cache?: bool, * } $args */ public function upgrade($plugin, $args = array()) { } /** * Upgrades several plugins at once. * * @since 2.8.0 * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional. * * @param string[] $plugins Array of paths to plugin files relative to the plugins directory. * @param array $args { * Optional. Other arguments for upgrading several plugins at once. * * @type bool $clear_update_cache Whether to clear the plugin updates cache if successful. Default true. * } * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem. * @phpstan-param array{ * clear_update_cache?: bool, * } $args */ public function bulk_upgrade($plugins, $args = array()) { } /** * Checks that the source package contains a valid plugin. * * Hooked to the {@see 'upgrader_source_selection'} filter by Plugin_Upgrader::install(). * * @since 3.3.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param string $source The path to the downloaded package source. * @return string|WP_Error The source as passed, or a WP_Error object on failure. */ public function check_package($source) { } /** * Retrieves the path to the file that contains the plugin info. * * This isn't used internally in the class, but is called by the skins. * * @since 2.8.0 * * @return string|false The full path to the main plugin file, or false. */ public function plugin_info() { } /** * Deactivates a plugin before it is upgraded. * * Hooked to the {@see 'upgrader_pre_install'} filter by Plugin_Upgrader::upgrade(). * * @since 2.8.0 * @since 4.1.0 Added a return value. * * @param bool|WP_Error $response The installation response before the installation has started. * @param array $plugin Plugin package arguments. * @return bool|WP_Error The original `$response` parameter or WP_Error. */ public function deactivate_plugin_before_upgrade($response, $plugin) { } /** * Turns on maintenance mode before attempting to background update an active plugin. * * Hooked to the {@see 'upgrader_pre_install'} filter by Plugin_Upgrader::upgrade(). * * @since 5.4.0 * * @param bool|WP_Error $response The installation response before the installation has started. * @param array $plugin Plugin package arguments. * @return bool|WP_Error The original `$response` parameter or WP_Error. */ public function active_before($response, $plugin) { } /** * Turns off maintenance mode after upgrading an active plugin. * * Hooked to the {@see 'upgrader_post_install'} filter by Plugin_Upgrader::upgrade(). * * @since 5.4.0 * * @param bool|WP_Error $response The installation response after the installation has finished. * @param array $plugin Plugin package arguments. * @return bool|WP_Error The original `$response` parameter or WP_Error. */ public function active_after($response, $plugin) { } /** * Deletes the old plugin during an upgrade. * * Hooked to the {@see 'upgrader_clear_destination'} filter by * Plugin_Upgrader::upgrade() and Plugin_Upgrader::bulk_upgrade(). * * @since 2.8.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param bool|WP_Error $removed Whether the destination was cleared. * True on success, WP_Error on failure. * @param string $local_destination The local package destination. * @param string $remote_destination The remote package destination. * @param array $plugin Extra arguments passed to hooked filters. * @return bool|WP_Error */ public function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) { } } /** * Theme Installer Skin for the WordPress Theme Installer. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php. * * @see WP_Upgrader_Skin */ class Theme_Installer_Skin extends \WP_Upgrader_Skin { public $api; public $type; public $url; public $overwrite; /** * Constructor. * * Sets up the theme installer skin. * * @since 2.8.0 * * @param array $args */ public function __construct($args = array()) { } /** * Performs an action before installing a theme. * * @since 2.8.0 */ public function before() { } /** * Hides the `process_failed` error when updating a theme by uploading a zip file. * * @since 5.5.0 * * @param WP_Error $wp_error WP_Error object. * @return bool True if the error should be hidden, false otherwise. */ public function hide_process_failed($wp_error) { } /** * Performs an action following a single theme install. * * @since 2.8.0 * @phpstan-return void */ public function after() { } } /** * Theme Upgrader Skin for WordPress Theme Upgrades. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php. * * @see WP_Upgrader_Skin */ class Theme_Upgrader_Skin extends \WP_Upgrader_Skin { /** * Holds the theme slug in the Theme Directory. * * @since 2.8.0 * * @var string */ public $theme = ''; /** * Constructor. * * Sets up the theme upgrader skin. * * @since 2.8.0 * * @param array $args Optional. The theme upgrader skin arguments to * override default options. Default empty array. */ public function __construct($args = array()) { } /** * Performs an action following a single theme update. * * @since 2.8.0 */ public function after() { } } /** * Core class used for upgrading/installing themes. * * It is designed to upgrade/install themes from a local zip, remote zip URL, * or uploaded zip file. * * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. * * @see WP_Upgrader */ class Theme_Upgrader extends \WP_Upgrader { /** * Result of the theme upgrade offer. * * @since 2.8.0 * @var array|WP_Error $result * @see WP_Upgrader::$result */ public $result; /** * Whether multiple themes are being upgraded/installed in bulk. * * @since 2.9.0 * @var bool $bulk */ public $bulk = \false; /** * New theme info. * * @since 5.5.0 * @var array $new_theme_data * * @see check_package() */ public $new_theme_data = array(); /** * Initializes the upgrade strings. * * @since 2.8.0 */ public function upgrade_strings() { } /** * Initializes the installation strings. * * @since 2.8.0 */ public function install_strings() { } /** * Checks if a child theme is being installed and its parent also needs to be installed. * * Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::install(). * * @since 3.4.0 * * @param bool $install_result * @param array $hook_extra * @param array $child_result * @return bool */ public function check_parent_theme_filter($install_result, $hook_extra, $child_result) { } /** * Don't display the activate and preview actions to the user. * * Hooked to the {@see 'install_theme_complete_actions'} filter by * Theme_Upgrader::check_parent_theme_filter() when installing * a child theme and installing the parent theme fails. * * @since 3.4.0 * * @param array $actions Preview actions. * @return array */ public function hide_activate_preview_actions($actions) { } /** * Install a theme package. * * @since 2.8.0 * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional. * * @param string $package The full local path or URI of the package. * @param array $args { * Optional. Other arguments for installing a theme package. Default empty array. * * @type bool $clear_update_cache Whether to clear the updates cache if successful. * Default true. * } * * @return bool|WP_Error True if the installation was successful, false or a WP_Error object otherwise. * @phpstan-param array{ * clear_update_cache?: bool, * } $args */ public function install($package, $args = array()) { } /** * Upgrades a theme. * * @since 2.8.0 * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional. * * @param string $theme The theme slug. * @param array $args { * Optional. Other arguments for upgrading a theme. Default empty array. * * @type bool $clear_update_cache Whether to clear the update cache if successful. * Default true. * } * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise. * @phpstan-param array{ * clear_update_cache?: bool, * } $args */ public function upgrade($theme, $args = array()) { } /** * Upgrades several themes at once. * * @since 3.0.0 * @since 3.7.0 The `$args` parameter was added, making clearing the update cache optional. * * @param string[] $themes Array of the theme slugs. * @param array $args { * Optional. Other arguments for upgrading several themes at once. Default empty array. * * @type bool $clear_update_cache Whether to clear the update cache if successful. * Default true. * } * @return array[]|false An array of results, or false if unable to connect to the filesystem. * @phpstan-param array{ * clear_update_cache?: bool, * } $args */ public function bulk_upgrade($themes, $args = array()) { } /** * Checks that the package source contains a valid theme. * * Hooked to the {@see 'upgrader_source_selection'} filter by Theme_Upgrader::install(). * * @since 3.3.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param string $source The path to the downloaded package source. * @return string|WP_Error The source as passed, or a WP_Error object on failure. */ public function check_package($source) { } /** * Turns on maintenance mode before attempting to upgrade the active theme. * * Hooked to the {@see 'upgrader_pre_install'} filter by Theme_Upgrader::upgrade() and * Theme_Upgrader::bulk_upgrade(). * * @since 2.8.0 * * @param bool|WP_Error $response The installation response before the installation has started. * @param array $theme Theme arguments. * @return bool|WP_Error The original `$response` parameter or WP_Error. */ public function current_before($response, $theme) { } /** * Turns off maintenance mode after upgrading the active theme. * * Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::upgrade() * and Theme_Upgrader::bulk_upgrade(). * * @since 2.8.0 * * @param bool|WP_Error $response The installation response after the installation has finished. * @param array $theme Theme arguments. * @return bool|WP_Error The original `$response` parameter or WP_Error. */ public function current_after($response, $theme) { } /** * Deletes the old theme during an upgrade. * * Hooked to the {@see 'upgrader_clear_destination'} filter by Theme_Upgrader::upgrade() * and Theme_Upgrader::bulk_upgrade(). * * @since 2.8.0 * * @global WP_Filesystem_Base $wp_filesystem Subclass * * @param bool $removed * @param string $local_destination * @param string $remote_destination * @param array $theme * @return bool */ public function delete_old_theme($removed, $local_destination, $remote_destination, $theme) { } /** * Gets the WP_Theme object for a theme. * * @since 2.8.0 * @since 3.0.0 The `$theme` argument was added. * * @param string $theme The directory name of the theme. This is optional, and if not supplied, * the directory name from the last result will be used. * @return WP_Theme|false The theme's info object, or false `$theme` is not supplied * and the last result isn't set. */ public function theme_info($theme = \null) { } } /** * A class for displaying various tree-like structures. * * Extend the Walker class to use it, see examples below. Child classes * do not need to implement all of the abstract methods in the class. The child * only needs to implement the methods that are needed. * * @since 2.1.0 * * @package WordPress * @abstract */ #[\AllowDynamicProperties] class Walker { /** * What the class handles. * * @since 2.1.0 * @var string */ public $tree_type; /** * DB fields to use. * * @since 2.1.0 * @var string[] */ public $db_fields; /** * Max number of pages walked by the paged walker. * * @since 2.7.0 * @var int */ public $max_pages = 1; /** * Whether the current element has children or not. * * To be used in start_el(). * * @since 4.0.0 * @var bool */ public $has_children; /** * Starts the list before the elements are added. * * The $args parameter holds additional values that may be used with the child * class methods. This method is called at the start of the output list. * * @since 2.1.0 * @abstract * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of the item. * @param array $args An array of additional arguments. */ public function start_lvl(&$output, $depth = 0, $args = array()) { } /** * Ends the list of after the elements are added. * * The $args parameter holds additional values that may be used with the child * class methods. This method finishes the list at the end of output of the elements. * * @since 2.1.0 * @abstract * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of the item. * @param array $args An array of additional arguments. */ public function end_lvl(&$output, $depth = 0, $args = array()) { } /** * Starts the element output. * * The $args parameter holds additional values that may be used with the child * class methods. Also includes the element output. * * @since 2.1.0 * @since 5.9.0 Renamed `$object` (a PHP reserved keyword) to `$data_object` for PHP 8 named parameter support. * @abstract * * @param string $output Used to append additional content (passed by reference). * @param object $data_object The data object. * @param int $depth Depth of the item. * @param array $args An array of additional arguments. * @param int $current_object_id Optional. ID of the current item. Default 0. */ public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { } /** * Ends the element output, if needed. * * The $args parameter holds additional values that may be used with the child class methods. * * @since 2.1.0 * @since 5.9.0 Renamed `$object` (a PHP reserved keyword) to `$data_object` for PHP 8 named parameter support. * @abstract * * @param string $output Used to append additional content (passed by reference). * @param object $data_object The data object. * @param int $depth Depth of the item. * @param array $args An array of additional arguments. */ public function end_el(&$output, $data_object, $depth = 0, $args = array()) { } /** * Traverses elements to create list from elements. * * Display one element if the element doesn't have any children otherwise, * display the element and its children. Will only traverse up to the max * depth and no ignore elements under that depth. It is possible to set the * max depth to include all depths, see walk() method. * * This method should not be called directly, use the walk() method instead. * * @since 2.5.0 * * @param object $element Data object. * @param array $children_elements List of elements to continue traversing (passed by reference). * @param int $max_depth Max depth to traverse. * @param int $depth Depth of current element. * @param array $args An array of arguments. * @param string $output Used to append additional content (passed by reference). * @phpstan-return void */ public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) { } /** * Displays array of elements hierarchically. * * Does not assume any existing order of elements. * * $max_depth = -1 means flatly display every element. * $max_depth = 0 means display all levels. * $max_depth > 0 specifies the number of display levels. * * @since 2.1.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param array $elements An array of elements. * @param int $max_depth The maximum hierarchical depth. * @param mixed ...$args Optional additional arguments. * @return string The hierarchical item output. */ public function walk($elements, $max_depth, ...$args) { } /** * Produces a page of nested elements. * * Given an array of hierarchical elements, the maximum depth, a specific page number, * and number of elements per page, this function first determines all top level root elements * belonging to that page, then lists them and all of their children in hierarchical order. * * $max_depth = 0 means display all levels. * $max_depth > 0 specifies the number of display levels. * * @since 2.7.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param array $elements An array of elements. * @param int $max_depth The maximum hierarchical depth. * @param int $page_num The specific page number, beginning with 1. * @param int $per_page Number of elements per page. * @param mixed ...$args Optional additional arguments. * @return string XHTML of the specified page of elements. */ public function paged_walk($elements, $max_depth, $page_num, $per_page, ...$args) { } /** * Calculates the total number of root elements. * * @since 2.7.0 * * @param array $elements Elements to list. * @return int Number of root elements. */ public function get_number_of_root_elements($elements) { } /** * Unsets all the children for a given top level element. * * @since 2.7.0 * * @param object $element The top level element. * @param array $children_elements The children elements. * @phpstan-return void */ public function unset_children($element, &$children_elements) { } } /** * Core walker class to output an unordered list of category checkbox input elements. * * @since 2.5.1 * * @see Walker * @see wp_category_checklist() * @see wp_terms_checklist() */ class Walker_Category_Checklist extends \Walker { public $tree_type = 'category'; public $db_fields = array('parent' => 'parent', 'id' => 'term_id'); /** * Starts the list before the elements are added. * * @see Walker:start_lvl() * * @since 2.5.1 * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of category. Used for tab indentation. * @param array $args An array of arguments. See {@see wp_terms_checklist()}. * @phpstan-param array{ * descendants_and_self?: int, * selected_cats?: int[], * popular_cats?: int[], * walker?: Walker, * taxonomy?: string, * checked_ontop?: bool, * echo?: bool, * } $args See wp_terms_checklist() */ public function start_lvl(&$output, $depth = 0, $args = array()) { } /** * Ends the list of after the elements are added. * * @see Walker::end_lvl() * * @since 2.5.1 * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of category. Used for tab indentation. * @param array $args An array of arguments. See {@see wp_terms_checklist()}. * @phpstan-param array{ * descendants_and_self?: int, * selected_cats?: int[], * popular_cats?: int[], * walker?: Walker, * taxonomy?: string, * checked_ontop?: bool, * echo?: bool, * } $args See wp_terms_checklist() */ public function end_lvl(&$output, $depth = 0, $args = array()) { } /** * Start the element output. * * @see Walker::start_el() * * @since 2.5.1 * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @param string $output Used to append additional content (passed by reference). * @param WP_Term $data_object The current term object. * @param int $depth Depth of the term in reference to parents. Default 0. * @param array $args An array of arguments. See {@see wp_terms_checklist()}. * @param int $current_object_id Optional. ID of the current term. Default 0. * @phpstan-param array{ * descendants_and_self?: int, * selected_cats?: int[], * popular_cats?: int[], * walker?: Walker, * taxonomy?: string, * checked_ontop?: bool, * echo?: bool, * } $args See wp_terms_checklist() */ public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { } /** * Ends the element output, if needed. * * @see Walker::end_el() * * @since 2.5.1 * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. * * @param string $output Used to append additional content (passed by reference). * @param WP_Term $data_object The current term object. * @param int $depth Depth of the term in reference to parents. Default 0. * @param array $args An array of arguments. See {@see wp_terms_checklist()}. * @phpstan-param array{ * descendants_and_self?: int, * selected_cats?: int[], * popular_cats?: int[], * walker?: Walker, * taxonomy?: string, * checked_ontop?: bool, * echo?: bool, * } $args See wp_terms_checklist() */ public function end_el(&$output, $data_object, $depth = 0, $args = array()) { } } /** * Core class used to implement an HTML list of nav menu items. * * @since 3.0.0 * * @see Walker */ class Walker_Nav_Menu extends \Walker { /** * What the class handles. * * @since 3.0.0 * @var string * * @see Walker::$tree_type */ public $tree_type = array('post_type', 'taxonomy', 'custom'); /** * Database fields to use. * * @since 3.0.0 * @todo Decouple this. * @var string[] * * @see Walker::$db_fields */ public $db_fields = array('parent' => 'menu_item_parent', 'id' => 'db_id'); /** * Starts the list before the elements are added. * * @since 3.0.0 * * @see Walker::start_lvl() * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of menu item. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. */ public function start_lvl(&$output, $depth = 0, $args = \null) { } /** * Ends the list of after the elements are added. * * @since 3.0.0 * * @see Walker::end_lvl() * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of menu item. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. */ public function end_lvl(&$output, $depth = 0, $args = \null) { } /** * Starts the element output. * * @since 3.0.0 * @since 4.4.0 The {@see 'nav_menu_item_args'} filter was added. * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * @since 6.7.0 Removed redundant title attributes. * * @see Walker::start_el() * * @param string $output Used to append additional content (passed by reference). * @param WP_Post $data_object Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. * @param int $current_object_id Optional. ID of the current menu item. Default 0. */ public function start_el(&$output, $data_object, $depth = 0, $args = \null, $current_object_id = 0) { } /** * Ends the element output, if needed. * * @since 3.0.0 * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * * @param string $output Used to append additional content (passed by reference). * @param WP_Post $data_object Menu item data object. Not used. * @param int $depth Depth of page. Not Used. * @param stdClass $args An object of wp_nav_menu() arguments. */ public function end_el(&$output, $data_object, $depth = 0, $args = \null) { } /** * Builds a string of HTML attributes from an array of key/value pairs. * Empty values are ignored. * * @since 6.3.0 * * @param array $atts Optional. An array of HTML attribute key/value pairs. Default empty array. * @return string A string of HTML attributes. */ protected function build_atts($atts = array()) { } } /** * Create HTML list of nav menu input items. * * @since 3.0.0 * @uses Walker_Nav_Menu */ class Walker_Nav_Menu_Checklist extends \Walker_Nav_Menu { /** * @param array|false $fields Database fields to use. */ public function __construct($fields = \false) { } /** * Starts the list before the elements are added. * * @see Walker_Nav_Menu::start_lvl() * * @since 3.0.0 * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of page. Used for padding. * @param stdClass $args Not used. */ public function start_lvl(&$output, $depth = 0, $args = \null) { } /** * Ends the list of after the elements are added. * * @see Walker_Nav_Menu::end_lvl() * * @since 3.0.0 * * @param string $output Used to append additional content (passed by reference). * @param int $depth Depth of page. Used for padding. * @param stdClass $args Not used. */ public function end_lvl(&$output, $depth = 0, $args = \null) { } /** * Start the element output. * * @see Walker_Nav_Menu::start_el() * * @since 3.0.0 * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @global int $_nav_menu_placeholder * @global int|string $nav_menu_selected_id * * @param string $output Used to append additional content (passed by reference). * @param WP_Post $data_object Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param stdClass $args Not used. * @param int $current_object_id Optional. ID of the current menu item. Default 0. */ public function start_el(&$output, $data_object, $depth = 0, $args = \null, $current_object_id = 0) { } } /** * Create HTML list of nav menu input items. * * @since 3.0.0 * * @see Walker_Nav_Menu */ class Walker_Nav_Menu_Edit extends \Walker_Nav_Menu { /** * Starts the list before the elements are added. * * @see Walker_Nav_Menu::start_lvl() * * @since 3.0.0 * * @param string $output Passed by reference. * @param int $depth Depth of menu item. Used for padding. * @param stdClass $args Not used. */ public function start_lvl(&$output, $depth = 0, $args = \null) { } /** * Ends the list of after the elements are added. * * @see Walker_Nav_Menu::end_lvl() * * @since 3.0.0 * * @param string $output Passed by reference. * @param int $depth Depth of menu item. Used for padding. * @param stdClass $args Not used. */ public function end_lvl(&$output, $depth = 0, $args = \null) { } /** * Start the element output. * * @see Walker_Nav_Menu::start_el() * @since 3.0.0 * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @global int $_wp_nav_menu_max_depth * * @param string $output Used to append additional content (passed by reference). * @param WP_Post $data_object Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param stdClass $args Not used. * @param int $current_object_id Optional. ID of the current menu item. Default 0. */ public function start_el(&$output, $data_object, $depth = 0, $args = \null, $current_object_id = 0) { } } /** * Upgrader Skin for Ajax WordPress upgrades. * * This skin is designed to be used for Ajax updates. * * @since 4.6.0 * * @see Automatic_Upgrader_Skin */ class WP_Ajax_Upgrader_Skin extends \Automatic_Upgrader_Skin { /** * Plugin info. * * The Plugin_Upgrader::bulk_upgrade() method will fill this in * with info retrieved from the get_plugin_data() function. * * @var array Plugin data. Values will be empty if not supplied by the plugin. */ public $plugin_info = array(); /** * Theme info. * * The Theme_Upgrader::bulk_upgrade() method will fill this in * with info retrieved from the Theme_Upgrader::theme_info() method, * which in turn calls the wp_get_theme() function. * * @var WP_Theme|false The theme's info object, or false. */ public $theme_info = \false; /** * Holds the WP_Error object. * * @since 4.6.0 * * @var null|WP_Error */ protected $errors = \null; /** * Constructor. * * Sets up the WordPress Ajax upgrader skin. * * @since 4.6.0 * * @see WP_Upgrader_Skin::__construct() * * @param array $args Optional. The WordPress Ajax upgrader skin arguments to * override default options. See WP_Upgrader_Skin::__construct(). * Default empty array. */ public function __construct($args = array()) { } /** * Retrieves the list of errors. * * @since 4.6.0 * * @return WP_Error Errors during an upgrade. */ public function get_errors() { } /** * Retrieves a string for error messages. * * @since 4.6.0 * * @return string Error messages during an upgrade. */ public function get_error_messages() { } /** * Stores an error message about the upgrade. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param string|WP_Error $errors Errors. * @param mixed ...$args Optional text replacements. */ public function error($errors, ...$args) { } /** * Stores a message about the upgrade. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * @since 5.9.0 Renamed `$data` to `$feedback` for PHP 8 named parameter support. * * @param string|array|WP_Error $feedback Message data. * @param mixed ...$args Optional text replacements. */ public function feedback($feedback, ...$args) { } } /** * Base class for displaying a list of items in an ajaxified HTML table. * * @since 3.1.0 */ #[\AllowDynamicProperties] class WP_List_Table { /** * The current list of items. * * @since 3.1.0 * @var array */ public $items; /** * Various information about the current table. * * @since 3.1.0 * @var array */ protected $_args; /** * Various information needed for displaying the pagination. * * @since 3.1.0 * @var array */ protected $_pagination_args = array(); /** * The current screen. * * @since 3.1.0 * @var WP_Screen */ protected $screen; /** * The view switcher modes. * * @since 4.1.0 * @var array */ protected $modes = array(); /** * Stores the value returned by ->get_column_info(). * * @since 4.1.0 * @var array */ protected $_column_headers; /** * {@internal Missing Summary} * * @var array */ protected $compat_fields = array('_args', '_pagination_args', 'screen', '_actions', '_pagination'); /** * {@internal Missing Summary} * * @var array */ protected $compat_methods = array('set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions', 'row_actions', 'months_dropdown', 'view_switcher', 'comments_bubble', 'get_items_per_page', 'pagination', 'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav', 'single_row_columns'); /** * Constructor. * * The child class should call this constructor from its own constructor to override * the default $args. * * @since 3.1.0 * * @param array|string $args { * Array or string of arguments. * * @type string $plural Plural value used for labels and the objects being listed. * This affects things such as CSS class-names and nonces used * in the list table, e.g. 'posts'. Default empty. * @type string $singular Singular label for an object being listed, e.g. 'post'. * Default empty * @type bool $ajax Whether the list table supports Ajax. This includes loading * and sorting data, for example. If true, the class will call * the _js_vars() method in the footer to provide variables * to any scripts handling Ajax events. Default false. * @type string $screen String containing the hook name used to determine the current * screen. If left null, the current screen will be automatically set. * Default null. * } * @phpstan-param array{ * plural?: string, * singular?: string, * ajax?: bool, * screen?: string, * } $args */ public function __construct($args = array()) { } /** * Makes private properties readable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Getting a dynamic property is deprecated. * * @param string $name Property to get. * @return mixed Property. */ public function __get($name) { } /** * Makes private properties settable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Setting a dynamic property is deprecated. * * @param string $name Property to check if set. * @param mixed $value Property value. * @phpstan-return void */ public function __set($name, $value) { } /** * Makes private properties checkable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Checking a dynamic property is deprecated. * * @param string $name Property to check if set. * @return bool Whether the property is a back-compat property and it is set. */ public function __isset($name) { } /** * Makes private properties un-settable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Unsetting a dynamic property is deprecated. * * @param string $name Property to unset. * @phpstan-return void */ public function __unset($name) { } /** * Makes private/protected methods readable for backward compatibility. * * @since 4.0.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed|bool Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } /** * Checks the current user's permissions * * @since 3.1.0 * @abstract */ public function ajax_user_can() { } /** * Prepares the list of items for displaying. * * @uses WP_List_Table::set_pagination_args() * * @since 3.1.0 * @abstract */ public function prepare_items() { } /** * Sets all the necessary pagination arguments. * * @since 3.1.0 * * @param array|string $args Array or string of arguments with information about the pagination. * @phpstan-param array{total_items?: int, total_pages?: int, per_page?: int} $args * @phpstan-return void */ protected function set_pagination_args($args) { } /** * Access the pagination args. * * @since 3.1.0 * * @param string $key Pagination argument to retrieve. Common values include 'total_items', * 'total_pages', 'per_page', or 'infinite_scroll'. * @return int Number of items that correspond to the given pagination argument. */ public function get_pagination_arg($key) { } /** * Determines whether the table has items to display or not * * @since 3.1.0 * * @return bool */ public function has_items() { } /** * Message to be displayed when there are no items * * @since 3.1.0 */ public function no_items() { } /** * Displays the search box. * * @since 3.1.0 * * @param string $text The 'submit' button label. * @param string $input_id ID attribute value for the search input field. * @phpstan-return void */ public function search_box($text, $input_id) { } /** * Generates views links. * * @since 6.1.0 * * @param array $link_data { * An array of link data. * * @type string $url The link URL. * @type string $label The link label. * @type bool $current Optional. Whether this is the currently selected view. * } * @return string[] An array of link markup. Keys match the `$link_data` input array. * @phpstan-param array{ * url?: string, * label?: string, * current?: bool, * } $link_data */ protected function get_views_links($link_data = array()) { } /** * Gets the list of views available on this table. * * The format is an associative array: * - `'id' => 'link'` * * @since 3.1.0 * * @return array */ protected function get_views() { } /** * Displays the list of views available on this table. * * @since 3.1.0 * @phpstan-return void */ public function views() { } /** * Retrieves the list of bulk actions available for this table. * * The format is an associative array where each element represents either a top level option value and label, or * an array representing an optgroup and its options. * * For a standard option, the array element key is the field value and the array element value is the field label. * * For an optgroup, the array element key is the label and the array element value is an associative array of * options as above. * * Example: * * [ * 'edit' => 'Edit', * 'delete' => 'Delete', * 'Change State' => [ * 'feature' => 'Featured', * 'sale' => 'On Sale', * ] * ] * * @since 3.1.0 * @since 5.6.0 A bulk action can now contain an array of options in order to create an optgroup. * * @return array */ protected function get_bulk_actions() { } /** * Displays the bulk actions dropdown. * * @since 3.1.0 * * @param string $which The location of the bulk actions: Either 'top' or 'bottom'. * This is designated as optional for backward compatibility. * @phpstan-param 'top'|'bottom' $which * @phpstan-return void */ protected function bulk_actions($which = '') { } /** * Gets the current action selected from the bulk actions dropdown. * * @since 3.1.0 * * @return string|false The action name. False if no action was selected. */ public function current_action() { } /** * Generates the required HTML for a list of row action links. * * @since 3.1.0 * * @param string[] $actions An array of action links. * @param bool $always_visible Whether the actions should be always visible. * @return string The HTML for the row actions. */ protected function row_actions($actions, $always_visible = \false) { } /** * Displays a dropdown for filtering items in the list table by month. * * @since 3.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $post_type The post type. * @phpstan-return void */ protected function months_dropdown($post_type) { } /** * Displays a view switcher. * * @since 3.1.0 * * @param string $current_mode */ protected function view_switcher($current_mode) { } /** * Displays a comment count bubble. * * @since 3.1.0 * * @param int $post_id The post ID. * @param int $pending_comments Number of pending comments. */ protected function comments_bubble($post_id, $pending_comments) { } /** * Gets the current page number. * * @since 3.1.0 * * @return int */ public function get_pagenum() { } /** * Gets the number of items to display on a single page. * * @since 3.1.0 * * @param string $option User option name. * @param int $default_value Optional. The number of items to display. Default 20. * @return int */ protected function get_items_per_page($option, $default_value = 20) { } /** * Displays the pagination. * * @since 3.1.0 * * @param string $which The location of the pagination: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which * @phpstan-return void */ protected function pagination($which) { } /** * Gets a list of columns. * * The format is: * - `'internal-name' => 'Title'` * * @since 3.1.0 * @abstract * * @return array */ public function get_columns() { } /** * Gets a list of sortable columns. * * The format is: * - `'internal-name' => 'orderby'` * - `'internal-name' => array( 'orderby', bool, 'abbr', 'orderby-text', 'initially-sorted-column-order' )` - * - `'internal-name' => array( 'orderby', 'asc' )` - The second element sets the initial sorting order. * - `'internal-name' => array( 'orderby', true )` - The second element makes the initial order descending. * * In the second format, passing true as second parameter will make the initial * sorting order be descending. Following parameters add a short column name to * be used as 'abbr' attribute, a translatable string for the current sorting, * and the initial order for the initial sorted column, 'asc' or 'desc' (default: false). * * @since 3.1.0 * @since 6.3.0 Added 'abbr', 'orderby-text' and 'initially-sorted-column-order'. * * @return array */ protected function get_sortable_columns() { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, an empty string. */ protected function get_default_primary_column_name() { } /** * Gets the name of the primary column. * * Public wrapper for WP_List_Table::get_default_primary_column_name(). * * @since 4.4.0 * * @return string Name of the default primary column. */ public function get_primary_column() { } /** * Gets the name of the primary column. * * @since 4.3.0 * * @return string The name of the primary column. */ protected function get_primary_column_name() { } /** * Gets a list of all, hidden, and sortable columns, with filter applied. * * @since 3.1.0 * * @return array */ protected function get_column_info() { } /** * Returns the number of visible columns. * * @since 3.1.0 * * @return int */ public function get_column_count() { } /** * Prints column headers, accounting for hidden and sortable columns. * * @since 3.1.0 * * @param bool $with_id Whether to set the ID attribute or not */ public function print_column_headers($with_id = \true) { } /** * Print a table description with information about current sorting and order. * * For the table initial view, information about initial orderby and order * should be provided via get_sortable_columns(). * * @since 6.3.0 * @access public * @phpstan-return void */ public function print_table_description() { } /** * Displays the table. * * @since 3.1.0 */ public function display() { } /** * Gets a list of CSS classes for the WP_List_Table table tag. * * @since 3.1.0 * * @return string[] Array of CSS classes for the table tag. */ protected function get_table_classes() { } /** * Generates the table navigation above or below the table * * @since 3.1.0 * @param string $which The location of the navigation: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which */ protected function display_tablenav($which) { } /** * Displays extra controls between bulk actions and pagination. * * @since 3.1.0 * * @param string $which */ protected function extra_tablenav($which) { } /** * Generates the tbody element for the list table. * * @since 3.1.0 */ public function display_rows_or_placeholder() { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Generates content for a single row of the table. * * @since 3.1.0 * * @param object|array $item The current item */ public function single_row($item) { } /** * @param object|array $item * @param string $column_name */ protected function column_default($item, $column_name) { } /** * @param object|array $item */ protected function column_cb($item) { } /** * Generates the columns for a single row of the table. * * @since 3.1.0 * * @param object|array $item The current item. */ protected function single_row_columns($item) { } /** * Generates and display row actions links for the list table. * * @since 4.3.0 * * @param object|array $item The item being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string The row actions HTML, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions($item, $column_name, $primary) { } /** * Handles an incoming ajax request (called from admin-ajax.php) * * @since 3.1.0 * @phpstan-return never */ public function ajax_response() { } /** * Sends required variables to JavaScript land. * * @since 3.1.0 */ public function _js_vars() { } } /** * Class for displaying the list of application password items. * * @since 5.6.0 * * @see WP_List_Table */ class WP_Application_Passwords_List_Table extends \WP_List_Table { /** * Gets the list of columns. * * @since 5.6.0 * * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * Prepares the list of items for displaying. * * @since 5.6.0 * * @global int $user_id User ID. */ public function prepare_items() { } /** * Handles the name column output. * * @since 5.6.0 * * @param array $item The current application password item. */ public function column_name($item) { } /** * Handles the created column output. * * @since 5.6.0 * * @param array $item The current application password item. */ public function column_created($item) { } /** * Handles the last used column output. * * @since 5.6.0 * * @param array $item The current application password item. */ public function column_last_used($item) { } /** * Handles the last ip column output. * * @since 5.6.0 * * @param array $item The current application password item. */ public function column_last_ip($item) { } /** * Handles the revoke column output. * * @since 5.6.0 * * @param array $item The current application password item. */ public function column_revoke($item) { } /** * Generates content for a single row of the table * * @since 5.6.0 * * @param array $item The current item. * @param string $column_name The current column name. */ protected function column_default($item, $column_name) { } /** * Generates custom table navigation to prevent conflicting nonces. * * @since 5.6.0 * * @param string $which The location of the bulk actions: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which */ protected function display_tablenav($which) { } /** * Generates content for a single row of the table. * * @since 5.6.0 * * @param array $item The current item. */ public function single_row($item) { } /** * Gets the name of the default primary column. * * @since 5.6.0 * * @return string Name of the default primary column, in this case, 'name'. */ protected function get_default_primary_column_name() { } /** * Prints the JavaScript template for the new row item. * * @since 5.6.0 */ public function print_js_template_row() { } } /** * Core class used for handling automatic background updates. * * @since 3.7.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. */ #[\AllowDynamicProperties] class WP_Automatic_Updater { /** * Tracks update results during processing. * * @var array */ protected $update_results = array(); /** * Determines whether the entire automatic updater is disabled. * * @since 3.7.0 * * @return bool True if the automatic updater is disabled, false otherwise. */ public function is_disabled() { } /** * Checks whether access to a given directory is allowed. * * This is used when detecting version control checkouts. Takes into account * the PHP `open_basedir` restrictions, so that WordPress does not try to access * directories it is not allowed to. * * @since 6.2.0 * * @param string $dir The directory to check. * @return bool True if access to the directory is allowed, false otherwise. */ public function is_allowed_dir($dir) { } /** * Checks for version control checkouts. * * Checks for Subversion, Git, Mercurial, and Bazaar. It recursively looks up the * filesystem to the top of the drive, erring on the side of detecting a VCS * checkout somewhere. * * ABSPATH is always checked in addition to whatever `$context` is (which may be the * wp-content directory, for example). The underlying assumption is that if you are * using version control *anywhere*, then you should be making decisions for * how things get updated. * * @since 3.7.0 * * @param string $context The filesystem path to check, in addition to ABSPATH. * @return bool True if a VCS checkout was discovered at `$context` or ABSPATH, * or anywhere higher. False otherwise. */ public function is_vcs_checkout($context) { } /** * Tests to see if we can and should update a specific item. * * @since 3.7.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $type The type of update being checked: 'core', 'theme', * 'plugin', 'translation'. * @param object $item The update offer. * @param string $context The filesystem context (a path) against which filesystem * access and status should be checked. * @return bool True if the item should be updated, false otherwise. */ public function should_update($type, $item, $context) { } /** * Notifies an administrator of a core update. * * @since 3.7.0 * * @param object $item The update offer. * @return bool True if the site administrator is notified of a core update, * false otherwise. */ protected function send_core_update_notification_email($item) { } /** * Updates an item, if appropriate. * * @since 3.7.0 * * @param string $type The type of update being checked: 'core', 'theme', 'plugin', 'translation'. * @param object $item The update offer. * @return null|WP_Error */ public function update($type, $item) { } /** * Kicks off the background update process, looping through all pending updates. * * @since 3.7.0 * @phpstan-return void */ public function run() { } /** * Checks whether to send an email and avoid processing future updates after * attempting a core update. * * @since 3.7.0 * * @param object $update_result The result of the core update. Includes the update offer and result. * @phpstan-return void */ protected function after_core_update($update_result) { } /** * Sends an email upon the completion or failure of a background core update. * * @since 3.7.0 * * @param string $type The type of email to send. Can be one of 'success', 'fail', 'manual', 'critical'. * @param object $core_update The update offer that was attempted. * @param mixed $result Optional. The result for the core update. Can be WP_Error. * @phpstan-return void */ protected function send_email($type, $core_update, $result = \null) { } /** * Checks whether an email should be sent after attempting plugin or theme updates. * * @since 5.5.0 * * @param array $update_results The results of update tasks. * @phpstan-return void */ protected function after_plugin_theme_update($update_results) { } /** * Sends an email upon the completion or failure of a plugin or theme background update. * * @since 5.5.0 * * @param string $type The type of email to send. Can be one of 'success', 'fail', 'mixed'. * @param array $successful_updates A list of updates that succeeded. * @param array $failed_updates A list of updates that failed. * @phpstan-return void */ protected function send_plugin_theme_email($type, $successful_updates, $failed_updates) { } /** * Prepares and sends an email of a full log of background update results, useful for debugging and geekery. * * @since 3.7.0 */ protected function send_debug_email() { } /** * Performs a loopback request to check for potential fatal errors. * * Fatal errors cannot be detected unless maintenance mode is enabled. * * @since 6.6.0 * * @global int $upgrading The Unix timestamp marking when upgrading WordPress began. * * @return bool Whether a fatal error was detected. */ protected function has_fatal_error() { } } /** * Core class used to implement displaying comments in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Comments_List_Table extends \WP_List_Table { public $checkbox = \true; public $pending_count = array(); public $extra_items; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @global int $post_id * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * Adds avatars to comment author names. * * @since 3.1.0 * * @param string $name Comment author name. * @param int $comment_id Comment ID. * @return string Avatar with the user name. */ public function floated_admin_avatar($name, $comment_id) { } /** * @return bool */ public function ajax_user_can() { } /** * @global string $mode List table view mode. * @global int $post_id * @global string $comment_status * @global string $comment_type * @global string $search */ public function prepare_items() { } /** * @param string $comment_status * @return int */ public function get_per_page($comment_status = 'all') { } /** * @global string $comment_status */ public function no_items() { } /** * @global int $post_id * @global string $comment_status * @global string $comment_type */ protected function get_views() { } /** * @global string $comment_status * * @return array */ protected function get_bulk_actions() { } /** * @global string $comment_status * @global string $comment_type * * @param string $which */ protected function extra_tablenav($which) { } /** * @return string|false */ public function current_action() { } /** * @global int $post_id * * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * Displays a comment type drop-down for filtering on the Comments list table. * * @since 5.5.0 * @since 5.6.0 Renamed from `comment_status_dropdown()` to `comment_type_dropdown()`. * * @param string $comment_type The current comment type slug. */ protected function comment_type_dropdown($comment_type) { } /** * @return array */ protected function get_sortable_columns() { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'comment'. */ protected function get_default_primary_column_name() { } /** * Displays the comments table. * * Overrides the parent display() method to render extra comments. * * @since 3.1.0 */ public function display() { } /** * @global WP_Post $post Global post object. * @global WP_Comment $comment Global comment object. * * @param WP_Comment $item */ public function single_row($item) { } /** * Generates and displays row actions links. * * @since 4.3.0 * @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support. * * @global string $comment_status Status for the current listed comments. * * @param WP_Comment $item The comment object. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for comments. An empty string * if the current column is not the primary column, * or if the current user cannot edit the comment. */ protected function handle_row_actions($item, $column_name, $primary) { } /** * @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Comment $item The comment object. */ public function column_cb($item) { } /** * @param WP_Comment $comment The comment object. */ public function column_comment($comment) { } /** * @global string $comment_status * * @param WP_Comment $comment The comment object. */ public function column_author($comment) { } /** * @param WP_Comment $comment The comment object. */ public function column_date($comment) { } /** * @param WP_Comment $comment The comment object. * @phpstan-return void */ public function column_response($comment) { } /** * @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Comment $item The comment object. * @param string $column_name The custom column's name. */ public function column_default($item, $column_name) { } } /** * Class WP_Community_Events. * * A client for api.wordpress.org/events. * * @since 4.8.0 */ #[\AllowDynamicProperties] class WP_Community_Events { /** * ID for a WordPress user account. * * @since 4.8.0 * * @var int */ protected $user_id = 0; /** * Stores location data for the user. * * @since 4.8.0 * * @var false|array */ protected $user_location = \false; /** * Constructor for WP_Community_Events. * * @since 4.8.0 * * @param int $user_id WP user ID. * @param false|array $user_location { * Stored location data for the user. false to pass no location. * * @type string $description The name of the location * @type string $latitude The latitude in decimal degrees notation, without the degree * symbol. e.g.: 47.615200. * @type string $longitude The longitude in decimal degrees notation, without the degree * symbol. e.g.: -122.341100. * @type string $country The ISO 3166-1 alpha-2 country code. e.g.: BR * } * @phpstan-param false|array{ * description?: string, * latitude?: string, * longitude?: string, * country?: string, * } $user_location */ public function __construct($user_id, $user_location = \false) { } /** * Gets data about events near a particular location. * * Cached events will be immediately returned if the `user_location` property * is set for the current user, and cached events exist for that location. * * Otherwise, this method sends a request to the w.org Events API with location * data. The API will send back a recognized location based on the data, along * with nearby events. * * The browser's request for events is proxied with this method, rather * than having the browser make the request directly to api.wordpress.org, * because it allows results to be cached server-side and shared with other * users and sites in the network. This makes the process more efficient, * since increasing the number of visits that get cached data means users * don't have to wait as often; if the user's browser made the request * directly, it would also need to make a second request to WP in order to * pass the data for caching. Having WP make the request also introduces * the opportunity to anonymize the IP before sending it to w.org, which * mitigates possible privacy concerns. * * @since 4.8.0 * @since 5.5.2 Response no longer contains formatted date field. They're added * in `wp.communityEvents.populateDynamicEventFields()` now. * * @param string $location_search Optional. City name to help determine the location. * e.g., "Seattle". Default empty string. * @param string $timezone Optional. Timezone to help determine the location. * Default empty string. * @return array|WP_Error A WP_Error on failure; an array with location and events on * success. */ public function get_events($location_search = '', $timezone = '') { } /** * Builds an array of args to use in an HTTP request to the w.org Events API. * * @since 4.8.0 * * @param string $search Optional. City search string. Default empty string. * @param string $timezone Optional. Timezone string. Default empty string. * @return array The request args. */ protected function get_request_args($search = '', $timezone = '') { } /** * Determines the user's actual IP address and attempts to partially * anonymize an IP address by converting it to a network ID. * * Geolocating the network ID usually returns a similar location as the * actual IP, but provides some privacy for the user. * * $_SERVER['REMOTE_ADDR'] cannot be used in all cases, such as when the user * is making their request through a proxy, or when the web server is behind * a proxy. In those cases, $_SERVER['REMOTE_ADDR'] is set to the proxy address rather * than the user's actual address. * * Modified from https://stackoverflow.com/a/2031935/450127, MIT license. * Modified from https://github.com/geertw/php-ip-anonymizer, MIT license. * * SECURITY WARNING: This function is _NOT_ intended to be used in * circumstances where the authenticity of the IP address matters. This does * _NOT_ guarantee that the returned address is valid or accurate, and it can * be easily spoofed. * * @since 4.8.0 * * @return string|false The anonymized address on success; the given address * or false on failure. */ public static function get_unsafe_client_ip() { } /** * Test if two pairs of latitude/longitude coordinates match each other. * * @since 4.8.0 * * @param array $a The first pair, with indexes 'latitude' and 'longitude'. * @param array $b The second pair, with indexes 'latitude' and 'longitude'. * @return bool True if they match, false if they don't. */ protected function coordinates_match($a, $b) { } /** * Generates a transient key based on user location. * * This could be reduced to a one-liner in the calling functions, but it's * intentionally a separate function because it's called from multiple * functions, and having it abstracted keeps the logic consistent and DRY, * which is less prone to errors. * * @since 4.8.0 * * @param array $location Should contain 'latitude' and 'longitude' indexes. * @return string|false Transient key on success, false on failure. */ protected function get_events_transient_key($location) { } /** * Caches an array of events data from the Events API. * * @since 4.8.0 * * @param array $events Response body from the API request. * @param int|false $expiration Optional. Amount of time to cache the events. Defaults to false. * @return bool true if events were cached; false if not. */ protected function cache_events($events, $expiration = \false) { } /** * Gets cached events. * * @since 4.8.0 * @since 5.5.2 Response no longer contains formatted date field. They're added * in `wp.communityEvents.populateDynamicEventFields()` now. * * @return array|false An array containing `location` and `events` items * on success, false on failure. */ public function get_cached_events() { } /** * Adds formatted date and time items for each event in an API response. * * This has to be called after the data is pulled from the cache, because * the cached events are shared by all users. If it was called before storing * the cache, then all users would see the events in the localized data/time * of the user who triggered the cache refresh, rather than their own. * * @since 4.8.0 * @deprecated 5.6.0 No longer used in core. * * @param array $response_body The response which contains the events. * @return array The response with dates and times formatted. */ protected function format_event_data_time($response_body) { } /** * Prepares the event list for presentation. * * Discards expired events, and makes WordCamps "sticky." Attendees need more * advanced notice about WordCamps than they do for meetups, so camps should * appear in the list sooner. If a WordCamp is coming up, the API will "stick" * it in the response, even if it wouldn't otherwise appear. When that happens, * the event will be at the end of the list, and will need to be moved into a * higher position, so that it doesn't get trimmed off. * * @since 4.8.0 * @since 4.9.7 Stick a WordCamp to the final list. * @since 5.5.2 Accepts and returns only the events, rather than an entire HTTP response. * @since 6.0.0 Decode HTML entities from the event title. * * @param array $events The events that will be prepared. * @return array The response body with events trimmed. */ protected function trim_events(array $events) { } /** * Logs responses to Events API requests. * * @since 4.8.0 * @deprecated 4.9.0 Use a plugin instead. See #41217 for an example. * * @param string $message A description of what occurred. * @param array $details Details that provide more context for the * log entry. * @phpstan-return void */ protected function maybe_log_events_response($message, $details) { } } /** * Class for providing debug data based on a users WordPress environment. * * @package WordPress * @subpackage Site_Health * @since 5.2.0 */ #[\AllowDynamicProperties] class WP_Debug_Data { /** * Calls all core functions to check for updates. * * @since 5.2.0 */ public static function check_for_updates() { } /** * Static function for generating site debug data when required. * * @since 5.2.0 * @since 5.3.0 Added database charset, database collation, * and timezone information. * @since 5.5.0 Added pretty permalinks support information. * @since 6.7.0 Modularized into separate theme-oriented methods. * * @throws ImagickException * * @return array The debug data for the site. */ public static function debug_data() { } /** * Returns the value of a MySQL system variable. * * @since 5.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $mysql_var Name of the MySQL system variable. * @return string|null The variable value on success. Null if the variable does not exist. */ public static function get_mysql_var($mysql_var) { } /** * Formats the information gathered for debugging, in a manner suitable for copying to a forum or support ticket. * * @since 5.2.0 * * @param array $info_array Information gathered from the `WP_Debug_Data::debug_data()` function. * @param string $data_type The data type to return, either 'info' or 'debug'. * @return string The formatted data. * @phpstan-param 'info'|'debug' $data_type */ public static function format($info_array, $data_type) { } /** * Fetches the total size of all the database tables for the active database user. * * @since 5.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int The size of the database, in bytes. */ public static function get_database_size() { } /** * Fetches the sizes of the WordPress directories: `wordpress` (ABSPATH), `plugins`, `themes`, and `uploads`. * Intended to supplement the array returned by `WP_Debug_Data::debug_data()`. * * @since 5.2.0 * * @return array The sizes of the directories, also the database size and total installation size. */ public static function get_sizes() { } } /** * Base WordPress Filesystem class which Filesystem implementations extend. * * @since 2.5.0 */ #[\AllowDynamicProperties] class WP_Filesystem_Base { /** * Whether to display debug data for the connection. * * @since 2.5.0 * @var bool */ public $verbose = \false; /** * Cached list of local filepaths to mapped remote filepaths. * * @since 2.7.0 * @var array */ public $cache = array(); /** * The Access method of the current connection, Set automatically. * * @since 2.5.0 * @var string */ public $method = ''; /** * @var WP_Error */ public $errors = \null; /** */ public $options = array(); /** * Returns the path on the remote filesystem of ABSPATH. * * @since 2.7.0 * * @return string The location of the remote path. */ public function abspath() { } /** * Returns the path on the remote filesystem of WP_CONTENT_DIR. * * @since 2.7.0 * * @return string The location of the remote path. */ public function wp_content_dir() { } /** * Returns the path on the remote filesystem of WP_PLUGIN_DIR. * * @since 2.7.0 * * @return string The location of the remote path. */ public function wp_plugins_dir() { } /** * Returns the path on the remote filesystem of the Themes Directory. * * @since 2.7.0 * * @param string|false $theme Optional. The theme stylesheet or template for the directory. * Default false. * @return string The location of the remote path. */ public function wp_themes_dir($theme = \false) { } /** * Returns the path on the remote filesystem of WP_LANG_DIR. * * @since 3.2.0 * * @return string The location of the remote path. */ public function wp_lang_dir() { } /** * Locates a folder on the remote filesystem. * * @since 2.5.0 * @deprecated 2.7.0 use WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir() instead. * @see WP_Filesystem_Base::abspath() * @see WP_Filesystem_Base::wp_content_dir() * @see WP_Filesystem_Base::wp_plugins_dir() * @see WP_Filesystem_Base::wp_themes_dir() * @see WP_Filesystem_Base::wp_lang_dir() * * @param string $base Optional. The folder to start searching from. Default '.'. * @param bool $verbose Optional. True to display debug information. Default false. * @return string The location of the remote path. */ public function find_base_dir($base = '.', $verbose = \false) { } /** * Locates a folder on the remote filesystem. * * @since 2.5.0 * @deprecated 2.7.0 use WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir() methods instead. * @see WP_Filesystem_Base::abspath() * @see WP_Filesystem_Base::wp_content_dir() * @see WP_Filesystem_Base::wp_plugins_dir() * @see WP_Filesystem_Base::wp_themes_dir() * @see WP_Filesystem_Base::wp_lang_dir() * * @param string $base Optional. The folder to start searching from. Default '.'. * @param bool $verbose Optional. True to display debug information. Default false. * @return string The location of the remote path. */ public function get_base_dir($base = '.', $verbose = \false) { } /** * Locates a folder on the remote filesystem. * * Assumes that on Windows systems, Stripping off the Drive * letter is OK Sanitizes \\ to / in Windows filepaths. * * @since 2.7.0 * * @param string $folder the folder to locate. * @return string|false The location of the remote path, false on failure. */ public function find_folder($folder) { } /** * Locates a folder on the remote filesystem. * * Expects Windows sanitized path. * * @since 2.7.0 * * @param string $folder The folder to locate. * @param string $base The folder to start searching from. * @param bool $loop If the function has recursed. Internal use only. * @return string|false The location of the remote path, false to cease looping. */ public function search_for_folder($folder, $base = '.', $loop = \false) { } /** * Returns the *nix-style file permissions for a file. * * From the PHP documentation page for fileperms(). * * @link https://www.php.net/manual/en/function.fileperms.php * * @since 2.5.0 * * @param string $file String filename. * @return string The *nix-style representation of permissions. */ public function gethchmod($file) { } /** * Gets the permissions of the specified file or filepath in their octal format. * * @since 2.5.0 * * @param string $file Path to the file. * @return string Mode of the file (the last 3 digits). */ public function getchmod($file) { } /** * Converts *nix-style file permissions to an octal number. * * Converts '-rw-r--r--' to 0644 * From "info at rvgate dot nl"'s comment on the PHP documentation for chmod() * * @link https://www.php.net/manual/en/function.chmod.php#49614 * * @since 2.5.0 * * @param string $mode string The *nix-style file permissions. * @return string Octal representation of permissions. */ public function getnumchmodfromh($mode) { } /** * Determines if the string provided contains binary characters. * * @since 2.7.0 * * @param string $text String to test against. * @return bool True if string is binary, false otherwise. */ public function is_binary($text) { } /** * Changes the owner of a file or directory. * * Default behavior is to do nothing, override this in your subclass, if desired. * * @since 2.5.0 * * @param string $file Path to the file or directory. * @param string|int $owner A user name or number. * @param bool $recursive Optional. If set to true, changes file owner recursively. * Default false. * @return bool True on success, false on failure. */ public function chown($file, $owner, $recursive = \false) { } /** * Connects filesystem. * * @since 2.5.0 * @abstract * * @return bool True on success, false on failure (always true for WP_Filesystem_Direct). */ public function connect() { } /** * Reads entire file into a string. * * @since 2.5.0 * @abstract * * @param string $file Name of the file to read. * @return string|false Read data on success, false on failure. */ public function get_contents($file) { } /** * Reads entire file into an array. * * @since 2.5.0 * @abstract * * @param string $file Path to the file. * @return array|false File contents in an array on success, false on failure. */ public function get_contents_array($file) { } /** * Writes a string to a file. * * @since 2.5.0 * @abstract * * @param string $file Remote path to the file where to write the data. * @param string $contents The data to write. * @param int|false $mode Optional. The file permissions as octal number, usually 0644. * Default false. * @return bool True on success, false on failure. */ public function put_contents($file, $contents, $mode = \false) { } /** * Gets the current working directory. * * @since 2.5.0 * @abstract * * @return string|false The current working directory on success, false on failure. */ public function cwd() { } /** * Changes current directory. * * @since 2.5.0 * @abstract * * @param string $dir The new current directory. * @return bool True on success, false on failure. */ public function chdir($dir) { } /** * Changes the file group. * * @since 2.5.0 * @abstract * * @param string $file Path to the file. * @param string|int $group A group name or number. * @param bool $recursive Optional. If set to true, changes file group recursively. * Default false. * @return bool True on success, false on failure. */ public function chgrp($file, $group, $recursive = \false) { } /** * Changes filesystem permissions. * * @since 2.5.0 * @abstract * * @param string $file Path to the file. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for directories. Default false. * @param bool $recursive Optional. If set to true, changes file permissions recursively. * Default false. * @return bool True on success, false on failure. */ public function chmod($file, $mode = \false, $recursive = \false) { } /** * Gets the file owner. * * @since 2.5.0 * @abstract * * @param string $file Path to the file. * @return string|false Username of the owner on success, false on failure. */ public function owner($file) { } /** * Gets the file's group. * * @since 2.5.0 * @abstract * * @param string $file Path to the file. * @return string|false The group on success, false on failure. */ public function group($file) { } /** * Copies a file. * * @since 2.5.0 * @abstract * * @param string $source Path to the source file. * @param string $destination Path to the destination file. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists. * Default false. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for dirs. Default false. * @return bool True on success, false on failure. */ public function copy($source, $destination, $overwrite = \false, $mode = \false) { } /** * Moves a file. * * @since 2.5.0 * @abstract * * @param string $source Path to the source file. * @param string $destination Path to the destination file. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists. * Default false. * @return bool True on success, false on failure. */ public function move($source, $destination, $overwrite = \false) { } /** * Deletes a file or directory. * * @since 2.5.0 * @abstract * * @param string $file Path to the file or directory. * @param bool $recursive Optional. If set to true, deletes files and folders recursively. * Default false. * @param string|false $type Type of resource. 'f' for file, 'd' for directory. * Default false. * @return bool True on success, false on failure. */ public function delete($file, $recursive = \false, $type = \false) { } /** * Checks if a file or directory exists. * * @since 2.5.0 * @abstract * * @param string $path Path to file or directory. * @return bool Whether $path exists or not. */ public function exists($path) { } /** * Checks if resource is a file. * * @since 2.5.0 * @abstract * * @param string $file File path. * @return bool Whether $file is a file. */ public function is_file($file) { } /** * Checks if resource is a directory. * * @since 2.5.0 * @abstract * * @param string $path Directory path. * @return bool Whether $path is a directory. */ public function is_dir($path) { } /** * Checks if a file is readable. * * @since 2.5.0 * @abstract * * @param string $file Path to file. * @return bool Whether $file is readable. */ public function is_readable($file) { } /** * Checks if a file or directory is writable. * * @since 2.5.0 * @abstract * * @param string $path Path to file or directory. * @return bool Whether $path is writable. */ public function is_writable($path) { } /** * Gets the file's last access time. * * @since 2.5.0 * @abstract * * @param string $file Path to file. * @return int|false Unix timestamp representing last access time, false on failure. */ public function atime($file) { } /** * Gets the file modification time. * * @since 2.5.0 * @abstract * * @param string $file Path to file. * @return int|false Unix timestamp representing modification time, false on failure. */ public function mtime($file) { } /** * Gets the file size (in bytes). * * @since 2.5.0 * @abstract * * @param string $file Path to file. * @return int|false Size of the file in bytes on success, false on failure. */ public function size($file) { } /** * Sets the access and modification times of a file. * * Note: If $file doesn't exist, it will be created. * * @since 2.5.0 * @abstract * * @param string $file Path to file. * @param int $time Optional. Modified time to set for file. * Default 0. * @param int $atime Optional. Access time to set for file. * Default 0. * @return bool True on success, false on failure. */ public function touch($file, $time = 0, $atime = 0) { } /** * Creates a directory. * * @since 2.5.0 * @abstract * * @param string $path Path for new directory. * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). * Default false. * @param string|int|false $chown Optional. A user name or number (or false to skip chown). * Default false. * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp). * Default false. * @return bool True on success, false on failure. */ public function mkdir($path, $chmod = \false, $chown = \false, $chgrp = \false) { } /** * Deletes a directory. * * @since 2.5.0 * @abstract * * @param string $path Path to directory. * @param bool $recursive Optional. Whether to recursively remove files/directories. * Default false. * @return bool True on success, false on failure. */ public function rmdir($path, $recursive = \false) { } /** * Gets details for files in a directory or a specific file. * * @since 2.5.0 * @abstract * * @param string $path Path to directory or file. * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files. * Default true. * @param bool $recursive Optional. Whether to recursively include file details in nested directories. * Default false. * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. * @type string $perms *nix representation of permissions. * @type string $permsn Octal representation of permissions. * @type int|string|false $number File number. May be a numeric string. False if not available. * @type string|false $owner Owner name or ID, or false if not available. * @type string|false $group File permissions group, or false if not available. * @type int|string|false $size Size of file in bytes. May be a numeric string. * False if not available. * @type int|string|false $lastmodunix Last modified unix timestamp. May be a numeric string. * False if not available. * @type string|false $lastmod Last modified month (3 letters) and day (without leading 0), or * false if not available. * @type string|false $time Last modified time, or false if not available. * @type string $type Type of resource. 'f' for file, 'd' for directory, 'l' for link. * @type array|false $files If a directory and `$recursive` is true, contains another array of * files. False if unable to list directory contents. * } * } * @phpstan-return false|array * @phpstan-return false|array */ public function dirlist($path, $include_hidden = \true, $recursive = \false) { } } /** * WordPress Filesystem Class for direct PHP file and folder manipulation. * * @since 2.5.0 * * @see WP_Filesystem_Base */ class WP_Filesystem_Direct extends \WP_Filesystem_Base { /** * Constructor. * * @since 2.5.0 * * @param mixed $arg Not used. */ public function __construct($arg) { } /** * Reads entire file into a string. * * @since 2.5.0 * * @param string $file Name of the file to read. * @return string|false Read data on success, false on failure. */ public function get_contents($file) { } /** * Reads entire file into an array. * * @since 2.5.0 * * @param string $file Path to the file. * @return array|false File contents in an array on success, false on failure. */ public function get_contents_array($file) { } /** * Writes a string to a file. * * @since 2.5.0 * * @param string $file Remote path to the file where to write the data. * @param string $contents The data to write. * @param int|false $mode Optional. The file permissions as octal number, usually 0644. * Default false. * @return bool True on success, false on failure. */ public function put_contents($file, $contents, $mode = \false) { } /** * Gets the current working directory. * * @since 2.5.0 * * @return string|false The current working directory on success, false on failure. */ public function cwd() { } /** * Changes current directory. * * @since 2.5.0 * * @param string $dir The new current directory. * @return bool True on success, false on failure. */ public function chdir($dir) { } /** * Changes the file group. * * @since 2.5.0 * * @param string $file Path to the file. * @param string|int $group A group name or number. * @param bool $recursive Optional. If set to true, changes file group recursively. * Default false. * @return bool True on success, false on failure. */ public function chgrp($file, $group, $recursive = \false) { } /** * Changes filesystem permissions. * * @since 2.5.0 * * @param string $file Path to the file. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for directories. Default false. * @param bool $recursive Optional. If set to true, changes file permissions recursively. * Default false. * @return bool True on success, false on failure. */ public function chmod($file, $mode = \false, $recursive = \false) { } /** * Changes the owner of a file or directory. * * @since 2.5.0 * * @param string $file Path to the file or directory. * @param string|int $owner A user name or number. * @param bool $recursive Optional. If set to true, changes file owner recursively. * Default false. * @return bool True on success, false on failure. */ public function chown($file, $owner, $recursive = \false) { } /** * Gets the file owner. * * @since 2.5.0 * * @param string $file Path to the file. * @return string|false Username of the owner on success, false on failure. */ public function owner($file) { } /** * Gets the permissions of the specified file or filepath in their octal format. * * FIXME does not handle errors in fileperms() * * @since 2.5.0 * * @param string $file Path to the file. * @return string Mode of the file (the last 3 digits). */ public function getchmod($file) { } /** * Gets the file's group. * * @since 2.5.0 * * @param string $file Path to the file. * @return string|false The group on success, false on failure. */ public function group($file) { } /** * Copies a file. * * @since 2.5.0 * * @param string $source Path to the source file. * @param string $destination Path to the destination file. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists. * Default false. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for dirs. Default false. * @return bool True on success, false on failure. */ public function copy($source, $destination, $overwrite = \false, $mode = \false) { } /** * Moves a file or directory. * * After moving files or directories, OPcache will need to be invalidated. * * If moving a directory fails, `copy_dir()` can be used for a recursive copy. * * Use `move_dir()` for moving directories with OPcache invalidation and a * fallback to `copy_dir()`. * * @since 2.5.0 * * @param string $source Path to the source file. * @param string $destination Path to the destination file. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists. * Default false. * @return bool True on success, false on failure. */ public function move($source, $destination, $overwrite = \false) { } /** * Deletes a file or directory. * * @since 2.5.0 * * @param string $file Path to the file or directory. * @param bool $recursive Optional. If set to true, deletes files and folders recursively. * Default false. * @param string|false $type Type of resource. 'f' for file, 'd' for directory. * Default false. * @return bool True on success, false on failure. */ public function delete($file, $recursive = \false, $type = \false) { } /** * Checks if a file or directory exists. * * @since 2.5.0 * * @param string $path Path to file or directory. * @return bool Whether $path exists or not. */ public function exists($path) { } /** * Checks if resource is a file. * * @since 2.5.0 * * @param string $file File path. * @return bool Whether $file is a file. */ public function is_file($file) { } /** * Checks if resource is a directory. * * @since 2.5.0 * * @param string $path Directory path. * @return bool Whether $path is a directory. */ public function is_dir($path) { } /** * Checks if a file is readable. * * @since 2.5.0 * * @param string $file Path to file. * @return bool Whether $file is readable. */ public function is_readable($file) { } /** * Checks if a file or directory is writable. * * @since 2.5.0 * * @param string $path Path to file or directory. * @return bool Whether $path is writable. */ public function is_writable($path) { } /** * Gets the file's last access time. * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing last access time, false on failure. */ public function atime($file) { } /** * Gets the file modification time. * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing modification time, false on failure. */ public function mtime($file) { } /** * Gets the file size (in bytes). * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Size of the file in bytes on success, false on failure. */ public function size($file) { } /** * Sets the access and modification times of a file. * * Note: If $file doesn't exist, it will be created. * * @since 2.5.0 * * @param string $file Path to file. * @param int $time Optional. Modified time to set for file. * Default 0. * @param int $atime Optional. Access time to set for file. * Default 0. * @return bool True on success, false on failure. */ public function touch($file, $time = 0, $atime = 0) { } /** * Creates a directory. * * @since 2.5.0 * * @param string $path Path for new directory. * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). * Default false. * @param string|int|false $chown Optional. A user name or number (or false to skip chown). * Default false. * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp). * Default false. * @return bool True on success, false on failure. */ public function mkdir($path, $chmod = \false, $chown = \false, $chgrp = \false) { } /** * Deletes a directory. * * @since 2.5.0 * * @param string $path Path to directory. * @param bool $recursive Optional. Whether to recursively remove files/directories. * Default false. * @return bool True on success, false on failure. */ public function rmdir($path, $recursive = \false) { } /** * Gets details for files in a directory or a specific file. * * @since 2.5.0 * * @param string $path Path to directory or file. * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files. * Default true. * @param bool $recursive Optional. Whether to recursively include file details in nested directories. * Default false. * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. * @type string $perms *nix representation of permissions. * @type string $permsn Octal representation of permissions. * @type false $number File number. Always false in this context. * @type string|false $owner Owner name or ID, or false if not available. * @type string|false $group File permissions group, or false if not available. * @type int|string|false $size Size of file in bytes. May be a numeric string. * False if not available. * @type int|string|false $lastmodunix Last modified unix timestamp. May be a numeric string. * False if not available. * @type string|false $lastmod Last modified month (3 letters) and day (without leading 0), or * false if not available. * @type string|false $time Last modified time, or false if not available. * @type string $type Type of resource. 'f' for file, 'd' for directory, 'l' for link. * @type array|false $files If a directory and `$recursive` is true, contains another array of * files. False if unable to list directory contents. * } * } * @phpstan-return false|array * @phpstan-return false|array */ public function dirlist($path, $include_hidden = \true, $recursive = \false) { } } /** * WordPress Filesystem Class for implementing FTP. * * @since 2.5.0 * * @see WP_Filesystem_Base */ class WP_Filesystem_FTPext extends \WP_Filesystem_Base { /** * @since 2.5.0 * @var resource */ public $link; /** * Constructor. * * @since 2.5.0 * * @param array $opt * @phpstan-return void */ public function __construct($opt = '') { } /** * Connects filesystem. * * @since 2.5.0 * * @return bool True on success, false on failure. */ public function connect() { } /** * Reads entire file into a string. * * @since 2.5.0 * * @param string $file Name of the file to read. * @return string|false Read data on success, false if no temporary file could be opened, * or if the file couldn't be retrieved. */ public function get_contents($file) { } /** * Reads entire file into an array. * * @since 2.5.0 * * @param string $file Path to the file. * @return array|false File contents in an array on success, false on failure. */ public function get_contents_array($file) { } /** * Writes a string to a file. * * @since 2.5.0 * * @param string $file Remote path to the file where to write the data. * @param string $contents The data to write. * @param int|false $mode Optional. The file permissions as octal number, usually 0644. * Default false. * @return bool True on success, false on failure. */ public function put_contents($file, $contents, $mode = \false) { } /** * Gets the current working directory. * * @since 2.5.0 * * @return string|false The current working directory on success, false on failure. */ public function cwd() { } /** * Changes current directory. * * @since 2.5.0 * * @param string $dir The new current directory. * @return bool True on success, false on failure. */ public function chdir($dir) { } /** * Changes filesystem permissions. * * @since 2.5.0 * * @param string $file Path to the file. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for directories. Default false. * @param bool $recursive Optional. If set to true, changes file permissions recursively. * Default false. * @return bool True on success, false on failure. */ public function chmod($file, $mode = \false, $recursive = \false) { } /** * Gets the file owner. * * @since 2.5.0 * * @param string $file Path to the file. * @return string|false Username of the owner on success, false on failure. */ public function owner($file) { } /** * Gets the permissions of the specified file or filepath in their octal format. * * @since 2.5.0 * * @param string $file Path to the file. * @return string Mode of the file (the last 3 digits). */ public function getchmod($file) { } /** * Gets the file's group. * * @since 2.5.0 * * @param string $file Path to the file. * @return string|false The group on success, false on failure. */ public function group($file) { } /** * Copies a file. * * @since 2.5.0 * * @param string $source Path to the source file. * @param string $destination Path to the destination file. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists. * Default false. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for dirs. Default false. * @return bool True on success, false on failure. */ public function copy($source, $destination, $overwrite = \false, $mode = \false) { } /** * Moves a file or directory. * * After moving files or directories, OPcache will need to be invalidated. * * If moving a directory fails, `copy_dir()` can be used for a recursive copy. * * Use `move_dir()` for moving directories with OPcache invalidation and a * fallback to `copy_dir()`. * * @since 2.5.0 * * @param string $source Path to the source file or directory. * @param string $destination Path to the destination file or directory. * @param bool $overwrite Optional. Whether to overwrite the destination if it exists. * Default false. * @return bool True on success, false on failure. */ public function move($source, $destination, $overwrite = \false) { } /** * Deletes a file or directory. * * @since 2.5.0 * * @param string $file Path to the file or directory. * @param bool $recursive Optional. If set to true, deletes files and folders recursively. * Default false. * @param string|false $type Type of resource. 'f' for file, 'd' for directory. * Default false. * @return bool True on success, false on failure. */ public function delete($file, $recursive = \false, $type = \false) { } /** * Checks if a file or directory exists. * * @since 2.5.0 * @since 6.3.0 Returns false for an empty path. * * @param string $path Path to file or directory. * @return bool Whether $path exists or not. */ public function exists($path) { } /** * Checks if resource is a file. * * @since 2.5.0 * * @param string $file File path. * @return bool Whether $file is a file. */ public function is_file($file) { } /** * Checks if resource is a directory. * * @since 2.5.0 * * @param string $path Directory path. * @return bool Whether $path is a directory. */ public function is_dir($path) { } /** * Checks if a file is readable. * * @since 2.5.0 * * @param string $file Path to file. * @return bool Whether $file is readable. */ public function is_readable($file) { } /** * Checks if a file or directory is writable. * * @since 2.5.0 * * @param string $path Path to file or directory. * @return bool Whether $path is writable. */ public function is_writable($path) { } /** * Gets the file's last access time. * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing last access time, false on failure. */ public function atime($file) { } /** * Gets the file modification time. * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing modification time, false on failure. */ public function mtime($file) { } /** * Gets the file size (in bytes). * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Size of the file in bytes on success, false on failure. */ public function size($file) { } /** * Sets the access and modification times of a file. * * Note: If $file doesn't exist, it will be created. * * @since 2.5.0 * * @param string $file Path to file. * @param int $time Optional. Modified time to set for file. * Default 0. * @param int $atime Optional. Access time to set for file. * Default 0. * @return bool True on success, false on failure. */ public function touch($file, $time = 0, $atime = 0) { } /** * Creates a directory. * * @since 2.5.0 * * @param string $path Path for new directory. * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). * Default false. * @param string|int|false $chown Optional. A user name or number (or false to skip chown). * Default false. * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp). * Default false. * @return bool True on success, false on failure. */ public function mkdir($path, $chmod = \false, $chown = \false, $chgrp = \false) { } /** * Deletes a directory. * * @since 2.5.0 * * @param string $path Path to directory. * @param bool $recursive Optional. Whether to recursively remove files/directories. * Default false. * @return bool True on success, false on failure. */ public function rmdir($path, $recursive = \false) { } /** * @param string $line * @return array { * Array of file information. * * @type string $name Name of the file or directory. * @type string $perms *nix representation of permissions. * @type string $permsn Octal representation of permissions. * @type string|false $number File number as a string, or false if not available. * @type string|false $owner Owner name or ID, or false if not available. * @type string|false $group File permissions group, or false if not available. * @type string|false $size Size of file in bytes as a string, or false if not available. * @type string|false $lastmodunix Last modified unix timestamp as a string, or false if not available. * @type string|false $lastmod Last modified month (3 letters) and day (without leading 0), or * false if not available. * @type string|false $time Last modified time, or false if not available. * @type string $type Type of resource. 'f' for file, 'd' for directory, 'l' for link. * @type array|false $files If a directory and `$recursive` is true, contains another array of files. * False if unable to list directory contents. * } * @phpstan-return array{ * name: string, * perms: string, * permsn: string, * number: string|false, * owner: string|false, * group: string|false, * size: string|false, * lastmodunix: string|false, * lastmod: string|false, * time: string|false, * type: string, * files: array|false, * } */ public function parselisting($line) { } /** * Gets details for files in a directory or a specific file. * * @since 2.5.0 * * @param string $path Path to directory or file. * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files. * Default true. * @param bool $recursive Optional. Whether to recursively include file details in nested directories. * Default false. * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. * @type string $perms *nix representation of permissions. * @type string $permsn Octal representation of permissions. * @type int|string|false $number File number. May be a numeric string. False if not available. * @type string|false $owner Owner name or ID, or false if not available. * @type string|false $group File permissions group, or false if not available. * @type int|string|false $size Size of file in bytes. May be a numeric string. * False if not available. * @type int|string|false $lastmodunix Last modified unix timestamp. May be a numeric string. * False if not available. * @type string|false $lastmod Last modified month (3 letters) and day (without leading 0), or * false if not available. * @type string|false $time Last modified time, or false if not available. * @type string $type Type of resource. 'f' for file, 'd' for directory, 'l' for link. * @type array|false $files If a directory and `$recursive` is true, contains another array of * files. False if unable to list directory contents. * } * } * @phpstan-return false|array * @phpstan-return false|array */ public function dirlist($path = '.', $include_hidden = \true, $recursive = \false) { } /** * Destructor. * * @since 2.5.0 */ public function __destruct() { } } /** * WordPress Filesystem Class for implementing FTP Sockets. * * @since 2.5.0 * * @see WP_Filesystem_Base */ class WP_Filesystem_ftpsockets extends \WP_Filesystem_Base { /** * @since 2.5.0 * @var ftp */ public $ftp; /** * Constructor. * * @since 2.5.0 * * @param array $opt * @phpstan-return void */ public function __construct($opt = '') { } /** * Connects filesystem. * * @since 2.5.0 * * @return bool True on success, false on failure. */ public function connect() { } /** * Reads entire file into a string. * * @since 2.5.0 * * @param string $file Name of the file to read. * @return string|false Read data on success, false if no temporary file could be opened, * or if the file couldn't be retrieved. */ public function get_contents($file) { } /** * Reads entire file into an array. * * @since 2.5.0 * * @param string $file Path to the file. * @return array|false File contents in an array on success, false on failure. */ public function get_contents_array($file) { } /** * Writes a string to a file. * * @since 2.5.0 * * @param string $file Remote path to the file where to write the data. * @param string $contents The data to write. * @param int|false $mode Optional. The file permissions as octal number, usually 0644. * Default false. * @return bool True on success, false on failure. */ public function put_contents($file, $contents, $mode = \false) { } /** * Gets the current working directory. * * @since 2.5.0 * * @return string|false The current working directory on success, false on failure. */ public function cwd() { } /** * Changes current directory. * * @since 2.5.0 * * @param string $dir The new current directory. * @return bool True on success, false on failure. */ public function chdir($dir) { } /** * Changes filesystem permissions. * * @since 2.5.0 * * @param string $file Path to the file. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for directories. Default false. * @param bool $recursive Optional. If set to true, changes file permissions recursively. * Default false. * @return bool True on success, false on failure. */ public function chmod($file, $mode = \false, $recursive = \false) { } /** * Gets the file owner. * * @since 2.5.0 * * @param string $file Path to the file. * @return string|false Username of the owner on success, false on failure. */ public function owner($file) { } /** * Gets the permissions of the specified file or filepath in their octal format. * * @since 2.5.0 * * @param string $file Path to the file. * @return string Mode of the file (the last 3 digits). */ public function getchmod($file) { } /** * Gets the file's group. * * @since 2.5.0 * * @param string $file Path to the file. * @return string|false The group on success, false on failure. */ public function group($file) { } /** * Copies a file. * * @since 2.5.0 * * @param string $source Path to the source file. * @param string $destination Path to the destination file. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists. * Default false. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for dirs. Default false. * @return bool True on success, false on failure. */ public function copy($source, $destination, $overwrite = \false, $mode = \false) { } /** * Moves a file or directory. * * After moving files or directories, OPcache will need to be invalidated. * * If moving a directory fails, `copy_dir()` can be used for a recursive copy. * * Use `move_dir()` for moving directories with OPcache invalidation and a * fallback to `copy_dir()`. * * @since 2.5.0 * * @param string $source Path to the source file or directory. * @param string $destination Path to the destination file or directory. * @param bool $overwrite Optional. Whether to overwrite the destination if it exists. * Default false. * @return bool True on success, false on failure. */ public function move($source, $destination, $overwrite = \false) { } /** * Deletes a file or directory. * * @since 2.5.0 * * @param string $file Path to the file or directory. * @param bool $recursive Optional. If set to true, deletes files and folders recursively. * Default false. * @param string|false $type Type of resource. 'f' for file, 'd' for directory. * Default false. * @return bool True on success, false on failure. */ public function delete($file, $recursive = \false, $type = \false) { } /** * Checks if a file or directory exists. * * @since 2.5.0 * @since 6.3.0 Returns false for an empty path. * * @param string $path Path to file or directory. * @return bool Whether $path exists or not. */ public function exists($path) { } /** * Checks if resource is a file. * * @since 2.5.0 * * @param string $file File path. * @return bool Whether $file is a file. */ public function is_file($file) { } /** * Checks if resource is a directory. * * @since 2.5.0 * * @param string $path Directory path. * @return bool Whether $path is a directory. */ public function is_dir($path) { } /** * Checks if a file is readable. * * @since 2.5.0 * * @param string $file Path to file. * @return bool Whether $file is readable. */ public function is_readable($file) { } /** * Checks if a file or directory is writable. * * @since 2.5.0 * * @param string $path Path to file or directory. * @return bool Whether $path is writable. */ public function is_writable($path) { } /** * Gets the file's last access time. * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing last access time, false on failure. */ public function atime($file) { } /** * Gets the file modification time. * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing modification time, false on failure. */ public function mtime($file) { } /** * Gets the file size (in bytes). * * @since 2.5.0 * * @param string $file Path to file. * @return int|false Size of the file in bytes on success, false on failure. */ public function size($file) { } /** * Sets the access and modification times of a file. * * Note: If $file doesn't exist, it will be created. * * @since 2.5.0 * * @param string $file Path to file. * @param int $time Optional. Modified time to set for file. * Default 0. * @param int $atime Optional. Access time to set for file. * Default 0. * @return bool True on success, false on failure. */ public function touch($file, $time = 0, $atime = 0) { } /** * Creates a directory. * * @since 2.5.0 * * @param string $path Path for new directory. * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). * Default false. * @param string|int|false $chown Optional. A user name or number (or false to skip chown). * Default false. * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp). * Default false. * @return bool True on success, false on failure. */ public function mkdir($path, $chmod = \false, $chown = \false, $chgrp = \false) { } /** * Deletes a directory. * * @since 2.5.0 * * @param string $path Path to directory. * @param bool $recursive Optional. Whether to recursively remove files/directories. * Default false. * @return bool True on success, false on failure. */ public function rmdir($path, $recursive = \false) { } /** * Gets details for files in a directory or a specific file. * * @since 2.5.0 * * @param string $path Path to directory or file. * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files. * Default true. * @param bool $recursive Optional. Whether to recursively include file details in nested directories. * Default false. * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. * @type string $perms *nix representation of permissions. * @type string $permsn Octal representation of permissions. * @type int|string|false $number File number. May be a numeric string. False if not available. * @type string|false $owner Owner name or ID, or false if not available. * @type string|false $group File permissions group, or false if not available. * @type int|string|false $size Size of file in bytes. May be a numeric string. * False if not available. * @type int|string|false $lastmodunix Last modified unix timestamp. May be a numeric string. * False if not available. * @type string|false $lastmod Last modified month (3 letters) and day (without leading 0), or * false if not available. * @type string|false $time Last modified time, or false if not available. * @type string $type Type of resource. 'f' for file, 'd' for directory, 'l' for link. * @type array|false $files If a directory and `$recursive` is true, contains another array of * files. False if unable to list directory contents. * } * } * @phpstan-return false|array * @phpstan-return false|array */ public function dirlist($path = '.', $include_hidden = \true, $recursive = \false) { } /** * Destructor. * * @since 2.5.0 */ public function __destruct() { } } /** * WordPress Filesystem Class for implementing SSH2 * * To use this class you must follow these steps for PHP 5.2.6+ * * {@link http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes} * * Compile libssh2 (Note: Only 0.14 is officially working with PHP 5.2.6+ right now, But many users have found the latest versions work) * * cd /usr/src * wget https://www.libssh2.org/download/libssh2-0.14.tar.gz * tar -zxvf libssh2-0.14.tar.gz * cd libssh2-0.14/ * ./configure * make all install * * Note: Do not leave the directory yet! * * Enter: pecl install -f ssh2 * * Copy the ssh.so file it creates to your PHP Module Directory. * Open up your PHP.INI file and look for where extensions are placed. * Add in your PHP.ini file: extension=ssh2.so * * Restart Apache! * Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp exist. * * Note: As of WordPress 2.8, this utilizes the PHP5+ function `stream_get_contents()`. * * @since 2.7.0 * * @package WordPress * @subpackage Filesystem */ class WP_Filesystem_SSH2 extends \WP_Filesystem_Base { /** * @since 2.7.0 * @var resource */ public $link = \false; /** * @since 2.7.0 * @var resource */ public $sftp_link; /** * @since 2.7.0 * @var bool */ public $keys = \false; /** * Constructor. * * @since 2.7.0 * * @param array $opt * @phpstan-return void */ public function __construct($opt = '') { } /** * Connects filesystem. * * @since 2.7.0 * * @return bool True on success, false on failure. */ public function connect() { } /** * Gets the ssh2.sftp PHP stream wrapper path to open for the given file. * * This method also works around a PHP bug where the root directory (/) cannot * be opened by PHP functions, causing a false failure. In order to work around * this, the path is converted to /./ which is semantically the same as / * See https://bugs.php.net/bug.php?id=64169 for more details. * * @since 4.4.0 * * @param string $path The File/Directory path on the remote server to return * @return string The ssh2.sftp:// wrapped path to use. */ public function sftp_path($path) { } /** * @since 2.7.0 * * @param string $command * @param bool $returnbool * @return bool|string True on success, false on failure. String if the command was executed, `$returnbool` * is false (default), and data from the resulting stream was retrieved. */ public function run_command($command, $returnbool = \false) { } /** * Reads entire file into a string. * * @since 2.7.0 * * @param string $file Name of the file to read. * @return string|false Read data on success, false if no temporary file could be opened, * or if the file couldn't be retrieved. */ public function get_contents($file) { } /** * Reads entire file into an array. * * @since 2.7.0 * * @param string $file Path to the file. * @return array|false File contents in an array on success, false on failure. */ public function get_contents_array($file) { } /** * Writes a string to a file. * * @since 2.7.0 * * @param string $file Remote path to the file where to write the data. * @param string $contents The data to write. * @param int|false $mode Optional. The file permissions as octal number, usually 0644. * Default false. * @return bool True on success, false on failure. */ public function put_contents($file, $contents, $mode = \false) { } /** * Gets the current working directory. * * @since 2.7.0 * * @return string|false The current working directory on success, false on failure. */ public function cwd() { } /** * Changes current directory. * * @since 2.7.0 * * @param string $dir The new current directory. * @return bool True on success, false on failure. */ public function chdir($dir) { } /** * Changes the file group. * * @since 2.7.0 * * @param string $file Path to the file. * @param string|int $group A group name or number. * @param bool $recursive Optional. If set to true, changes file group recursively. * Default false. * @return bool True on success, false on failure. */ public function chgrp($file, $group, $recursive = \false) { } /** * Changes filesystem permissions. * * @since 2.7.0 * * @param string $file Path to the file. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for directories. Default false. * @param bool $recursive Optional. If set to true, changes file permissions recursively. * Default false. * @return bool True on success, false on failure. */ public function chmod($file, $mode = \false, $recursive = \false) { } /** * Changes the owner of a file or directory. * * @since 2.7.0 * * @param string $file Path to the file or directory. * @param string|int $owner A user name or number. * @param bool $recursive Optional. If set to true, changes file owner recursively. * Default false. * @return bool True on success, false on failure. */ public function chown($file, $owner, $recursive = \false) { } /** * Gets the file owner. * * @since 2.7.0 * * @param string $file Path to the file. * @return string|false Username of the owner on success, false on failure. */ public function owner($file) { } /** * Gets the permissions of the specified file or filepath in their octal format. * * @since 2.7.0 * * @param string $file Path to the file. * @return string Mode of the file (the last 3 digits). */ public function getchmod($file) { } /** * Gets the file's group. * * @since 2.7.0 * * @param string $file Path to the file. * @return string|false The group on success, false on failure. */ public function group($file) { } /** * Copies a file. * * @since 2.7.0 * * @param string $source Path to the source file. * @param string $destination Path to the destination file. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists. * Default false. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files, * 0755 for dirs. Default false. * @return bool True on success, false on failure. */ public function copy($source, $destination, $overwrite = \false, $mode = \false) { } /** * Moves a file or directory. * * After moving files or directories, OPcache will need to be invalidated. * * If moving a directory fails, `copy_dir()` can be used for a recursive copy. * * Use `move_dir()` for moving directories with OPcache invalidation and a * fallback to `copy_dir()`. * * @since 2.7.0 * * @param string $source Path to the source file or directory. * @param string $destination Path to the destination file or directory. * @param bool $overwrite Optional. Whether to overwrite the destination if it exists. * Default false. * @return bool True on success, false on failure. */ public function move($source, $destination, $overwrite = \false) { } /** * Deletes a file or directory. * * @since 2.7.0 * * @param string $file Path to the file or directory. * @param bool $recursive Optional. If set to true, deletes files and folders recursively. * Default false. * @param string|false $type Type of resource. 'f' for file, 'd' for directory. * Default false. * @return bool True on success, false on failure. */ public function delete($file, $recursive = \false, $type = \false) { } /** * Checks if a file or directory exists. * * @since 2.7.0 * * @param string $path Path to file or directory. * @return bool Whether $path exists or not. */ public function exists($path) { } /** * Checks if resource is a file. * * @since 2.7.0 * * @param string $file File path. * @return bool Whether $file is a file. */ public function is_file($file) { } /** * Checks if resource is a directory. * * @since 2.7.0 * * @param string $path Directory path. * @return bool Whether $path is a directory. */ public function is_dir($path) { } /** * Checks if a file is readable. * * @since 2.7.0 * * @param string $file Path to file. * @return bool Whether $file is readable. */ public function is_readable($file) { } /** * Checks if a file or directory is writable. * * @since 2.7.0 * * @param string $path Path to file or directory. * @return bool Whether $path is writable. */ public function is_writable($path) { } /** * Gets the file's last access time. * * @since 2.7.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing last access time, false on failure. */ public function atime($file) { } /** * Gets the file modification time. * * @since 2.7.0 * * @param string $file Path to file. * @return int|false Unix timestamp representing modification time, false on failure. */ public function mtime($file) { } /** * Gets the file size (in bytes). * * @since 2.7.0 * * @param string $file Path to file. * @return int|false Size of the file in bytes on success, false on failure. */ public function size($file) { } /** * Sets the access and modification times of a file. * * Note: Not implemented. * * @since 2.7.0 * * @param string $file Path to file. * @param int $time Optional. Modified time to set for file. * Default 0. * @param int $atime Optional. Access time to set for file. * Default 0. */ public function touch($file, $time = 0, $atime = 0) { } /** * Creates a directory. * * @since 2.7.0 * * @param string $path Path for new directory. * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). * Default false. * @param string|int|false $chown Optional. A user name or number (or false to skip chown). * Default false. * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp). * Default false. * @return bool True on success, false on failure. */ public function mkdir($path, $chmod = \false, $chown = \false, $chgrp = \false) { } /** * Deletes a directory. * * @since 2.7.0 * * @param string $path Path to directory. * @param bool $recursive Optional. Whether to recursively remove files/directories. * Default false. * @return bool True on success, false on failure. */ public function rmdir($path, $recursive = \false) { } /** * Gets details for files in a directory or a specific file. * * @since 2.7.0 * * @param string $path Path to directory or file. * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files. * Default true. * @param bool $recursive Optional. Whether to recursively include file details in nested directories. * Default false. * @return array|false { * Array of arrays containing file information. False if unable to list directory contents. * * @type array ...$0 { * Array of file information. Note that some elements may not be available on all filesystems. * * @type string $name Name of the file or directory. * @type string $perms *nix representation of permissions. * @type string $permsn Octal representation of permissions. * @type false $number File number. Always false in this context. * @type string|false $owner Owner name or ID, or false if not available. * @type string|false $group File permissions group, or false if not available. * @type int|string|false $size Size of file in bytes. May be a numeric string. * False if not available. * @type int|string|false $lastmodunix Last modified unix timestamp. May be a numeric string. * False if not available. * @type string|false $lastmod Last modified month (3 letters) and day (without leading 0), or * false if not available. * @type string|false $time Last modified time, or false if not available. * @type string $type Type of resource. 'f' for file, 'd' for directory, 'l' for link. * @type array|false $files If a directory and `$recursive` is true, contains another array of * files. False if unable to list directory contents. * } * } * @phpstan-return false|array * @phpstan-return false|array */ public function dirlist($path, $include_hidden = \true, $recursive = \false) { } } /** * WP_Importer base class */ #[\AllowDynamicProperties] class WP_Importer { /** * Class Constructor */ public function __construct() { } /** * Returns array with imported permalinks from WordPress database. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $importer_name * @param string $blog_id * @return array */ public function get_imported_posts($importer_name, $blog_id) { } /** * Returns count of imported permalinks from WordPress database. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $importer_name * @param string $blog_id * @return int */ public function count_imported_posts($importer_name, $blog_id) { } /** * Sets array with imported comments from WordPress database. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $blog_id * @return array */ public function get_imported_comments($blog_id) { } /** * @param int $blog_id * @return int|void */ public function set_blog($blog_id) { } /** * @param int $user_id * @return int|void */ public function set_user($user_id) { } /** * Sorts by strlen, longest string first. * * @param string $a * @param string $b * @return int */ public function cmpr_strlen($a, $b) { } /** * Gets URL. * * @param string $url * @param string $username * @param string $password * @param bool $head * @return array */ public function get_page($url, $username = '', $password = '', $head = \false) { } /** * Bumps up the request timeout for http requests. * * @param int $val * @return int */ public function bump_request_timeout($val) { } /** * Checks if user has exceeded disk quota. * * @return bool */ public function is_user_over_quota() { } /** * Replaces newlines, tabs, and multiple spaces with a single space. * * @param string $text * @return string */ public function min_whitespace($text) { } /** * Resets global variables that grow out of control during imports. * * @since 3.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global int[] $wp_actions */ public function stop_the_insanity() { } } /** * Core class used to implement an internal admin pointers API. * * @since 3.3.0 */ #[\AllowDynamicProperties] final class WP_Internal_Pointers { /** * Initializes the new feature pointers. * * @since 3.3.0 * * All pointers can be disabled using the following: * remove_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) ); * * Individual pointers (e.g. wp390_widgets) can be disabled using the following: * * function yourprefix_remove_pointers() { * remove_action( * 'admin_print_footer_scripts', * array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) * ); * } * add_action( 'admin_enqueue_scripts', 'yourprefix_remove_pointers', 11 ); * * @param string $hook_suffix The current admin page. * @phpstan-return void */ public static function enqueue_scripts($hook_suffix) { } public static function pointer_wp330_toolbar() { } public static function pointer_wp330_media_uploader() { } public static function pointer_wp330_saving_widgets() { } public static function pointer_wp340_customize_current_theme_link() { } public static function pointer_wp340_choose_image_from_library() { } public static function pointer_wp350_media() { } public static function pointer_wp360_revisions() { } public static function pointer_wp360_locks() { } public static function pointer_wp390_widgets() { } public static function pointer_wp410_dfw() { } public static function pointer_wp496_privacy() { } /** * Prevents new users from seeing existing 'new feature' pointers. * * @since 3.3.0 * * @param int $user_id User ID. */ public static function dismiss_pointers_for_new_users($user_id) { } } /** * Core class used to implement displaying links in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Links_List_Table extends \WP_List_Table { /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * @return bool */ public function ajax_user_can() { } /** * @global int $cat_id * @global string $s * @global string $orderby * @global string $order */ public function prepare_items() { } /** */ public function no_items() { } /** * @return array */ protected function get_bulk_actions() { } /** * @global int $cat_id * @param string $which * @phpstan-return void */ protected function extra_tablenav($which) { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'name'. */ protected function get_default_primary_column_name() { } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$link` to `$item` to match parent class for PHP 8 named parameter support. * * @param object $item The current link object. */ public function column_cb($item) { } /** * Handles the link name column output. * * @since 4.3.0 * * @param object $link The current link object. */ public function column_name($link) { } /** * Handles the link URL column output. * * @since 4.3.0 * * @param object $link The current link object. */ public function column_url($link) { } /** * Handles the link categories column output. * * @since 4.3.0 * * @global int $cat_id * * @param object $link The current link object. */ public function column_categories($link) { } /** * Handles the link relation column output. * * @since 4.3.0 * * @param object $link The current link object. */ public function column_rel($link) { } /** * Handles the link visibility column output. * * @since 4.3.0 * * @param object $link The current link object. */ public function column_visible($link) { } /** * Handles the link rating column output. * * @since 4.3.0 * * @param object $link The current link object. */ public function column_rating($link) { } /** * Handles the default column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$link` to `$item` to match parent class for PHP 8 named parameter support. * * @param object $item Link object. * @param string $column_name Current column name. */ public function column_default($item, $column_name) { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Generates and displays row action links. * * @since 4.3.0 * @since 5.9.0 Renamed `$link` to `$item` to match parent class for PHP 8 named parameter support. * * @param object $item Link being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for links, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions($item, $column_name, $primary) { } } /** * Helper class to be used only by back compat functions. * * @since 3.1.0 */ class _WP_List_Table_Compat extends \WP_List_Table { public $_screen; public $_columns; /** * Constructor. * * @since 3.1.0 * * @param string|WP_Screen $screen The screen hook name or screen object. * @param string[] $columns An array of columns with column IDs as the keys * and translated column names as the values. */ public function __construct($screen, $columns = array()) { } /** * Gets a list of all, hidden, and sortable columns. * * @since 3.1.0 * * @return array */ protected function get_column_info() { } /** * Gets a list of columns. * * @since 3.1.0 * * @return array */ public function get_columns() { } } /** * Core class used to implement displaying media items in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Media_List_Table extends \WP_List_Table { /** * Holds the number of pending comments for each post. * * @since 4.4.0 * @var array */ protected $comment_pending_count = array(); /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * @return bool */ public function ajax_user_can() { } /** * @global string $mode List table view mode. * @global WP_Query $wp_query WordPress Query object. * @global array $post_mime_types * @global array $avail_post_mime_types */ public function prepare_items() { } /** * @global array $post_mime_types * @global array $avail_post_mime_types * @return array */ protected function get_views() { } /** * @return array */ protected function get_bulk_actions() { } /** * @param string $which * @phpstan-return void */ protected function extra_tablenav($which) { } /** * @return string */ public function current_action() { } /** * @return bool */ public function has_items() { } /** */ public function no_items() { } /** * Overrides parent views to use the filter bar display. * * @global string $mode List table view mode. */ public function views() { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item The current WP_Post object. */ public function column_cb($item) { } /** * Handles the title column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_title($post) { } /** * Handles the author column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_author($post) { } /** * Handles the description column output. * * @since 4.3.0 * @deprecated 6.2.0 * * @param WP_Post $post The current WP_Post object. */ public function column_desc($post) { } /** * Handles the date column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_date($post) { } /** * Handles the parent column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_parent($post) { } /** * Handles the comments column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_comments($post) { } /** * Handles output for the default column. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item The current WP_Post object. * @param string $column_name Current column name. * @phpstan-return void */ public function column_default($item, $column_name) { } /** * Generates the list table rows. * * @since 3.1.0 * * @global WP_Post $post Global post object. * @global WP_Query $wp_query WordPress Query object. */ public function display_rows() { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'title'. */ protected function get_default_primary_column_name() { } /** * Generates and displays row action links. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item Attachment being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for media attachments, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions($item, $column_name, $primary) { } } /** * Core class used to implement displaying sites in a list table for the network admin. * * @since 3.1.0 * * @see WP_List_Table */ class WP_MS_Sites_List_Table extends \WP_List_Table { /** * Site status list. * * @since 4.3.0 * @var array */ public $status_list; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * @return bool */ public function ajax_user_can() { } /** * Prepares the list of sites for display. * * @since 3.1.0 * * @global string $mode List table view mode. * @global string $s * @global wpdb $wpdb WordPress database abstraction object. */ public function prepare_items() { } /** */ public function no_items() { } /** * Gets links to filter sites by status. * * @since 5.3.0 * * @return array */ protected function get_views() { } /** * @return array */ protected function get_bulk_actions() { } /** * @global string $mode List table view mode. * * @param string $which The location of the pagination nav markup: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which */ protected function pagination($which) { } /** * Displays extra controls between bulk actions and pagination. * * @since 5.3.0 * * @param string $which The location of the extra table nav markup: Either 'top' or 'bottom'. * @phpstan-param 'top'|'bottom' $which */ protected function extra_tablenav($which) { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$blog` to `$item` to match parent class for PHP 8 named parameter support. * * @param array $item Current site. */ public function column_cb($item) { } /** * Handles the ID column output. * * @since 4.4.0 * * @param array $blog Current site. */ public function column_id($blog) { } /** * Handles the site name column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param array $blog Current site. */ public function column_blogname($blog) { } /** * Handles the lastupdated column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param array $blog Current site. */ public function column_lastupdated($blog) { } /** * Handles the registered column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param array $blog Current site. */ public function column_registered($blog) { } /** * Handles the users column output. * * @since 4.3.0 * * @param array $blog Current site. */ public function column_users($blog) { } /** * Handles the plugins column output. * * @since 4.3.0 * * @param array $blog Current site. */ public function column_plugins($blog) { } /** * Handles output for the default column. * * @since 4.3.0 * @since 5.9.0 Renamed `$blog` to `$item` to match parent class for PHP 8 named parameter support. * * @param array $item Current site. * @param string $column_name Current column name. */ public function column_default($item, $column_name) { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Determines whether to output comma-separated site states. * * @since 5.3.0 * * @param array $site */ protected function site_states($site) { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'blogname'. */ protected function get_default_primary_column_name() { } /** * Generates and displays row action links. * * @since 4.3.0 * @since 5.9.0 Renamed `$blog` to `$item` to match parent class for PHP 8 named parameter support. * * @param array $item Site being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for sites in Multisite, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions($item, $column_name, $primary) { } } /** * Core class used to implement displaying themes in a list table for the network admin. * * @since 3.1.0 * * @see WP_List_Table */ class WP_MS_Themes_List_Table extends \WP_List_Table { public $site_id; public $is_site_themes; /** * Whether to show the auto-updates UI. * * @since 5.5.0 * * @var bool True if auto-updates UI is to be shown, false otherwise. */ protected $show_autoupdates = \true; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @global string $status * @global int $page * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * @return array */ protected function get_table_classes() { } /** * @return bool */ public function ajax_user_can() { } /** * @global string $status * @global array $totals * @global int $page * @global string $orderby * @global string $order * @global string $s */ public function prepare_items() { } /** * @param WP_Theme $theme * @return bool */ public function _search_callback($theme) { } /** * @global string $orderby * @global string $order * @param array $theme_a * @param array $theme_b * @return int */ public function _order_callback($theme_a, $theme_b) { } /** */ public function no_items() { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * Gets the name of the primary column. * * @since 4.3.0 * * @return string Unalterable name of the primary column name, in this case, 'name'. */ protected function get_primary_column_name() { } /** * @global array $totals * @global string $status * @return array */ protected function get_views() { } /** * @global string $status * * @return array */ protected function get_bulk_actions() { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Theme $item The current WP_Theme object. */ public function column_cb($item) { } /** * Handles the name column output. * * @since 4.3.0 * * @global string $status * @global int $page * @global string $s * * @param WP_Theme $theme The current WP_Theme object. */ public function column_name($theme) { } /** * Handles the description column output. * * @since 4.3.0 * * @global string $status * @global array $totals * * @param WP_Theme $theme The current WP_Theme object. */ public function column_description($theme) { } /** * Handles the auto-updates column output. * * @since 5.5.0 * * @global string $status * @global int $page * * @param WP_Theme $theme The current WP_Theme object. */ public function column_autoupdates($theme) { } /** * Handles default column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Theme $item The current WP_Theme object. * @param string $column_name The current column name. */ public function column_default($item, $column_name) { } /** * Handles the output for a single table row. * * @since 4.3.0 * * @param WP_Theme $item The current WP_Theme object. */ public function single_row_columns($item) { } /** * @global string $status * @global array $totals * * @param WP_Theme $theme */ public function single_row($theme) { } } /** * Core class used to implement displaying users in a list table for the network admin. * * @since 3.1.0 * * @see WP_List_Table */ class WP_MS_Users_List_Table extends \WP_List_Table { /** * @return bool */ public function ajax_user_can() { } /** * @global string $mode List table view mode. * @global string $usersearch * @global string $role */ public function prepare_items() { } /** * @return array */ protected function get_bulk_actions() { } /** */ public function no_items() { } /** * @global string $role * @return array */ protected function get_views() { } /** * @global string $mode List table view mode. * * @param string $which */ protected function pagination($which) { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_User $item The current WP_User object. * @phpstan-return void */ public function column_cb($item) { } /** * Handles the ID column output. * * @since 4.4.0 * * @param WP_User $user The current WP_User object. */ public function column_id($user) { } /** * Handles the username column output. * * @since 4.3.0 * * @param WP_User $user The current WP_User object. */ public function column_username($user) { } /** * Handles the name column output. * * @since 4.3.0 * * @param WP_User $user The current WP_User object. */ public function column_name($user) { } /** * Handles the email column output. * * @since 4.3.0 * * @param WP_User $user The current WP_User object. */ public function column_email($user) { } /** * Handles the registered date column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param WP_User $user The current WP_User object. */ public function column_registered($user) { } /** * @since 4.3.0 * * @param WP_User $user * @param string $classes * @param string $data * @param string $primary */ protected function _column_blogs($user, $classes, $data, $primary) { } /** * Handles the sites column output. * * @since 4.3.0 * * @param WP_User $user The current WP_User object. * @phpstan-return void */ public function column_blogs($user) { } /** * Handles the default column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_User $item The current WP_User object. * @param string $column_name The current column name. */ public function column_default($item, $column_name) { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'username'. */ protected function get_default_primary_column_name() { } /** * Generates and displays row action links. * * @since 4.3.0 * @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_User $item User being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for users in Multisite, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions($item, $column_name, $primary) { } } /** * Core class used to implement displaying plugins to install in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Plugin_Install_List_Table extends \WP_List_Table { public $order = 'ASC'; public $orderby = \null; public $groups = array(); /** * @return bool */ public function ajax_user_can() { } /** * Returns the list of known plugins. * * Uses the transient data from the updates API to determine the known * installed plugins. * * @since 4.9.0 * @access protected * * @return array */ protected function get_installed_plugins() { } /** * Returns a list of slugs of installed plugins, if known. * * Uses the transient data from the updates API to determine the slugs of * known installed plugins. This might be better elsewhere, perhaps even * within get_plugins(). * * @since 4.0.0 * * @return array */ protected function get_installed_plugin_slugs() { } /** * @global array $tabs * @global string $tab * @global int $paged * @global string $type * @global string $term * @phpstan-return void */ public function prepare_items() { } /** */ public function no_items() { } /** * @global array $tabs * @global string $tab * * @return array */ protected function get_views() { } /** * Overrides parent views so we can use the filter bar display. */ public function views() { } /** * Displays the plugin install table. * * Overrides the parent display() method to provide a different container. * * @since 4.0.0 */ public function display() { } /** * @global string $tab * * @param string $which * @phpstan-return void */ protected function display_tablenav($which) { } /** * @return array */ protected function get_table_classes() { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Returns a notice containing a list of dependencies required by the plugin. * * @since 6.5.0 * * @param array $plugin_data An array of plugin data. See {@see plugins_api()} * for the list of possible values. * @return string A notice containing a list of dependencies required by the plugin, * or an empty string if none is required. * @phpstan-param object|array{ * slug?: string, * per_page?: int, * page?: int, * number?: int, * search?: string, * tag?: string, * author?: string, * user?: string, * browse?: string, * locale?: string, * installed_plugins?: string, * is_ssl?: bool, * fields?: array{ * short_description?: bool, * description?: bool, * sections?: bool, * tested?: bool, * requires?: bool, * requires_php?: bool, * rating?: bool, * ratings?: bool, * downloaded?: bool, * downloadlink?: bool, * last_updated?: bool, * added?: bool, * tags?: bool, * compatibility?: bool, * homepage?: bool, * versions?: bool, * donate_link?: bool, * reviews?: bool, * banners?: bool, * icons?: bool, * active_installs?: bool, * contributors?: bool, * }, * } $plugin_data See plugins_api() */ protected function get_dependencies_notice($plugin_data) { } /** * Creates a 'More details' link for the plugin. * * @since 6.5.0 * * @param string $name The plugin's name. * @param string $slug The plugin's slug. * @return string The 'More details' link for the plugin. */ protected function get_more_details_link($name, $slug) { } } /** * Core class used to implement displaying installed plugins in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Plugins_List_Table extends \WP_List_Table { /** * Whether to show the auto-updates UI. * * @since 5.5.0 * * @var bool True if auto-updates UI is to be shown, false otherwise. */ protected $show_autoupdates = \true; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @global string $status * @global int $page * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * @return array */ protected function get_table_classes() { } /** * @return bool */ public function ajax_user_can() { } /** * @global string $status * @global array $plugins * @global array $totals * @global int $page * @global string $orderby * @global string $order * @global string $s */ public function prepare_items() { } /** * @global string $s URL encoded search term. * * @param array $plugin * @return bool */ public function _search_callback($plugin) { } /** * @global string $orderby * @global string $order * @param array $plugin_a * @param array $plugin_b * @return int */ public function _order_callback($plugin_a, $plugin_b) { } /** * @global array $plugins */ public function no_items() { } /** * Displays the search box. * * @since 4.6.0 * * @param string $text The 'submit' button label. * @param string $input_id ID attribute value for the search input field. * @phpstan-return void */ public function search_box($text, $input_id) { } /** * @global string $status * * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * @global array $totals * @global string $status * @return array */ protected function get_views() { } /** * @global string $status * @return array */ protected function get_bulk_actions() { } /** * @global string $status * @param string $which * @phpstan-return void */ public function bulk_actions($which = '') { } /** * @global string $status * @param string $which * @phpstan-return void */ protected function extra_tablenav($which) { } /** * @return string */ public function current_action() { } /** * Generates the list table rows. * * @since 3.1.0 * * @global string $status * @phpstan-return void */ public function display_rows() { } /** * @global string $status * @global int $page * @global string $s * @global array $totals * * @param array $item */ public function single_row($item) { } /** * Gets the name of the primary column for this specific list table. * * @since 4.3.0 * * @return string Unalterable name for the primary column, in this case, 'name'. */ protected function get_primary_column_name() { } /** * Prints a list of other plugins that depend on the plugin. * * @since 6.5.0 * * @param string $dependency The dependency's filepath, relative to the plugins directory. * @phpstan-return void */ protected function add_dependents_to_dependency_plugin_row($dependency) { } /** * Prints a list of other plugins that the plugin depends on. * * @since 6.5.0 * * @param string $dependent The dependent plugin's filepath, relative to the plugins directory. * @phpstan-return void */ protected function add_dependencies_to_dependent_plugin_row($dependent) { } /** * Returns a 'View details' like link for a dependency. * * @since 6.5.0 * * @param string $name The dependency's name. * @param string $slug The dependency's slug. * @return string A 'View details' link for the dependency. */ protected function get_dependency_view_details_link($name, $slug) { } /** * Returns a 'View details' link for the plugin. * * @since 6.5.0 * * @param string $name The plugin's name. * @param string $slug The plugin's slug. * @return string A 'View details' link for the plugin. */ protected function get_view_details_link($name, $slug) { } } /** * Core class used to implement displaying post comments in a list table. * * @since 3.1.0 * * @see WP_Comments_List_Table */ class WP_Post_Comments_List_Table extends \WP_Comments_List_Table { /** * @return array */ protected function get_column_info() { } /** * @return array */ protected function get_table_classes() { } /** * @param bool $output_empty */ public function display($output_empty = \false) { } /** * @param bool $comment_status * @return int */ public function get_per_page($comment_status = \false) { } } /** * Core class used to implement displaying posts in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Posts_List_Table extends \WP_List_Table { /** * Whether the items should be displayed hierarchically or linearly. * * @since 3.1.0 * @var bool */ protected $hierarchical_display; /** * Holds the number of pending comments for each post. * * @since 3.1.0 * @var array */ protected $comment_pending_count; /** * Current level for output. * * @since 4.3.0 * @var int */ protected $current_level = 0; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @global WP_Post_Type $post_type_object Global post type object. * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * Sets whether the table layout should be hierarchical or not. * * @since 4.2.0 * * @param bool $display Whether the table layout should be hierarchical. */ public function set_hierarchical_display($display) { } /** * @return bool */ public function ajax_user_can() { } /** * @global string $mode List table view mode. * @global array $avail_post_stati * @global WP_Query $wp_query WordPress Query object. * @global int $per_page */ public function prepare_items() { } /** * @return bool */ public function has_items() { } /** */ public function no_items() { } /** * Determines if the current view is the "All" view. * * @since 4.2.0 * * @return bool Whether the current view is the "All" view. */ protected function is_base_request() { } /** * Creates a link to edit.php with params. * * @since 4.4.0 * * @param string[] $args Associative array of URL parameters for the link. * @param string $link_text Link text. * @param string $css_class Optional. Class attribute. Default empty string. * @return string The formatted link string. */ protected function get_edit_link($args, $link_text, $css_class = '') { } /** * @global array $locked_post_status This seems to be deprecated. * @global array $avail_post_stati * @return array */ protected function get_views() { } /** * @return array */ protected function get_bulk_actions() { } /** * Displays a categories drop-down for filtering on the Posts list table. * * @since 4.6.0 * * @global int $cat Currently selected category. * * @param string $post_type Post type slug. * @phpstan-return void */ protected function categories_dropdown($post_type) { } /** * Displays a formats drop-down for filtering items. * * @since 5.2.0 * @access protected * * @param string $post_type Post type slug. * @phpstan-return void */ protected function formats_dropdown($post_type) { } /** * @param string $which */ protected function extra_tablenav($which) { } /** * @return string */ public function current_action() { } /** * @global string $mode List table view mode. * * @return array */ protected function get_table_classes() { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * Generates the list table rows. * * @since 3.1.0 * * @global WP_Query $wp_query WordPress Query object. * @global int $per_page * * @param array $posts * @param int $level */ public function display_rows($posts = array(), $level = 0) { } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item The current WP_Post object. */ public function column_cb($item) { } /** * @since 4.3.0 * * @param WP_Post $post * @param string $classes * @param string $data * @param string $primary */ protected function _column_title($post, $classes, $data, $primary) { } /** * Handles the title column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param WP_Post $post The current WP_Post object. */ public function column_title($post) { } /** * Handles the post date column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param WP_Post $post The current WP_Post object. */ public function column_date($post) { } /** * Handles the comments column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_comments($post) { } /** * Handles the post author column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_author($post) { } /** * Handles the default column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item The current WP_Post object. * @param string $column_name The current column name. * @phpstan-return void */ public function column_default($item, $column_name) { } /** * @global WP_Post $post Global post object. * * @param int|WP_Post $post * @param int $level */ public function single_row($post, $level = 0) { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'title'. */ protected function get_default_primary_column_name() { } /** * Generates and displays row action links. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item Post being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for posts, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions($item, $column_name, $primary) { } /** * Outputs the hidden row displayed when inline editing * * @since 3.1.0 * * @global string $mode List table view mode. */ public function inline_edit() { } } /** * List Table API: WP_Privacy_Requests_Table class * * @package WordPress * @subpackage Administration * @since 4.9.6 */ abstract class WP_Privacy_Requests_Table extends \WP_List_Table { /** * Action name for the requests this table will work with. Classes * which inherit from WP_Privacy_Requests_Table should define this. * * Example: 'export_personal_data'. * * @since 4.9.6 * * @var string $request_type Name of action. */ protected $request_type = 'INVALID'; /** * Post type to be used. * * @since 4.9.6 * * @var string $post_type The post type. */ protected $post_type = 'INVALID'; /** * Gets columns to show in the list table. * * @since 4.9.6 * * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * Normalizes the admin URL to the current page (by request_type). * * @since 5.3.0 * * @return string URL to the current admin page. */ protected function get_admin_url() { } /** * Gets a list of sortable columns. * * @since 4.9.6 * * @return array Default sortable columns. */ protected function get_sortable_columns() { } /** * Returns the default primary column. * * @since 4.9.6 * * @return string Default primary column name. */ protected function get_default_primary_column_name() { } /** * Counts the number of requests for each status. * * @since 4.9.6 * * @global wpdb $wpdb WordPress database abstraction object. * * @return object Number of posts for each status. */ protected function get_request_counts() { } /** * Gets an associative array ( id => link ) with the list of views available on this table. * * @since 4.9.6 * * @return string[] An array of HTML links keyed by their view. */ protected function get_views() { } /** * Gets bulk actions. * * @since 4.9.6 * * @return array Array of bulk action labels keyed by their action. */ protected function get_bulk_actions() { } /** * Process bulk actions. * * @since 4.9.6 * @since 5.6.0 Added support for the `complete` action. * @phpstan-return void */ public function process_bulk_action() { } /** * Prepares items to output. * * @since 4.9.6 * @since 5.1.0 Added support for column sorting. */ public function prepare_items() { } /** * Returns the markup for the Checkbox column. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. * @return string Checkbox column markup. */ public function column_cb($item) { } /** * Status column. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. * @return string Status column markup. */ public function column_status($item) { } /** * Converts a timestamp for display. * * @since 4.9.6 * * @param int $timestamp Event timestamp. * @return string Human readable date. */ protected function get_timestamp_as_date($timestamp) { } /** * Handles the default column. * * @since 4.9.6 * @since 5.7.0 Added `manage_{$this->screen->id}_custom_column` action. * * @param WP_User_Request $item Item being shown. * @param string $column_name Name of column being shown. */ public function column_default($item, $column_name) { } /** * Returns the markup for the Created timestamp column. Overridden by children. * * @since 5.7.0 * * @param WP_User_Request $item Item being shown. * @return string Human readable date. */ public function column_created_timestamp($item) { } /** * Actions column. Overridden by children. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. * @return string Email column markup. */ public function column_email($item) { } /** * Returns the markup for the next steps column. Overridden by children. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. */ public function column_next_steps($item) { } /** * Generates content for a single row of the table, * * @since 4.9.6 * * @param WP_User_Request $item The current item. */ public function single_row($item) { } /** * Embeds scripts used to perform actions. Overridden by children. * * @since 4.9.6 */ public function embed_scripts() { } } /** * WP_Privacy_Data_Export_Requests_Table class. * * @since 4.9.6 */ class WP_Privacy_Data_Export_Requests_List_Table extends \WP_Privacy_Requests_Table { /** * Action name for the requests this table will work with. * * @since 4.9.6 * * @var string $request_type Name of action. */ protected $request_type = 'export_personal_data'; /** * Post type for the requests. * * @since 4.9.6 * * @var string $post_type The post type. */ protected $post_type = 'user_request'; /** * Actions column. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. * @return string Email column markup. */ public function column_email($item) { } /** * Displays the next steps column. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. */ public function column_next_steps($item) { } } /** * WP_Privacy_Data_Removal_Requests_List_Table class. * * @since 4.9.6 */ class WP_Privacy_Data_Removal_Requests_List_Table extends \WP_Privacy_Requests_Table { /** * Action name for the requests this table will work with. * * @since 4.9.6 * * @var string $request_type Name of action. */ protected $request_type = 'remove_personal_data'; /** * Post type for the requests. * * @since 4.9.6 * * @var string $post_type The post type. */ protected $post_type = 'user_request'; /** * Outputs the Actions column. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. * @return string Email column markup. */ public function column_email($item) { } /** * Outputs the Next steps column. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. */ public function column_next_steps($item) { } } /** * WP_Privacy_Policy_Content class. * * @package WordPress * @subpackage Administration * @since 4.9.6 */ #[\AllowDynamicProperties] final class WP_Privacy_Policy_Content { /** * Adds content to the postbox shown when editing the privacy policy. * * Plugins and themes should suggest text for inclusion in the site's privacy policy. * The suggested text should contain information about any functionality that affects user privacy, * and will be shown in the Suggested Privacy Policy Content postbox. * * Intended for use from `wp_add_privacy_policy_content()`. * * @since 4.9.6 * * @param string $plugin_name The name of the plugin or theme that is suggesting content for the site's privacy policy. * @param string $policy_text The suggested content for inclusion in the policy. * @phpstan-return void */ public static function add($plugin_name, $policy_text) { } /** * Performs a quick check to determine whether any privacy info has changed. * * @since 4.9.6 */ public static function text_change_check() { } /** * Outputs a warning when some privacy info has changed. * * @since 4.9.6 * @phpstan-return void */ public static function policy_text_changed_notice() { } /** * Updates the cached policy info when the policy page is updated. * * @since 4.9.6 * @access private * * @param int $post_id The ID of the updated post. * @phpstan-return void */ public static function _policy_page_updated($post_id) { } /** * Checks for updated, added or removed privacy policy information from plugins. * * Caches the current info in post_meta of the policy page. * * @since 4.9.6 * * @return array The privacy policy text/information added by core and plugins. */ public static function get_suggested_policy_text() { } /** * Adds a notice with a link to the guide when editing the privacy policy page. * * @since 4.9.6 * @since 5.0.0 The `$post` parameter was made optional. * * @global WP_Post $post Global post object. * * @param WP_Post|null $post The currently edited post. Default null. * @phpstan-return void */ public static function notice($post = \null) { } /** * Outputs the privacy policy guide together with content from the theme and plugins. * * @since 4.9.6 */ public static function privacy_policy_guide() { } /** * Returns the default suggested privacy policy content. * * @since 4.9.6 * @since 5.0.0 Added the `$blocks` parameter. * * @param bool $description Whether to include the descriptions under the section headings. Default false. * @param bool $blocks Whether to format the content for the block editor. Default true. * @return string The default policy content. */ public static function get_default_content($description = \false, $blocks = \true) { } /** * Adds the suggested privacy policy text to the policy postbox. * * @since 4.9.6 */ public static function add_suggested_content() { } } /** * Core class used to implement an admin screen API. * * @since 3.3.0 */ #[\AllowDynamicProperties] final class WP_Screen { /** * Any action associated with the screen. * * 'add' for *-add.php and *-new.php screens. Empty otherwise. * * @since 3.3.0 * @var string */ public $action; /** * The base type of the screen. * * This is typically the same as `$id` but with any post types and taxonomies stripped. * For example, for an `$id` of 'edit-post' the base is 'edit'. * * @since 3.3.0 * @var string */ public $base; /** * The unique ID of the screen. * * @since 3.3.0 * @var string */ public $id; /** * Whether the screen is in the network admin. * * Deprecated. Use in_admin() instead. * * @since 3.3.0 * @deprecated 3.5.0 * @var bool */ public $is_network; /** * Whether the screen is in the user admin. * * Deprecated. Use in_admin() instead. * * @since 3.3.0 * @deprecated 3.5.0 * @var bool */ public $is_user; /** * The base menu parent. * * This is derived from `$parent_file` by removing the query string and any .php extension. * `$parent_file` values of 'edit.php?post_type=page' and 'edit.php?post_type=post' * have a `$parent_base` of 'edit'. * * @since 3.3.0 * @var string|null */ public $parent_base; /** * The parent_file for the screen per the admin menu system. * * Some `$parent_file` values are 'edit.php?post_type=page', 'edit.php', and 'options-general.php'. * * @since 3.3.0 * @var string|null */ public $parent_file; /** * The post type associated with the screen, if any. * * The 'edit.php?post_type=page' screen has a post type of 'page'. * The 'edit-tags.php?taxonomy=$taxonomy&post_type=page' screen has a post type of 'page'. * * @since 3.3.0 * @var string */ public $post_type; /** * The taxonomy associated with the screen, if any. * * The 'edit-tags.php?taxonomy=category' screen has a taxonomy of 'category'. * * @since 3.3.0 * @var string */ public $taxonomy; /** * Whether the screen is using the block editor. * * @since 5.0.0 * @var bool */ public $is_block_editor = \false; /** * Fetches a screen object. * * @since 3.3.0 * * @global string $hook_suffix * * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen. * Defaults to the current $hook_suffix global. * @return WP_Screen Screen object. */ public static function get($hook_name = '') { } /** * Makes the screen object the current screen. * * @see set_current_screen() * @since 3.3.0 * * @global WP_Screen $current_screen WordPress current screen object. * @global string $typenow The post type of the current screen. * @global string $taxnow The taxonomy of the current screen. */ public function set_current_screen() { } /** * Indicates whether the screen is in a particular admin. * * @since 3.5.0 * * @param string $admin The admin to check against (network | user | site). * If empty any of the three admins will result in true. * @return bool True if the screen is in the indicated admin, false otherwise. */ public function in_admin($admin = \null) { } /** * Sets or returns whether the block editor is loading on the current screen. * * @since 5.0.0 * * @param bool $set Optional. Sets whether the block editor is loading on the current screen or not. * @return bool True if the block editor is being loaded, false otherwise. */ public function is_block_editor($set = \null) { } /** * Sets the old string-based contextual help for the screen for backward compatibility. * * @since 3.3.0 * * @param WP_Screen $screen A screen object. * @param string $help Help text. */ public static function add_old_compat_help($screen, $help) { } /** * Sets the parent information for the screen. * * This is called in admin-header.php after the menu parent for the screen has been determined. * * @since 3.3.0 * * @param string $parent_file The parent file of the screen. Typically the $parent_file global. */ public function set_parentage($parent_file) { } /** * Adds an option for the screen. * * Call this in template files after admin.php is loaded and before admin-header.php is loaded * to add screen options. * * @since 3.3.0 * * @param string $option Option ID. * @param mixed $args Option-dependent arguments. */ public function add_option($option, $args = array()) { } /** * Removes an option from the screen. * * @since 3.8.0 * * @param string $option Option ID. */ public function remove_option($option) { } /** * Removes all options from the screen. * * @since 3.8.0 */ public function remove_options() { } /** * Gets the options registered for the screen. * * @since 3.8.0 * * @return array Options with arguments. */ public function get_options() { } /** * Gets the arguments for an option for the screen. * * @since 3.3.0 * * @param string $option Option name. * @param string|false $key Optional. Specific array key for when the option is an array. * Default false. * @return string The option value if set, null otherwise. */ public function get_option($option, $key = \false) { } /** * Gets the help tabs registered for the screen. * * @since 3.4.0 * @since 4.4.0 Help tabs are ordered by their priority. * * @return array Help tabs with arguments. */ public function get_help_tabs() { } /** * Gets the arguments for a help tab. * * @since 3.4.0 * * @param string $id Help Tab ID. * @return array Help tab arguments. */ public function get_help_tab($id) { } /** * Adds a help tab to the contextual help for the screen. * * Call this on the `load-$pagenow` hook for the relevant screen, * or fetch the `$current_screen` object, or use get_current_screen() * and then call the method from the object. * * You may need to filter `$current_screen` using an if or switch statement * to prevent new help tabs from being added to ALL admin screens. * * @since 3.3.0 * @since 4.4.0 The `$priority` argument was added. * * @param array $args { * Array of arguments used to display the help tab. * * @type string $title Title for the tab. Default false. * @type string $id Tab ID. Must be HTML-safe and should be unique for this menu. * It is NOT allowed to contain any empty spaces. Default false. * @type string $content Optional. Help tab content in plain text or HTML. Default empty string. * @type callable $callback Optional. A callback to generate the tab content. Default false. * @type int $priority Optional. The priority of the tab, used for ordering. Default 10. * } * @phpstan-param array{ * title?: string, * id?: string, * content?: string, * callback?: callable, * priority?: int, * } $args * @phpstan-return void */ public function add_help_tab($args) { } /** * Removes a help tab from the contextual help for the screen. * * @since 3.3.0 * * @param string $id The help tab ID. */ public function remove_help_tab($id) { } /** * Removes all help tabs from the contextual help for the screen. * * @since 3.3.0 */ public function remove_help_tabs() { } /** * Gets the content from a contextual help sidebar. * * @since 3.4.0 * * @return string Contents of the help sidebar. */ public function get_help_sidebar() { } /** * Adds a sidebar to the contextual help for the screen. * * Call this in template files after admin.php is loaded and before admin-header.php is loaded * to add a sidebar to the contextual help. * * @since 3.3.0 * * @param string $content Sidebar content in plain text or HTML. */ public function set_help_sidebar($content) { } /** * Gets the number of layout columns the user has selected. * * The layout_columns option controls the max number and default number of * columns. This method returns the number of columns within that range selected * by the user via Screen Options. If no selection has been made, the default * provisioned in layout_columns is returned. If the screen does not support * selecting the number of layout columns, 0 is returned. * * @since 3.4.0 * * @return int Number of columns to display. */ public function get_columns() { } /** * Gets the accessible hidden headings and text used in the screen. * * @since 4.4.0 * * @see set_screen_reader_content() For more information on the array format. * * @return string[] An associative array of screen reader text strings. */ public function get_screen_reader_content() { } /** * Gets a screen reader text string. * * @since 4.4.0 * * @param string $key Screen reader text array named key. * @return string Screen reader text string. */ public function get_screen_reader_text($key) { } /** * Adds accessible hidden headings and text for the screen. * * @since 4.4.0 * * @param array $content { * An associative array of screen reader text strings. * * @type string $heading_views Screen reader text for the filter links heading. * Default 'Filter items list'. * @type string $heading_pagination Screen reader text for the pagination heading. * Default 'Items list navigation'. * @type string $heading_list Screen reader text for the items list heading. * Default 'Items list'. * } * @phpstan-param array{ * heading_views?: string, * heading_pagination?: string, * heading_list?: string, * } $content */ public function set_screen_reader_content($content = array()) { } /** * Removes all the accessible hidden headings and text for the screen. * * @since 4.4.0 */ public function remove_screen_reader_content() { } /** * Renders the screen's help section. * * This will trigger the deprecated filters for backward compatibility. * * @since 3.3.0 * * @global string $screen_layout_columns * @phpstan-return void */ public function render_screen_meta() { } /** * @global array $wp_meta_boxes Global meta box state. * * @return bool */ public function show_screen_options() { } /** * Renders the screen options tab. * * @since 3.3.0 * * @param array $options { * Options for the tab. * * @type bool $wrap Whether the screen-options-wrap div will be included. Defaults to true. * } * @phpstan-param array{ * wrap?: bool, * } $options */ public function render_screen_options($options = array()) { } /** * Renders the meta boxes preferences. * * @since 4.4.0 * * @global array $wp_meta_boxes Global meta box state. * @phpstan-return void */ public function render_meta_boxes_preferences() { } /** * Renders the list table columns preferences. * * @since 4.4.0 * @phpstan-return void */ public function render_list_table_columns_preferences() { } /** * Renders the option for number of columns on the page. * * @since 3.3.0 * @phpstan-return void */ public function render_screen_layout() { } /** * Renders the items per page option. * * @since 3.3.0 * @phpstan-return void */ public function render_per_page_options() { } /** * Renders the list table view mode preferences. * * @since 4.4.0 * * @global string $mode List table view mode. * @phpstan-return void */ public function render_view_mode() { } /** * Renders screen reader text. * * @since 4.4.0 * * @param string $key The screen reader text array named key. * @param string $tag Optional. The HTML tag to wrap the screen reader text. Default h2. * @phpstan-return void */ public function render_screen_reader_content($key = '', $tag = 'h2') { } } /** * Class for testing automatic updates in the WordPress code. * * @package WordPress * @subpackage Site_Health * @since 5.2.0 */ #[\AllowDynamicProperties] class WP_Site_Health_Auto_Updates { /** * WP_Site_Health_Auto_Updates constructor. * * @since 5.2.0 */ public function __construct() { } /** * Runs tests to determine if auto-updates can run. * * @since 5.2.0 * * @return array The test results. */ public function run_tests() { } /** * Tests if auto-updates related constants are set correctly. * * @since 5.2.0 * @since 5.5.1 The `$value` parameter can accept an array. * * @param string $constant The name of the constant to check. * @param bool|string|array $value The value that the constant should be, if set, * or an array of acceptable values. * @return array The test results. */ public function test_constants($constant, $value) { } /** * Checks if updates are intercepted by a filter. * * @since 5.2.0 * * @return array The test results. */ public function test_wp_version_check_attached() { } /** * Checks if automatic updates are disabled by a filter. * * @since 5.2.0 * * @return array The test results. */ public function test_filters_automatic_updater_disabled() { } /** * Checks if automatic updates are disabled. * * @since 5.3.0 * * @return array|false The test results. False if auto-updates are enabled. */ public function test_wp_automatic_updates_disabled() { } /** * Checks if automatic updates have tried to run, but failed, previously. * * @since 5.2.0 * * @return array|false The test results. False if the auto-updates failed. */ public function test_if_failed_update() { } /** * Checks if WordPress is controlled by a VCS (Git, Subversion etc). * * @since 5.2.0 * * @return array The test results. */ public function test_vcs_abspath() { } /** * Checks if we can access files without providing credentials. * * @since 5.2.0 * * @return array The test results. */ public function test_check_wp_filesystem_method() { } /** * Checks if core files are writable by the web user/group. * * @since 5.2.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @return array|false The test results. False if they're not writeable. */ public function test_all_files_writable() { } /** * Checks if the install is using a development branch and can use nightly packages. * * @since 5.2.0 * * @return array|false The test results. False if it isn't a development version. */ public function test_accepts_dev_updates() { } /** * Checks if the site supports automatic minor updates. * * @since 5.2.0 * * @return array The test results. */ public function test_accepts_minor_updates() { } } /** * Class for looking up a site's health based on a user's WordPress environment. * * @package WordPress * @subpackage Site_Health * @since 5.2.0 */ #[\AllowDynamicProperties] class WP_Site_Health { public $is_mariadb = \false; public $php_memory_limit; public $schedules; public $crons; public $last_missed_cron = \null; public $last_late_cron = \null; /** * WP_Site_Health constructor. * * @since 5.2.0 */ public function __construct() { } /** * Outputs the content of a tab in the Site Health screen. * * @since 5.8.0 * * @param string $tab Slug of the current tab being displayed. */ public function show_site_health_tab($tab) { } /** * Returns an instance of the WP_Site_Health class, or create one if none exist yet. * * @since 5.4.0 * * @return WP_Site_Health|null */ public static function get_instance() { } /** * Enqueues the site health scripts. * * @since 5.2.0 * @phpstan-return void */ public function enqueue_scripts() { } /** * Tests whether `wp_version_check` is blocked. * * It's possible to block updates with the `wp_version_check` filter, but this can't be checked * during an Ajax call, as the filter is never introduced then. * * This filter overrides a standard page request if it's made by an admin through the Ajax call * with the right query argument to check for this. * * @since 5.2.0 * @phpstan-return void */ public function check_wp_version_check_exists() { } /** * Tests for WordPress version and outputs it. * * Gives various results depending on what kind of updates are available, if any, to encourage * the user to install security updates as a priority. * * @since 5.2.0 * * @return array The test result. */ public function get_test_wordpress_version() { } /** * Tests if plugins are outdated, or unnecessary. * * The test checks if your plugins are up to date, and encourages you to remove any * that are not in use. * * @since 5.2.0 * * @return array The test result. */ public function get_test_plugin_version() { } /** * Tests if themes are outdated, or unnecessary. * * Checks if your site has a default theme (to fall back on if there is a need), * if your themes are up to date and, finally, encourages you to remove any themes * that are not needed. * * @since 5.2.0 * * @return array The test results. */ public function get_test_theme_version() { } /** * Tests if the supplied PHP version is supported. * * @since 5.2.0 * * @return array The test results. */ public function get_test_php_version() { } /** * Tests if required PHP modules are installed on the host. * * This test builds on the recommendations made by the WordPress Hosting Team * as seen at https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions * * @since 5.2.0 * * @return array */ public function get_test_php_extensions() { } /** * Tests if the PHP default timezone is set to UTC. * * @since 5.3.1 * * @return array The test results. */ public function get_test_php_default_timezone() { } /** * Tests if there's an active PHP session that can affect loopback requests. * * @since 5.5.0 * * @return array The test results. */ public function get_test_php_sessions() { } /** * Tests if the SQL server is up to date. * * @since 5.2.0 * * @return array The test results. */ public function get_test_sql_server() { } /** * Tests if the site can communicate with WordPress.org. * * @since 5.2.0 * * @return array The test results. */ public function get_test_dotorg_communication() { } /** * Tests if debug information is enabled. * * When WP_DEBUG is enabled, errors and information may be disclosed to site visitors, * or logged to a publicly accessible file. * * Debugging is also frequently left enabled after looking for errors on a site, * as site owners do not understand the implications of this. * * @since 5.2.0 * * @return array The test results. */ public function get_test_is_in_debug_mode() { } /** * Tests if the site is serving content over HTTPS. * * Many sites have varying degrees of HTTPS support, the most common of which is sites that have it * enabled, but only if you visit the right site address. * * @since 5.2.0 * @since 5.7.0 Updated to rely on {@see wp_is_using_https()} and {@see wp_is_https_supported()}. * * @return array The test results. */ public function get_test_https_status() { } /** * Checks if the HTTP API can handle SSL/TLS requests. * * @since 5.2.0 * * @return array The test result. */ public function get_test_ssl_support() { } /** * Tests if scheduled events run as intended. * * If scheduled events are not running, this may indicate something with WP_Cron is not working * as intended, or that there are orphaned events hanging around from older code. * * @since 5.2.0 * * @return array The test results. */ public function get_test_scheduled_events() { } /** * Tests if WordPress can run automated background updates. * * Background updates in WordPress are primarily used for minor releases and security updates. * It's important to either have these working, or be aware that they are intentionally disabled * for whatever reason. * * @since 5.2.0 * * @return array The test results. */ public function get_test_background_updates() { } /** * Tests if plugin and theme auto-updates appear to be configured correctly. * * @since 5.5.0 * * @return array The test results. */ public function get_test_plugin_theme_auto_updates() { } /** * Tests available disk space for updates. * * @since 6.3.0 * * @return array The test results. */ public function get_test_available_updates_disk_space() { } /** * Tests if plugin and theme temporary backup directories are writable or can be created. * * @since 6.3.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @return array The test results. */ public function get_test_update_temp_backup_writable() { } /** * Tests if loopbacks work as expected. * * A loopback is when WordPress queries itself, for example to start a new WP_Cron instance, * or when editing a plugin or theme. This has shown itself to be a recurring issue, * as code can very easily break this interaction. * * @since 5.2.0 * * @return array The test results. */ public function get_test_loopback_requests() { } /** * Tests if HTTP requests are blocked. * * It's possible to block all outgoing communication (with the possibility of allowing certain * hosts) via the HTTP API. This may create problems for users as many features are running as * services these days. * * @since 5.2.0 * * @return array The test results. */ public function get_test_http_requests() { } /** * Tests if the REST API is accessible. * * Various security measures may block the REST API from working, or it may have been disabled in general. * This is required for the new block editor to work, so we explicitly test for this. * * @since 5.2.0 * * @return array The test results. */ public function get_test_rest_availability() { } /** * Tests if 'file_uploads' directive in PHP.ini is turned off. * * @since 5.5.0 * * @return array The test results. */ public function get_test_file_uploads() { } /** * Tests if the Authorization header has the expected values. * * @since 5.6.0 * * @return array */ public function get_test_authorization_header() { } /** * Tests if a full page cache is available. * * @since 6.1.0 * * @return array The test result. */ public function get_test_page_cache() { } /** * Tests if the site uses persistent object cache and recommends to use it if not. * * @since 6.1.0 * * @return array The test result. */ public function get_test_persistent_object_cache() { } /** * Calculates total amount of autoloaded data. * * @since 6.6.0 * * @return int Autoloaded data in bytes. */ public function get_autoloaded_options_size() { } /** * Tests the number of autoloaded options. * * @since 6.6.0 * * @return array The test results. */ public function get_test_autoloaded_options() { } /** * Returns a set of tests that belong to the site status page. * * Each site status test is defined here, they may be `direct` tests, that run on page load, or `async` tests * which will run later down the line via JavaScript calls to improve page performance and hopefully also user * experiences. * * @since 5.2.0 * @since 5.6.0 Added support for `has_rest` and `permissions`. * * @return array The list of tests to run. */ public static function get_tests() { } /** * Adds a class to the body HTML tag. * * Filters the body class string for admin pages and adds our own class for easier styling. * * @since 5.2.0 * * @param string $body_class The body class string. * @return string The modified body class string. */ public function admin_body_class($body_class) { } /** * Checks if any scheduled tasks have been missed. * * Returns a boolean value of `true` if a scheduled task has been missed and ends processing. * * If the list of crons is an instance of WP_Error, returns the instance instead of a boolean value. * * @since 5.2.0 * * @return bool|WP_Error True if a cron was missed, false if not. WP_Error if the cron is set to that. */ public function has_missed_cron() { } /** * Checks if any scheduled tasks are late. * * Returns a boolean value of `true` if a scheduled task is late and ends processing. * * If the list of crons is an instance of WP_Error, returns the instance instead of a boolean value. * * @since 5.3.0 * * @return bool|WP_Error True if a cron is late, false if not. WP_Error if the cron is set to that. */ public function has_late_cron() { } /** * Checks for potential issues with plugin and theme auto-updates. * * Though there is no way to 100% determine if plugin and theme auto-updates are configured * correctly, a few educated guesses could be made to flag any conditions that would * potentially cause unexpected behaviors. * * @since 5.5.0 * * @return object The test results. */ public function detect_plugin_theme_auto_update_issues() { } /** * Runs a loopback test on the site. * * Loopbacks are what WordPress uses to communicate with itself to start up WP_Cron, scheduled posts, * make sure plugin or theme edits don't cause site failures and similar. * * @since 5.2.0 * * @return object The test results. */ public function can_perform_loopback() { } /** * Creates a weekly cron event, if one does not already exist. * * @since 5.4.0 */ public function maybe_create_scheduled_event() { } /** * Runs the scheduled event to check and update the latest site health status for the website. * * @since 5.4.0 */ public function wp_cron_scheduled_check() { } /** * Checks if the current environment type is set to 'development' or 'local'. * * @since 5.6.0 * * @return bool True if it is a development environment, false if not. */ public function is_development_environment() { } /** * Returns a list of headers and its verification callback to verify if page cache is enabled or not. * * Note: key is header name and value could be callable function to verify header value. * Empty value mean existence of header detect page cache is enabled. * * @since 6.1.0 * * @return array List of client caching headers and their (optional) verification callbacks. */ public function get_page_cache_headers() { } /** * Determines whether to suggest using a persistent object cache. * * @since 6.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return bool Whether to suggest using a persistent object cache. */ public function should_suggest_persistent_object_cache() { } } /** * Core class used to implement site icon functionality. * * @since 4.3.0 */ #[\AllowDynamicProperties] class WP_Site_Icon { /** * The minimum size of the site icon. * * @since 4.3.0 * @var int */ public $min_size = 512; /** * The size to which to crop the image so that we can display it in the UI nicely. * * @since 4.3.0 * @var int */ public $page_crop = 512; /** * List of site icon sizes. * * @since 4.3.0 * @var int[] */ public $site_icon_sizes = array( /* * Square, medium sized tiles for IE11+. * * See https://msdn.microsoft.com/library/dn455106(v=vs.85).aspx */ 270, /* * App icon for Android/Chrome. * * @link https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android * @link https://developer.chrome.com/multidevice/android/installtohomescreen */ 192, /* * App icons up to iPhone 6 Plus. * * See https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html */ 180, // Our regular Favicon. 32, ); /** * Registers actions and filters. * * @since 4.3.0 */ public function __construct() { } /** * Creates an attachment 'object'. * * @since 4.3.0 * @deprecated 6.5.0 * * @param string $cropped Cropped image URL. * @param int $parent_attachment_id Attachment ID of parent image. * @return array An array with attachment object data. */ public function create_attachment_object($cropped, $parent_attachment_id) { } /** * Inserts an attachment. * * @since 4.3.0 * * @param array $attachment An array with attachment object data. * @param string $file File path of the attached image. * @return int Attachment ID. */ public function insert_attachment($attachment, $file) { } /** * Adds additional sizes to be made when creating the site icon images. * * @since 4.3.0 * * @param array[] $sizes Array of arrays containing information for additional sizes. * @return array[] Array of arrays containing additional image sizes. */ public function additional_sizes($sizes = array()) { } /** * Adds Site Icon sizes to the array of image sizes on demand. * * @since 4.3.0 * * @param string[] $sizes Array of image size names. * @return string[] Array of image size names. */ public function intermediate_image_sizes($sizes = array()) { } /** * Deletes the Site Icon when the image file is deleted. * * @since 4.3.0 * * @param int $post_id Attachment ID. */ public function delete_attachment_data($post_id) { } /** * Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon. * * @since 4.3.0 * * @param null|array|string $value The value get_metadata() should return a single metadata value, or an * array of values. * @param int $post_id Post ID. * @param string $meta_key Meta key. * @param bool $single Whether to return only the first value of the specified `$meta_key`. * @return array|null|string The attachment metadata value, array of values, or null. */ public function get_post_metadata($value, $post_id, $meta_key, $single) { } } /** * Core class used to implement displaying terms in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Terms_List_Table extends \WP_List_Table { public $callback_args; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @global string $post_type Global post type. * @global string $taxonomy Global taxonomy. * @global string $action * @global object $tax * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * @return bool */ public function ajax_user_can() { } /** */ public function prepare_items() { } /** */ public function no_items() { } /** * @return array */ protected function get_bulk_actions() { } /** * @return string */ public function current_action() { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * @return array */ protected function get_sortable_columns() { } /** * @phpstan-return void */ public function display_rows_or_placeholder() { } /** * @global string $taxonomy Global taxonomy. * * @param WP_Term $tag Term object. * @param int $level */ public function single_row($tag, $level = 0) { } /** * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Term $item Term object. * @return string */ public function column_cb($item) { } /** * @param WP_Term $tag Term object. * @return string */ public function column_name($tag) { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'name'. */ protected function get_default_primary_column_name() { } /** * Generates and displays row action links. * * @since 4.3.0 * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Term $item Tag being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for terms, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions($item, $column_name, $primary) { } /** * @param WP_Term $tag Term object. * @return string */ public function column_description($tag) { } /** * @param WP_Term $tag Term object. * @return string */ public function column_slug($tag) { } /** * @param WP_Term $tag Term object. * @return string */ public function column_posts($tag) { } /** * @param WP_Term $tag Term object. * @return string */ public function column_links($tag) { } /** * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Term $item Term object. * @param string $column_name Name of the column. * @return string */ public function column_default($item, $column_name) { } /** * Outputs the hidden row displayed when inline editing * * @since 3.1.0 * @phpstan-return void */ public function inline_edit() { } } /** * Core class used to implement displaying installed themes in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Themes_List_Table extends \WP_List_Table { protected $search_terms = array(); public $features = array(); /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * @return bool */ public function ajax_user_can() { } /** */ public function prepare_items() { } /** * @phpstan-return void */ public function no_items() { } /** * @param string $which * @phpstan-return void */ public function tablenav($which = 'top') { } /** * Displays the themes table. * * Overrides the parent display() method to provide a different container. * * @since 3.1.0 */ public function display() { } /** * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** */ public function display_rows_or_placeholder() { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * @param WP_Theme $theme * @return bool */ public function search_theme($theme) { } /** * Send required variables to JavaScript land * * @since 3.4.0 * * @param array $extra_args */ public function _js_vars($extra_args = array()) { } } /** * Core class used to implement displaying themes to install in a list table. * * @since 3.1.0 * * @see WP_Themes_List_Table */ class WP_Theme_Install_List_Table extends \WP_Themes_List_Table { public $features = array(); /** * @return bool */ public function ajax_user_can() { } /** * @global array $tabs * @global string $tab * @global int $paged * @global string $type * @global array $theme_field_defaults * @phpstan-return void */ public function prepare_items() { } /** */ public function no_items() { } /** * @global array $tabs * @global string $tab * @return array */ protected function get_views() { } /** * Displays the theme install table. * * Overrides the parent display() method to provide a different container. * * @since 3.1.0 */ public function display() { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Prints a theme from the WordPress.org API. * * @since 3.1.0 * * @global array $themes_allowedtags * * @param stdClass $theme { * An object that contains theme data returned by the WordPress.org API. * * @type string $name Theme name, e.g. 'Twenty Twenty-One'. * @type string $slug Theme slug, e.g. 'twentytwentyone'. * @type string $version Theme version, e.g. '1.1'. * @type string $author Theme author username, e.g. 'melchoyce'. * @type string $preview_url Preview URL, e.g. 'https://2021.wordpress.net/'. * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentytwentyone/'. * @type float $rating Rating score. * @type int $num_ratings The number of ratings. * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentytwentyone/'. * @type string $description Theme description. * @type string $download_link Theme ZIP download URL. * } * @phpstan-param object{ * name?: string, * slug?: string, * version?: string, * author?: string, * preview_url?: string, * screenshot_url?: string, * rating?: float, * num_ratings?: int, * homepage?: string, * description?: string, * download_link?: string, * } $theme * @phpstan-return void */ public function single_row($theme) { } /** * Prints the wrapper for the theme installer. */ public function theme_installer() { } /** * Prints the wrapper for the theme installer with a provided theme's data. * Used to make the theme installer work for no-js. * * @param stdClass $theme A WordPress.org Theme API object. */ public function theme_installer_single($theme) { } /** * Prints the info for a theme (to be used in the theme installer modal). * * @global array $themes_allowedtags * * @param stdClass $theme A WordPress.org Theme API object. * @phpstan-return void */ public function install_theme_info($theme) { } /** * Send required variables to JavaScript land * * @since 3.4.0 * * @global string $tab Current tab within Themes->Install screen * @global string $type Type of search. * * @param array $extra_args Unused. */ public function _js_vars($extra_args = array()) { } } /** * Core class used to implement displaying users in a list table. * * @since 3.1.0 * * @see WP_List_Table */ class WP_Users_List_Table extends \WP_List_Table { /** * Site ID to generate the Users list table for. * * @since 3.1.0 * @var int */ public $site_id; /** * Whether or not the current Users list table is for Multisite. * * @since 3.1.0 * @var bool */ public $is_site_users; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @param array $args An associative array of arguments. */ public function __construct($args = array()) { } /** * Checks the current user's permissions. * * @since 3.1.0 * * @return bool */ public function ajax_user_can() { } /** * Prepares the users list for display. * * @since 3.1.0 * * @global string $role * @global string $usersearch */ public function prepare_items() { } /** * Outputs 'no users' message. * * @since 3.1.0 */ public function no_items() { } /** * Returns an associative array listing all the views that can be used * with this table. * * Provides a list of roles and user count for that role for easy * filtering of the user table. * * @since 3.1.0 * * @global string $role * * @return string[] An array of HTML links keyed by their view. */ protected function get_views() { } /** * Retrieves an associative array of bulk actions available on this table. * * @since 3.1.0 * * @return array Array of bulk action labels keyed by their action. */ protected function get_bulk_actions() { } /** * Outputs the controls to allow user roles to be changed in bulk. * * @since 3.1.0 * * @param string $which Whether this is being invoked above ("top") * or below the table ("bottom"). */ protected function extra_tablenav($which) { } /** * Captures the bulk action required, and return it. * * Overridden from the base class implementation to capture * the role change drop-down. * * @since 3.1.0 * * @return string The bulk action required. */ public function current_action() { } /** * Gets a list of columns for the list table. * * @since 3.1.0 * * @return string[] Array of column titles keyed by their column name. */ public function get_columns() { } /** * Gets a list of sortable columns for the list table. * * @since 3.1.0 * * @return array Array of sortable columns. */ protected function get_sortable_columns() { } /** * Generates the list table rows. * * @since 3.1.0 */ public function display_rows() { } /** * Generates HTML for a single row on the users.php admin panel. * * @since 3.1.0 * @since 4.2.0 The `$style` parameter was deprecated. * @since 4.4.0 The `$role` parameter was deprecated. * * @param WP_User $user_object The current user object. * @param string $style Deprecated. Not used. * @param string $role Deprecated. Not used. * @param int $numposts Optional. Post count to display for this user. Defaults * to zero, as in, a new user has made zero posts. * @return string Output for a single row. */ public function single_row($user_object, $style = '', $role = '', $numposts = 0) { } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'username'. */ protected function get_default_primary_column_name() { } /** * Returns an array of translated user role names for a given user object. * * @since 4.4.0 * * @param WP_User $user_object The WP_User object. * @return string[] An array of user role names keyed by role. */ protected function get_role_list($user_object) { } } /** * WordPress User Search class. * * @since 2.1.0 * @deprecated 3.1.0 Use WP_User_Query */ class WP_User_Search { /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var mixed */ var $results; /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var string */ var $search_term; /** * Page number. * * @since 2.1.0 * @access private * @var int */ var $page; /** * Role name that users have. * * @since 2.5.0 * @access private * @var string */ var $role; /** * Raw page number. * * @since 2.1.0 * @access private * @var int|bool */ var $raw_page; /** * Amount of users to display per page. * * @since 2.1.0 * @access public * @var int */ var $users_per_page = 50; /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var int */ var $first_user; /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var int */ var $last_user; /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var string */ var $query_limit; /** * {@internal Missing Description}} * * @since 3.0.0 * @access private * @var string */ var $query_orderby; /** * {@internal Missing Description}} * * @since 3.0.0 * @access private * @var string */ var $query_from; /** * {@internal Missing Description}} * * @since 3.0.0 * @access private * @var string */ var $query_where; /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var int */ var $total_users_for_query = 0; /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var bool */ var $too_many_total_users = \false; /** * {@internal Missing Description}} * * @since 2.1.0 * @access private * @var WP_Error */ var $search_errors; /** * {@internal Missing Description}} * * @since 2.7.0 * @access private * @var string */ var $paging_text; /** * PHP5 Constructor - Sets up the object properties. * * @since 2.1.0 * * @param string $search_term Search terms string. * @param int $page Optional. Page ID. * @param string $role Role name. * @return WP_User_Search */ function __construct($search_term = '', $page = '', $role = '') { } /** * PHP4 Constructor - Sets up the object properties. * * @since 2.1.0 * * @param string $search_term Search terms string. * @param int $page Optional. Page ID. * @param string $role Role name. * @return WP_User_Search */ public function WP_User_Search($search_term = '', $page = '', $role = '') { } /** * Prepares the user search query (legacy). * * @since 2.1.0 * @access public * * @global wpdb $wpdb WordPress database abstraction object. */ public function prepare_query() { } /** * Executes the user search query. * * @since 2.1.0 * @access public * * @global wpdb $wpdb WordPress database abstraction object. */ public function query() { } /** * Prepares variables for use in templates. * * @since 2.1.0 * @access public */ function prepare_vars_for_template_usage() { } /** * Handles paging for the user search query. * * @since 2.1.0 * @access public */ public function do_paging() { } /** * Retrieves the user search query results. * * @since 2.1.0 * @access public * * @return array */ public function get_results() { } /** * Displaying paging text. * * @see do_paging() Builds paging text. * * @since 2.1.0 * @access public */ function page_links() { } /** * Whether paging is enabled. * * @see do_paging() Builds paging text. * * @since 2.1.0 * @access public * * @return bool */ function results_are_paged() { } /** * Whether there are search terms. * * @since 2.1.0 * @access public * * @return bool */ function is_search() { } } /** * Previous class for list table for privacy data export requests. * * @since 4.9.6 * @deprecated 5.3.0 */ class WP_Privacy_Data_Export_Requests_Table extends \WP_Privacy_Data_Export_Requests_List_Table { function __construct($args) { } } /** * Previous class for list table for privacy data erasure requests. * * @since 4.9.6 * @deprecated 5.3.0 */ class WP_Privacy_Data_Removal_Requests_Table extends \WP_Privacy_Data_Removal_Requests_List_Table { function __construct($args) { } } class getid3_lib { /** * @param string $string * @param bool $hex * @param bool $spaces * @param string|bool $htmlencoding * * @return string */ public static function PrintHexBytes($string, $hex = \true, $spaces = \true, $htmlencoding = 'UTF-8') { } /** * Truncates a floating-point number at the decimal point. * * @param float $floatnumber * * @return float|int returns int (if possible, otherwise float) */ public static function trunc($floatnumber) { } /** * @param int|null $variable * @param int $increment * * @return bool */ public static function safe_inc(&$variable, $increment = 1) { } /** * @param int|float $floatnum * * @return int|float */ public static function CastAsInt($floatnum) { } /** * @param int $num * * @return bool */ public static function intValueSupported($num) { } /** * Perform a division, guarding against division by zero * * @param float|int $numerator * @param float|int $denominator * @param float|int $fallback * @return float|int */ public static function SafeDiv($numerator, $denominator, $fallback = 0) { } /** * @param string $fraction * * @return float */ public static function DecimalizeFraction($fraction) { } /** * @param string $binarynumerator * * @return float */ public static function DecimalBinary2Float($binarynumerator) { } /** * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html * * @param string $binarypointnumber * @param int $maxbits * * @return array */ public static function NormalizeBinaryPoint($binarypointnumber, $maxbits = 52) { } /** * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html * * @param float $floatvalue * * @return string */ public static function Float2BinaryDecimal($floatvalue) { } /** * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html * * @param float $floatvalue * @param int $bits * * @return string|false */ public static function Float2String($floatvalue, $bits) { } /** * @param string $byteword * * @return float|false */ public static function LittleEndian2Float($byteword) { } /** * ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic * * @link https://web.archive.org/web/20120325162206/http://www.psc.edu/general/software/packages/ieee/ieee.php * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html * * @param string $byteword * * @return float|false */ public static function BigEndian2Float($byteword) { } /** * @param string $byteword * @param bool $synchsafe * @param bool $signed * * @return int|float|false * @throws Exception */ public static function BigEndian2Int($byteword, $synchsafe = \false, $signed = \false) { } /** * @param string $byteword * @param bool $signed * * @return int|float|false */ public static function LittleEndian2Int($byteword, $signed = \false) { } /** * @param string $byteword * * @return string */ public static function LittleEndian2Bin($byteword) { } /** * @param string $byteword * * @return string */ public static function BigEndian2Bin($byteword) { } /** * @param int $number * @param int $minbytes * @param bool $synchsafe * @param bool $signed * * @return string * @throws Exception */ public static function BigEndian2String($number, $minbytes = 1, $synchsafe = \false, $signed = \false) { } /** * @param int $number * * @return string */ public static function Dec2Bin($number) { } /** * @param string $binstring * @param bool $signed * * @return int|float */ public static function Bin2Dec($binstring, $signed = \false) { } /** * @param string $binstring * * @return string */ public static function Bin2String($binstring) { } /** * @param int $number * @param int $minbytes * @param bool $synchsafe * * @return string */ public static function LittleEndian2String($number, $minbytes = 1, $synchsafe = \false) { } /** * @param mixed $array1 * @param mixed $array2 * * @return array|false */ public static function array_merge_clobber($array1, $array2) { } /** * @param mixed $array1 * @param mixed $array2 * * @return array|false */ public static function array_merge_noclobber($array1, $array2) { } /** * @param mixed $array1 * @param mixed $array2 * * @return array|false|null */ public static function flipped_array_merge_noclobber($array1, $array2) { } /** * @param array $theArray * * @return bool */ public static function ksort_recursive(&$theArray) { } /** * @param string $filename * @param int $numextensions * * @return string */ public static function fileextension($filename, $numextensions = 1) { } /** * @param int $seconds * * @return string */ public static function PlaytimeString($seconds) { } /** * @param int $macdate * * @return int|float */ public static function DateMac2Unix($macdate) { } /** * @param string $rawdata * * @return float */ public static function FixedPoint8_8($rawdata) { } /** * @param string $rawdata * * @return float */ public static function FixedPoint16_16($rawdata) { } /** * @param string $rawdata * * @return float */ public static function FixedPoint2_30($rawdata) { } /** * @param string $ArrayPath * @param string $Separator * @param mixed $Value * * @return array */ public static function CreateDeepArray($ArrayPath, $Separator, $Value) { } /** * @param array $arraydata * @param bool $returnkey * * @return int|false */ public static function array_max($arraydata, $returnkey = \false) { } /** * @param array $arraydata * @param bool $returnkey * * @return int|false */ public static function array_min($arraydata, $returnkey = \false) { } /** * @param string $XMLstring * * @return array|false */ public static function XML2array($XMLstring) { } /** * @param SimpleXMLElement|array|mixed $XMLobject * * @return mixed */ public static function SimpleXMLelement2array($XMLobject) { } /** * Returns checksum for a file from starting position to absolute end position. * * @param string $file * @param int $offset * @param int $end * @param string $algorithm * * @return string|false * @throws getid3_exception */ public static function hash_data($file, $offset, $end, $algorithm) { } /** * @param string $filename_source * @param string $filename_dest * @param int $offset * @param int $length * * @return bool * @throws Exception * * @deprecated Unused, may be removed in future versions of getID3 */ public static function CopyFileParts($filename_source, $filename_dest, $offset, $length) { } /** * @param int $charval * * @return string */ public static function iconv_fallback_int_utf8($charval) { } /** * ISO-8859-1 => UTF-8 * * @param string $string * @param bool $bom * * @return string */ public static function iconv_fallback_iso88591_utf8($string, $bom = \false) { } /** * ISO-8859-1 => UTF-16BE * * @param string $string * @param bool $bom * * @return string */ public static function iconv_fallback_iso88591_utf16be($string, $bom = \false) { } /** * ISO-8859-1 => UTF-16LE * * @param string $string * @param bool $bom * * @return string */ public static function iconv_fallback_iso88591_utf16le($string, $bom = \false) { } /** * ISO-8859-1 => UTF-16LE (BOM) * * @param string $string * * @return string */ public static function iconv_fallback_iso88591_utf16($string) { } /** * UTF-8 => ISO-8859-1 * * @param string $string * * @return string */ public static function iconv_fallback_utf8_iso88591($string) { } /** * UTF-8 => UTF-16BE * * @param string $string * @param bool $bom * * @return string */ public static function iconv_fallback_utf8_utf16be($string, $bom = \false) { } /** * UTF-8 => UTF-16LE * * @param string $string * @param bool $bom * * @return string */ public static function iconv_fallback_utf8_utf16le($string, $bom = \false) { } /** * UTF-8 => UTF-16LE (BOM) * * @param string $string * * @return string */ public static function iconv_fallback_utf8_utf16($string) { } /** * UTF-16BE => UTF-8 * * @param string $string * * @return string */ public static function iconv_fallback_utf16be_utf8($string) { } /** * UTF-16LE => UTF-8 * * @param string $string * * @return string */ public static function iconv_fallback_utf16le_utf8($string) { } /** * UTF-16BE => ISO-8859-1 * * @param string $string * * @return string */ public static function iconv_fallback_utf16be_iso88591($string) { } /** * UTF-16LE => ISO-8859-1 * * @param string $string * * @return string */ public static function iconv_fallback_utf16le_iso88591($string) { } /** * UTF-16 (BOM) => ISO-8859-1 * * @param string $string * * @return string */ public static function iconv_fallback_utf16_iso88591($string) { } /** * UTF-16 (BOM) => UTF-8 * * @param string $string * * @return string */ public static function iconv_fallback_utf16_utf8($string) { } /** * @param string $in_charset * @param string $out_charset * @param string $string * * @return string * @throws Exception */ public static function iconv_fallback($in_charset, $out_charset, $string) { } /** * @param mixed $data * @param string $charset * * @return mixed */ public static function recursiveMultiByteCharString2HTML($data, $charset = 'ISO-8859-1') { } /** * @param string|int|float $string * @param string $charset * * @return string */ public static function MultiByteCharString2HTML($string, $charset = 'ISO-8859-1') { } /** * @param int $namecode * * @return string */ public static function RGADnameLookup($namecode) { } /** * @param int $originatorcode * * @return string */ public static function RGADoriginatorLookup($originatorcode) { } /** * @param int $rawadjustment * @param int $signbit * * @return float */ public static function RGADadjustmentLookup($rawadjustment, $signbit) { } /** * @param int $namecode * @param int $originatorcode * @param int $replaygain * * @return string */ public static function RGADgainString($namecode, $originatorcode, $replaygain) { } /** * @param float $amplitude * * @return float */ public static function RGADamplitude2dB($amplitude) { } /** * @param string $imgData * @param array $imageinfo * * @return array|false */ public static function GetDataImageSize($imgData, &$imageinfo = array()) { } /** * @param string $mime_type * * @return string */ public static function ImageExtFromMime($mime_type) { } /** * @param array $ThisFileInfo * @param bool $option_tags_html default true (just as in the main getID3 class) * * @return bool */ public static function CopyTagsToComments(&$ThisFileInfo, $option_tags_html = \true) { } /** * @param string $key * @param int $begin * @param int $end * @param string $file * @param string $name * * @return string */ public static function EmbeddedLookup($key, $begin, $end, $file, $name) { } /** * @param string $filename * @param string $sourcefile * @param bool $DieOnFailure * * @return bool * @throws Exception */ public static function IncludeDependency($filename, $sourcefile, $DieOnFailure = \false) { } /** * @param string $string * * @return string */ public static function trimNullByte($string) { } /** * @param string $path * * @return float|bool */ public static function getFileSizeSyscall($path) { } /** * @param string $filename * * @return string|false */ public static function truepath($filename) { } /** * Workaround for Bug #37268 (https://bugs.php.net/bug.php?id=37268) * * @param string $path A path. * @param string $suffix If the name component ends in suffix this will also be cut off. * * @return string */ public static function mb_basename($path, $suffix = '') { } } class getID3 { /** * CASE SENSITIVE! - i.e. (must be supported by iconv()). Examples: ISO-8859-1 UTF-8 UTF-16 UTF-16BE * * @var string */ public $encoding = 'UTF-8'; /** * Should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'EUC-CN' or 'CP1252' * * @var string */ public $encoding_id3v1 = 'ISO-8859-1'; /** * ID3v1 should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'Windows-1251' or 'KOI8-R'. If true attempt to detect these encodings, but may return incorrect values for some tags actually in ISO-8859-1 encoding * * @var bool */ public $encoding_id3v1_autodetect = \false; /** * Read and process ID3v1 tags * * @var bool */ public $option_tag_id3v1 = \true; /** * Read and process ID3v2 tags * * @var bool */ public $option_tag_id3v2 = \true; /** * Read and process Lyrics3 tags * * @var bool */ public $option_tag_lyrics3 = \true; /** * Read and process APE tags * * @var bool */ public $option_tag_apetag = \true; /** * Copy tags to root key 'tags' and encode to $this->encoding * * @var bool */ public $option_tags_process = \true; /** * Copy tags to root key 'tags_html' properly translated from various encodings to HTML entities * * @var bool */ public $option_tags_html = \true; /** * Calculate additional info such as bitrate, channelmode etc * * @var bool */ public $option_extra_info = \true; /** * Defaults to true (ATTACHMENTS_INLINE) for backward compatibility * * @var bool|string */ public $option_save_attachments = \true; /** * Get MD5 sum of data part - slow * * @var bool */ public $option_md5_data = \false; /** * Use MD5 of source file if available - only FLAC and OptimFROG * * @var bool */ public $option_md5_data_source = \false; /** * Get SHA1 sum of data part - slow * * @var bool */ public $option_sha1_data = \false; /** * Check whether file is larger than 2GB and thus not supported by 32-bit PHP (null: auto-detect based on * PHP_INT_MAX) * * @var bool|null */ public $option_max_2gb_check; /** * Read buffer size in bytes * * @var int */ public $option_fread_buffer_size = 32768; /** archive.rar * if true use PHP RarArchive extension, if false (non-extension parsing not yet written in getID3) * * @var bool */ public $options_archive_rar_use_php_rar_extension = \true; /** archive.gzip * Optional file list - disable for speed. * Decode gzipped files, if possible, and parse recursively (.tar.gz for example). * * @var bool */ public $options_archive_gzip_parse_contents = \false; /** audio.midi * if false only parse most basic information, much faster for some files but may be inaccurate * * @var bool */ public $options_audio_midi_scanwholefile = \true; /** audio.mp3 * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow, * unrecommended, but may provide data from otherwise-unusable files. * * @var bool */ public $options_audio_mp3_allow_bruteforce = \false; /** audio.mp3 * number of frames to scan to determine if MPEG-audio sequence is valid * Lower this number to 5-20 for faster scanning * Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams * * @var int */ public $options_audio_mp3_mp3_valid_check_frames = 50; /** audio.wavpack * Avoid scanning all frames (break after finding ID_RIFF_HEADER and ID_CONFIG_BLOCK, * significantly faster for very large files but other data may be missed * * @var bool */ public $options_audio_wavpack_quick_parsing = \false; /** audio-video.flv * Break out of the loop if too many frames have been scanned; only scan this * many if meta frame does not contain useful duration. * * @var int */ public $options_audiovideo_flv_max_frames = 100000; /** audio-video.matroska * If true, do not return information about CLUSTER chunks, since there's a lot of them * and they're not usually useful [default: TRUE]. * * @var bool */ public $options_audiovideo_matroska_hide_clusters = \true; /** audio-video.matroska * True to parse the whole file, not only header [default: FALSE]. * * @var bool */ public $options_audiovideo_matroska_parse_whole_file = \false; /** audio-video.quicktime * return all parsed data from all atoms if true, otherwise just returned parsed metadata * * @var bool */ public $options_audiovideo_quicktime_ReturnAtomData = \false; /** audio-video.quicktime * return all parsed data from all atoms if true, otherwise just returned parsed metadata * * @var bool */ public $options_audiovideo_quicktime_ParseAllPossibleAtoms = \false; /** audio-video.swf * return all parsed tags if true, otherwise do not return tags not parsed by getID3 * * @var bool */ public $options_audiovideo_swf_ReturnAllTagData = \false; /** graphic.bmp * return BMP palette * * @var bool */ public $options_graphic_bmp_ExtractPalette = \false; /** graphic.bmp * return image data * * @var bool */ public $options_graphic_bmp_ExtractData = \false; /** graphic.png * If data chunk is larger than this do not read it completely (getID3 only needs the first * few dozen bytes for parsing). * * @var int */ public $options_graphic_png_max_data_bytes = 10000000; /** misc.pdf * return full details of PDF Cross-Reference Table (XREF) * * @var bool */ public $options_misc_pdf_returnXREF = \false; /** misc.torrent * Assume all .torrent files are less than 1MB and just read entire thing into memory for easy processing. * Override this value if you need to process files larger than 1MB * * @var int */ public $options_misc_torrent_max_torrent_filesize = 1048576; /** * Filename of file being analysed. * * @var string */ public $filename; /** * Filepointer to file being analysed. * * @var resource */ public $fp; /** * Result array. * * @var array */ public $info; /** * @var string */ public $tempdir = \GETID3_TEMP_DIR; /** * @var int */ public $memory_limit = 0; /** * @var string */ protected $startup_error = ''; /** * @var string */ protected $startup_warning = ''; const VERSION = '1.9.23-202310190849'; const FREAD_BUFFER_SIZE = 32768; const ATTACHMENTS_NONE = \false; const ATTACHMENTS_INLINE = \true; /** * @throws getid3_exception * @phpstan-return void */ public function __construct() { } /** * @return string */ public function version() { } /** * @return int */ public function fread_buffer_size() { } /** * @param array $optArray * * @return bool */ public function setOption($optArray) { } /** * @param string $filename * @param int $filesize * @param resource $fp * * @return bool * * @throws getid3_exception */ public function openfile($filename, $filesize = \null, $fp = \null) { } /** * analyze file * * @param string $filename * @param int $filesize * @param string $original_filename * @param resource $fp * * @return array */ public function analyze($filename, $filesize = \null, $original_filename = '', $fp = \null) { } /** * Error handling. * * @param string $message * * @return array */ public function error($message) { } /** * Warning handling. * * @param string $message * * @return bool */ public function warning($message) { } /** * Return array containing information about all supported formats. * * @return array */ public function GetFileFormatArray() { } /** * @param string $filedata * @param string $filename * * @return mixed|false */ public function GetFileFormat(&$filedata, $filename = '') { } /** * Converts array to $encoding charset from $this->encoding. * * @param array $array * @param string $encoding * @phpstan-return void */ public function CharConvert(&$array, $encoding) { } /** * @return bool */ public function HandleAllTags() { } /** * Calls getid3_lib::CopyTagsToComments() but passes in the option_tags_html setting from this instance of getID3 * * @param array $ThisFileInfo * * @return bool */ public function CopyTagsToComments(&$ThisFileInfo) { } /** * @param string $algorithm * * @return array|bool */ public function getHashdata($algorithm) { } public function ChannelsBitratePlaytimeCalculations() { } /** * @return bool */ public function CalculateCompressionRatioVideo() { } /** * @return bool */ public function CalculateCompressionRatioAudio() { } /** * @return bool */ public function CalculateReplayGain() { } /** * @return bool */ public function ProcessAudioStreams() { } /** * @return string|bool */ public function getid3_tempnam() { } /** * @param string $name * * @return bool * * @throws getid3_exception */ public function include_module($name) { } /** * @param string $filename * * @return bool */ public static function is_writable($filename) { } } abstract class getid3_handler { /** * @var getID3 */ protected $getid3; /** * Analyzing filepointer or string. * * @var bool */ protected $data_string_flag = \false; /** * String to analyze. * * @var string */ protected $data_string = ''; /** * Seek position in string. * * @var int */ protected $data_string_position = 0; /** * String length. * * @var int */ protected $data_string_length = 0; /** * getid3_handler constructor. * * @param getID3 $getid3 * @param string $call_module */ public function __construct(\getID3 $getid3, $call_module = \null) { } /** * Analyze from file pointer. * * @return bool */ public abstract function Analyze(); /** * Analyze from string instead. * * @param string $string */ public function AnalyzeString($string) { } /** * @param string $string */ public function setStringMode($string) { } /** * @phpstan-impure * * @return int|bool */ protected function ftell() { } /** * @param int $bytes * * @phpstan-impure * * @return string|false * * @throws getid3_exception */ protected function fread($bytes) { } /** * @param int $bytes * @param int $whence * * @phpstan-impure * * @return int * * @throws getid3_exception */ protected function fseek($bytes, $whence = \SEEK_SET) { } /** * @phpstan-impure * * @return string|false * * @throws getid3_exception */ protected function fgets() { } /** * @phpstan-impure * * @return bool */ protected function feof() { } /** * @param string $module * * @return bool */ protected final function isDependencyFor($module) { } /** * @param string $text * * @return bool */ protected function error($text) { } /** * @param string $text * * @return bool */ protected function warning($text) { } /** * @param string $text */ protected function notice($text) { } /** * @param string $name * @param int $offset * @param int $length * @param string $image_mime * * @return string|null * * @throws Exception * @throws getid3_exception */ public function saveAttachment($name, $offset, $length, $image_mime = \null) { } } class getid3_exception extends \Exception { public $message; } class getid3_asf extends \getid3_handler { protected static $ASFIndexParametersObjectIndexSpecifiersIndexTypes = array(1 => 'Nearest Past Data Packet', 2 => 'Nearest Past Media Object', 3 => 'Nearest Past Cleanpoint'); protected static $ASFMediaObjectIndexParametersObjectIndexSpecifiersIndexTypes = array(1 => 'Nearest Past Data Packet', 2 => 'Nearest Past Media Object', 3 => 'Nearest Past Cleanpoint', 0xff => 'Frame Number Offset'); protected static $ASFTimecodeIndexParametersObjectIndexSpecifiersIndexTypes = array(2 => 'Nearest Past Media Object', 3 => 'Nearest Past Cleanpoint'); /** * @param getID3 $getid3 */ public function __construct(\getID3 $getid3) { } /** * @return bool */ public function Analyze() { } /** * @param int $CodecListType * * @return string */ public static function codecListObjectTypeLookup($CodecListType) { } /** * @return array */ public static function KnownGUIDs() { } /** * @param string $GUIDstring * * @return string|false */ public static function GUIDname($GUIDstring) { } /** * @param int $id * * @return string */ public static function ASFIndexObjectIndexTypeLookup($id) { } /** * @param string $GUIDstring * * @return string */ public static function GUIDtoBytestring($GUIDstring) { } /** * @param string $Bytestring * * @return string */ public static function BytestringToGUID($Bytestring) { } /** * @param int $FILETIME * @param bool $round * * @return float|int */ public static function FILETIMEtoUNIXtime($FILETIME, $round = \true) { } /** * @param int $WMpictureType * * @return string */ public static function WMpictureTypeLookup($WMpictureType) { } /** * @param string $asf_header_extension_object_data * @param int $unhandled_sections * * @return array */ public function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) { } /** * @param int $id * * @return string */ public static function metadataLibraryObjectDataTypeLookup($id) { } /** * @param string $data * * @return array */ public function ASF_WMpicture(&$data) { } /** * Remove terminator 00 00 and convert UTF-16LE to Latin-1. * * @param string $string * * @return string */ public static function TrimConvert($string) { } /** * Remove terminator 00 00. * * @param string $string * * @return string */ public static function TrimTerm($string) { } } class getid3_flv extends \getid3_handler { const magic = 'FLV'; /** * Break out of the loop if too many frames have been scanned; only scan this * many if meta frame does not contain useful duration. * * @var int */ public $max_frames = 100000; /** * @return bool */ public function Analyze() { } /** * @param int $id * * @return string|false */ public static function audioFormatLookup($id) { } /** * @param int $id * * @return int|false */ public static function audioRateLookup($id) { } /** * @param int $id * * @return int|false */ public static function audioBitDepthLookup($id) { } /** * @param int $id * * @return string|false */ public static function videoCodecLookup($id) { } } class AMFStream { /** * @var string */ public $bytes; /** * @var int */ public $pos; /** * @param string $bytes */ public function __construct(&$bytes) { } /** * @return int */ public function readByte() { } /** * @return int */ public function readInt() { } /** * @return int */ public function readLong() { } /** * @return float|false */ public function readDouble() { } /** * @return string */ public function readUTF() { } /** * @return string */ public function readLongUTF() { } /** * @param int $length * * @return string */ public function read($length) { } /** * @return int */ public function peekByte() { } /** * @return int */ public function peekInt() { } /** * @return int */ public function peekLong() { } /** * @return float|false */ public function peekDouble() { } /** * @return string */ public function peekUTF() { } /** * @return string */ public function peekLongUTF() { } } class AMFReader { /** * @var AMFStream */ public $stream; /** * @param AMFStream $stream */ public function __construct(\AMFStream $stream) { } /** * @return mixed */ public function readData() { } /** * @return float|false */ public function readDouble() { } /** * @return bool */ public function readBoolean() { } /** * @return string */ public function readString() { } /** * @return array */ public function readObject() { } /** * @return array */ public function readMixedArray() { } /** * @return array */ public function readArray() { } /** * @return float|false */ public function readDate() { } /** * @return string */ public function readLongString() { } /** * @return string */ public function readXML() { } /** * @return array */ public function readTypedObject() { } } class AVCSequenceParameterSetReader { /** * @var string */ public $sps; public $start = 0; public $currentBytes = 0; public $currentBits = 0; /** * @var int */ public $width; /** * @var int */ public $height; /** * @param string $sps */ public function __construct($sps) { } public function readData() { } /** * @param int $bits */ public function skipBits($bits) { } /** * @return int */ public function getBit() { } /** * @param int $bits * * @return int */ public function getBits($bits) { } /** * @return int */ public function expGolombUe() { } /** * @return int */ public function expGolombSe() { } /** * @return int */ public function getWidth() { } /** * @return int */ public function getHeight() { } } /** * @tutorial http://www.matroska.org/technical/specs/index.html * * @todo Rewrite EBML parser to reduce it's size and honor default element values * @todo After rewrite implement stream size calculation, that will provide additional useful info and enable AAC/FLAC audio bitrate detection */ class getid3_matroska extends \getid3_handler { /** * If true, do not return information about CLUSTER chunks, since there's a lot of them * and they're not usually useful [default: TRUE]. * * @var bool */ public $hide_clusters = \true; /** * True to parse the whole file, not only header [default: FALSE]. * * @var bool */ public $parse_whole_file = \false; /** * @return bool */ public function Analyze() { } /** * @param int $target_type * * @return string|int */ public static function TargetTypeValue($target_type) { } /** * @param int $lacingtype * * @return string|int */ public static function BlockLacingType($lacingtype) { } /** * @param string $codecid * * @return string */ public static function CodecIDtoCommonName($codecid) { } /** * @param int $value * * @return string */ public static function displayUnit($value) { } } class getid3_quicktime extends \getid3_handler { /** audio-video.quicktime * return all parsed data from all atoms if true, otherwise just returned parsed metadata * * @var bool */ public $ReturnAtomData = \false; /** audio-video.quicktime * return all parsed data from all atoms if true, otherwise just returned parsed metadata * * @var bool */ public $ParseAllPossibleAtoms = \false; /** * @return bool */ public function Analyze() { } /** * @param string $atomname * @param int $atomsize * @param string $atom_data * @param int $baseoffset * @param array $atomHierarchy * @param bool $ParseAllPossibleAtoms * * @return array|false */ public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) { } /** * @param string $atom_data * @param int $baseoffset * @param array $atomHierarchy * @param bool $ParseAllPossibleAtoms * * @return array|false */ public function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) { } /** * @param string $data * @param int $offset * * @return int */ public function quicktime_read_mp4_descr_length($data, &$offset) { } /** * @param int $languageid * * @return string */ public function QuicktimeLanguageLookup($languageid) { } /** * @param string $codecid * * @return string */ public function QuicktimeVideoCodecLookup($codecid) { } /** * @param string $codecid * * @return mixed|string */ public function QuicktimeAudioCodecLookup($codecid) { } /** * @param string $compressionid * * @return string */ public function QuicktimeDCOMLookup($compressionid) { } /** * @param int $colordepthid * * @return string */ public function QuicktimeColorNameLookup($colordepthid) { } /** * @param int $stik * * @return string */ public function QuicktimeSTIKLookup($stik) { } /** * @param int $audio_profile_id * * @return string */ public function QuicktimeIODSaudioProfileName($audio_profile_id) { } /** * @param int $video_profile_id * * @return string */ public function QuicktimeIODSvideoProfileName($video_profile_id) { } /** * @param int $rtng * * @return string */ public function QuicktimeContentRatingLookup($rtng) { } /** * @param int $akid * * @return string */ public function QuicktimeStoreAccountTypeLookup($akid) { } /** * @param int $sfid * * @return string */ public function QuicktimeStoreFrontCodeLookup($sfid) { } /** * @param string $keyname * @param string|array $data * @param string $boxname * * @return bool */ public function CopyToAppropriateCommentsSection($keyname, $data, $boxname = '') { } /** * @param string $lstring * @param int $count * * @return string */ public function LociString($lstring, &$count) { } /** * @param string $nullterminatedstring * * @return string */ public function NoNullString($nullterminatedstring) { } /** * @param string $pascalstring * * @return string */ public function Pascal2String($pascalstring) { } /** * @param string $pascalstring * * @return string */ public function MaybePascal2String($pascalstring) { } /** * Helper functions for m4b audiobook chapters * code by Steffen Hartmann 2015-Nov-08. * * @param array $info * @param string $tag * @param string $history * @param array $result */ public function search_tag_by_key($info, $tag, $history, &$result) { } /** * @param array $info * @param string $k * @param string $v * @param string $history * @param array $result */ public function search_tag_by_pair($info, $k, $v, $history, &$result) { } /** * @param array $info * * @return array */ public function quicktime_time_to_sample_table($info) { } /** * @param array $info * * @return int */ public function quicktime_bookmark_time_scale($info) { } /* // END helper functions for m4b audiobook chapters */ } class getid3_riff extends \getid3_handler { protected $container = 'riff'; /** * @return bool * * @throws getid3_exception */ public function Analyze() { } /** * @param int $startoffset * @param int $maxoffset * * @return array|false * * @throws Exception * @throws getid3_exception */ public function ParseRIFFAMV($startoffset, $maxoffset) { } /** * @param int $startoffset * @param int $maxoffset * * @return array|false * @throws getid3_exception */ public function ParseRIFF($startoffset, $maxoffset) { } /** * @param string $RIFFdata * * @return bool */ public function ParseRIFFdata(&$RIFFdata) { } /** * @param array $RIFFinfoArray * @param array $CommentsTargetArray * * @return bool */ public static function parseComments(&$RIFFinfoArray, &$CommentsTargetArray) { } /** * @param string $WaveFormatExData * * @return array */ public static function parseWAVEFORMATex($WaveFormatExData) { } /** * @param string $WavPackChunkData * * @return bool */ public function parseWavPackHeader($WavPackChunkData) { } /** * @param string $BITMAPINFOHEADER * @param bool $littleEndian * * @return array */ public static function ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian = \true) { } /** * @param string $DIVXTAG * @param bool $raw * * @return array */ public static function ParseDIVXTAG($DIVXTAG, $raw = \false) { } /** * @param string $tagshortname * * @return string */ public static function waveSNDMtagLookup($tagshortname) { } /** * @param int $wFormatTag * * @return string */ public static function wFormatTagLookup($wFormatTag) { } /** * @param string $fourcc * * @return string */ public static function fourccLookup($fourcc) { } } class getid3_ac3 extends \getid3_handler { const syncword = 0xb77; /** * @return bool */ public function Analyze() { } /** * @param int $fscod * * @return int|string|false */ public static function sampleRateCodeLookup($fscod) { } /** * @param int $fscod2 * * @return int|string|false */ public static function sampleRateCodeLookup2($fscod2) { } /** * @param int $bsmod * @param int $acmod * * @return string|false */ public static function serviceTypeLookup($bsmod, $acmod) { } /** * @param int $acmod * * @return array|false */ public static function audioCodingModeLookup($acmod) { } /** * @param int $cmixlev * * @return int|float|string|false */ public static function centerMixLevelLookup($cmixlev) { } /** * @param int $surmixlev * * @return int|float|string|false */ public static function surroundMixLevelLookup($surmixlev) { } /** * @param int $dsurmod * * @return string|false */ public static function dolbySurroundModeLookup($dsurmod) { } /** * @param int $acmod * @param bool $lfeon * * @return array */ public static function channelsEnabledLookup($acmod, $lfeon) { } /** * @param int $compre * * @return float|int */ public static function heavyCompression($compre) { } /** * @param int $roomtyp * * @return string|false */ public static function roomTypeLookup($roomtyp) { } /** * @param int $frmsizecod * @param int $fscod * * @return int|false */ public static function frameSizeLookup($frmsizecod, $fscod) { } /** * @param int $frmsizecod * * @return int|false */ public static function bitrateLookup($frmsizecod) { } /** * @param int $numblkscod * * @return int|false */ public static function blocksPerSyncFrame($numblkscod) { } } /** * @tutorial http://wiki.multimedia.cx/index.php?title=DTS */ class getid3_dts extends \getid3_handler { /** * Default DTS syncword used in native .cpt or .dts formats. */ const syncword = "\xfe\x80\x01"; /** * Possible syncwords indicating bitstream encoding. */ public static $syncwords = array( 0 => "\xfe\x80\x01", // raw big-endian 1 => "\xfe\x01\x80", // raw little-endian 2 => "\x1f\xff\xe8\x00", // 14-bit big-endian 3 => "\xff\x1f\x00\xe8", ); /** * @return bool */ public function Analyze() { } /** * @param int $index * * @return int|string|false */ public static function bitrateLookup($index) { } /** * @param int $index * * @return int|string|false */ public static function sampleRateLookup($index) { } /** * @param int $index * * @return int|false */ public static function bitPerSampleLookup($index) { } /** * @param int $index * * @return int|false */ public static function numChannelsLookup($index) { } /** * @param int $index * * @return string */ public static function channelArrangementLookup($index) { } /** * @param int $index * @param int $version * * @return int|false */ public static function dialogNormalization($index, $version) { } } /** * @tutorial http://flac.sourceforge.net/format.html */ class getid3_flac extends \getid3_handler { const syncword = 'fLaC'; /** * @return bool */ public function Analyze() { } /** * @return bool */ public function parseMETAdata() { } /** * @param string $BlockData * * @return array */ public static function parseSTREAMINFOdata($BlockData) { } /** * Parse METADATA_BLOCK_PICTURE flac structure and extract attachment * External usage: audio.ogg * * @return bool */ public function parsePICTURE() { } /** * @param int $blocktype * * @return string */ public static function metaBlockTypeLookup($blocktype) { } /** * @param int $applicationid * * @return string */ public static function applicationIDLookup($applicationid) { } /** * @param int $type_id * * @return string */ public static function pictureTypeLookup($type_id) { } } class getid3_mp3 extends \getid3_handler { /** * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow, * unrecommended, but may provide data from otherwise-unusable files. * * @var bool */ public $allow_bruteforce = \false; /** * number of frames to scan to determine if MPEG-audio sequence is valid * Lower this number to 5-20 for faster scanning * Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams * * @var int */ public $mp3_valid_check_frames = 50; /** * @return bool */ public function Analyze() { } /** * @return string */ public function GuessEncoderOptions() { } /** * @param int $offset * @param array $info * @param bool $recursivesearch * @param bool $ScanAsCBR * @param bool $FastMPEGheaderScan * * @return bool */ public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch = \true, $ScanAsCBR = \false, $FastMPEGheaderScan = \false) { } /** * @param int $offset * @param int $nextframetestoffset * @param bool $ScanAsCBR * * @return bool */ public function RecursiveFrameScanning(&$offset, &$nextframetestoffset, $ScanAsCBR) { } /** * @param int $offset * @param bool $deepscan * * @return int|false */ public function FreeFormatFrameLength($offset, $deepscan = \false) { } /** * @return bool */ public function getOnlyMPEGaudioInfoBruteForce() { } /** * @param int $avdataoffset * @param bool $BitrateHistogram * * @return bool */ public function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram = \false) { } /** * @return array */ public static function MPEGaudioVersionArray() { } /** * @return array */ public static function MPEGaudioLayerArray() { } /** * @return array */ public static function MPEGaudioBitrateArray() { } /** * @return array */ public static function MPEGaudioFrequencyArray() { } /** * @return array */ public static function MPEGaudioChannelModeArray() { } /** * @return array */ public static function MPEGaudioModeExtensionArray() { } /** * @return array */ public static function MPEGaudioEmphasisArray() { } /** * @param string $head4 * @param bool $allowBitrate15 * * @return bool */ public static function MPEGaudioHeaderBytesValid($head4, $allowBitrate15 = \false) { } /** * @param array $rawarray * @param bool $echoerrors * @param bool $allowBitrate15 * * @return bool */ public static function MPEGaudioHeaderValid($rawarray, $echoerrors = \false, $allowBitrate15 = \false) { } /** * @param string $Header4Bytes * * @return array|false */ public static function MPEGaudioHeaderDecode($Header4Bytes) { } /** * @param int|string $bitrate * @param string $version * @param string $layer * @param bool $padding * @param int $samplerate * * @return int|false */ public static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) { } /** * @param float|int $bit_rate * * @return int|float|string */ public static function ClosestStandardMP3Bitrate($bit_rate) { } /** * @param string $version * @param string $channelmode * * @return int */ public static function XingVBRidOffset($version, $channelmode) { } /** * @param int $VBRmethodID * * @return string */ public static function LAMEvbrMethodLookup($VBRmethodID) { } /** * @param int $StereoModeID * * @return string */ public static function LAMEmiscStereoModeLookup($StereoModeID) { } /** * @param int $SourceSampleFrequencyID * * @return string */ public static function LAMEmiscSourceSampleFrequencyLookup($SourceSampleFrequencyID) { } /** * @param int $SurroundInfoID * * @return string */ public static function LAMEsurroundInfoLookup($SurroundInfoID) { } /** * @param array $LAMEtag * * @return string */ public static function LAMEpresetUsedLookup($LAMEtag) { } } class getid3_ogg extends \getid3_handler { /** * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html * * @return bool */ public function Analyze() { } /** * @param string $filedata * @param int $filedataoffset * @param array $oggpageinfo * * @return bool */ public function ParseVorbisPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) { } /** * @link http://tools.ietf.org/html/draft-ietf-codec-oggopus-03 * * @param string $filedata * @param int $filedataoffset * @param array $oggpageinfo * * @return bool */ public function ParseOpusPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) { } /** * @return array|false */ public function ParseOggPageHeader() { } /** * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810005 * * @return bool */ public function ParseVorbisComments() { } /** * @param int $mode * * @return string|null */ public static function SpeexBandModeLookup($mode) { } /** * @param array $OggInfoArray * @param int $SegmentNumber * * @return int */ public static function OggPageSegmentLength($OggInfoArray, $SegmentNumber = 1) { } /** * @param int $nominal_bitrate * * @return float */ public static function get_quality_from_nominal_bitrate($nominal_bitrate) { } /** * @param int $colorspace_id * * @return string|null */ public static function TheoraColorSpace($colorspace_id) { } /** * @param int $pixelformat_id * * @return string|null */ public static function TheoraPixelFormat($pixelformat_id) { } } class getid3_apetag extends \getid3_handler { /** * true: return full data for all attachments; * false: return no data for all attachments; * integer: return data for attachments <= than this; * string: save as file to this directory. * * @var int|bool|string */ public $inline_attachments = \true; public $overrideendoffset = 0; /** * @return bool */ public function Analyze() { } /** * @param string $APEheaderFooterData * * @return array|false */ public function parseAPEheaderFooter($APEheaderFooterData) { } /** * @param int $rawflagint * * @return array */ public function parseAPEtagFlags($rawflagint) { } /** * @param int $contenttypeid * * @return string */ public function APEcontentTypeFlagLookup($contenttypeid) { } /** * @param string $itemkey * * @return bool */ public function APEtagItemIsUTF8Lookup($itemkey) { } } class getid3_id3v1 extends \getid3_handler { /** * @return bool */ public function Analyze() { } /** * @param string $str * * @return string */ public static function cutfield($str) { } /** * @param bool $allowSCMPXextended * * @return string[] */ public static function ArrayOfGenres($allowSCMPXextended = \false) { } /** * @param string $genreid * @param bool $allowSCMPXextended * * @return string|false */ public static function LookupGenreName($genreid, $allowSCMPXextended = \true) { } /** * @param string $genre * @param bool $allowSCMPXextended * * @return string|false */ public static function LookupGenreID($genre, $allowSCMPXextended = \false) { } /** * @param string $OriginalGenre * * @return string|false */ public static function StandardiseID3v1GenreName($OriginalGenre) { } /** * @param string $title * @param string $artist * @param string $album * @param string $year * @param int $genreid * @param string $comment * @param int|string $track * * @return string */ public static function GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track = '') { } } class getid3_id3v2 extends \getid3_handler { public $StartingOffset = 0; /** * @return bool */ public function Analyze() { } /** * @param string $genrestring * * @return array */ public function ParseID3v2GenreString($genrestring) { } /** * @param array $parsedFrame * * @return bool */ public function ParseID3v2Frame(&$parsedFrame) { } /** * @param string $data * * @return string */ public function DeUnsynchronise($data) { } /** * @param int $index * * @return string */ public function LookupExtendedHeaderRestrictionsTagSizeLimits($index) { } /** * @param int $index * * @return string */ public function LookupExtendedHeaderRestrictionsTextEncodings($index) { } /** * @param int $index * * @return string */ public function LookupExtendedHeaderRestrictionsTextFieldSize($index) { } /** * @param int $index * * @return string */ public function LookupExtendedHeaderRestrictionsImageEncoding($index) { } /** * @param int $index * * @return string */ public function LookupExtendedHeaderRestrictionsImageSizeSize($index) { } /** * @param string $currencyid * * @return string */ public function LookupCurrencyUnits($currencyid) { } /** * @param string $currencyid * * @return string */ public function LookupCurrencyCountry($currencyid) { } /** * @param string $languagecode * @param bool $casesensitive * * @return string */ public static function LanguageLookup($languagecode, $casesensitive = \false) { } /** * @param int $index * * @return string */ public static function ETCOEventLookup($index) { } /** * @param int $index * * @return string */ public static function SYTLContentTypeLookup($index) { } /** * @param int $index * @param bool $returnarray * * @return array|string */ public static function APICPictureTypeLookup($index, $returnarray = \false) { } /** * @param int $index * * @return string */ public static function COMRReceivedAsLookup($index) { } /** * @param int $index * * @return string */ public static function RVA2ChannelTypeLookup($index) { } /** * @param string $framename * * @return string */ public static function FrameNameLongLookup($framename) { } /** * @param string $framename * * @return string */ public static function FrameNameShortLookup($framename) { } /** * @param string $encoding * * @return string */ public static function TextEncodingTerminatorLookup($encoding) { } /** * @param int $encoding * * @return string */ public static function TextEncodingNameLookup($encoding) { } /** * @param string $string * @param string $terminator * * @return string */ public static function RemoveStringTerminator($string, $terminator) { } /** * @param string $string * * @return string */ public static function MakeUTF16emptyStringEmpty($string) { } /** * @param string $framename * @param int $id3v2majorversion * * @return bool|int */ public static function IsValidID3v2FrameName($framename, $id3v2majorversion) { } /** * @param string $numberstring * @param bool $allowdecimal * @param bool $allownegative * * @return bool */ public static function IsANumber($numberstring, $allowdecimal = \false, $allownegative = \false) { } /** * @param string $datestamp * * @return bool */ public static function IsValidDateStampString($datestamp) { } /** * @param int $majorversion * * @return int */ public static function ID3v2HeaderLength($majorversion) { } /** * @param string $frame_name * * @return string|false */ public static function ID3v22iTunesBrokenFrameName($frame_name) { } } class getid3_lyrics3 extends \getid3_handler { /** * @return bool */ public function Analyze() { } /** * @param int $endoffset * @param int $version * @param int $length * * @return bool */ public function getLyrics3Data($endoffset, $version, $length) { } /** * @param string $rawtimestamp * * @return int|false */ public function Lyrics3Timestamp2Seconds($rawtimestamp) { } /** * @param array $Lyrics3data * * @return bool */ public function Lyrics3LyricsTimestampParse(&$Lyrics3data) { } /** * @param string $char * * @return bool|null */ public function IntString2Bool($char) { } } /** * IXR_Base64 * * @package IXR * @since 1.5.0 */ class IXR_Base64 { var $data; /** * PHP5 constructor. */ function __construct($data) { } /** * PHP4 constructor. */ public function IXR_Base64($data) { } function getXml() { } } /** * IXR_Client * * @package IXR * @since 1.5.0 * */ class IXR_Client { var $server; var $port; var $path; var $useragent; var $response; var $message = \false; var $debug = \false; var $timeout; var $headers = array(); var $error = \false; /** * PHP5 constructor. */ function __construct($server, $path = \false, $port = 80, $timeout = 15) { } /** * PHP4 constructor. */ public function IXR_Client($server, $path = \false, $port = 80, $timeout = 15) { } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */ function query(...$args) { } function getResponse() { } function isError() { } function getErrorCode() { } function getErrorMessage() { } } /** * IXR_ClientMulticall * * @package IXR * @since 1.5.0 */ class IXR_ClientMulticall extends \IXR_Client { var $calls = array(); /** * PHP5 constructor. */ function __construct($server, $path = \false, $port = 80) { } /** * PHP4 constructor. */ public function IXR_ClientMulticall($server, $path = \false, $port = 80) { } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. */ function addCall(...$args) { } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */ function query(...$args) { } } /** * IXR_Date * * @package IXR * @since 1.5.0 */ class IXR_Date { var $year; var $month; var $day; var $hour; var $minute; var $second; var $timezone; /** * PHP5 constructor. */ function __construct($time) { } /** * PHP4 constructor. */ public function IXR_Date($time) { } function parseTimestamp($timestamp) { } function parseIso($iso) { } function getIso() { } function getXml() { } function getTimestamp() { } } /** * IXR_Error * * @package IXR * @since 1.5.0 */ class IXR_Error { var $code; var $message; /** * PHP5 constructor. */ function __construct($code, $message) { } /** * PHP4 constructor. */ public function IXR_Error($code, $message) { } function getXml() { } } /** * IXR_Server * * @package IXR * @since 1.5.0 */ class IXR_Server { var $data; var $callbacks = array(); var $message; var $capabilities; /** * PHP5 constructor. */ function __construct($callbacks = \false, $data = \false, $wait = \false) { } /** * PHP4 constructor. */ public function IXR_Server($callbacks = \false, $data = \false, $wait = \false) { } function serve($data = \false) { } function call($methodname, $args) { } function error($error, $message = \false) { } function output($xml) { } function hasMethod($method) { } function setCapabilities() { } function getCapabilities($args) { } function setCallbacks() { } function listMethods($args) { } function multiCall($methodcalls) { } } /** * IXR_IntrospectionServer * * @package IXR * @since 1.5.0 */ class IXR_IntrospectionServer extends \IXR_Server { var $signatures; var $help; /** * PHP5 constructor. */ function __construct() { } /** * PHP4 constructor. */ public function IXR_IntrospectionServer() { } function addCallback($method, $callback, $args, $help) { } function call($methodname, $args) { } function methodSignature($method) { } function methodHelp($method) { } } /** * IXR_MESSAGE * * @package IXR * @since 1.5.0 * */ class IXR_Message { var $message = \false; var $messageType = \false; var $faultCode = \false; var $faultString = \false; var $methodName = ''; var $params = array(); var $_arraystructs = array(); var $_arraystructstypes = array(); var $_currentStructName = array(); var $_param; var $_value; var $_currentTag; var $_currentTagContents; var $_parser; /** * PHP5 constructor. */ function __construct($message) { } /** * PHP4 constructor. */ public function IXR_Message($message) { } function parse() { } function tag_open($parser, $tag, $attr) { } function cdata($parser, $cdata) { } function tag_close($parser, $tag) { } } /** * IXR_Request * * @package IXR * @since 1.5.0 */ class IXR_Request { var $method; var $args; var $xml; /** * PHP5 constructor. */ function __construct($method, $args) { } /** * PHP4 constructor. */ public function IXR_Request($method, $args) { } function getLength() { } function getXml() { } } /** * IXR_Value * * @package IXR * @since 1.5.0 */ class IXR_Value { var $data; var $type; /** * PHP5 constructor. */ function __construct($data, $type = \false) { } /** * PHP4 constructor. */ public function IXR_Value($data, $type = \false) { } function calculateType() { } function getXml() { } /** * Checks whether or not the supplied array is a struct or not * * @param array $array * @return bool */ function isStruct($array) { } } } namespace PHPMailer\PHPMailer { /** * PHPMailer exception handler. * * @author Marcus Bointon */ class Exception extends \Exception { /** * Prettify error message output. * * @return string */ public function errorMessage() { } } /** * PHPMailer - PHP email creation and transport class. * * @author Marcus Bointon (Synchro/coolbru) * @author Jim Jagielski (jimjag) * @author Andy Prevost (codeworxtech) * @author Brent R. Matzelle (original founder) */ class PHPMailer { const CHARSET_ASCII = 'us-ascii'; const CHARSET_ISO88591 = 'iso-8859-1'; const CHARSET_UTF8 = 'utf-8'; const CONTENT_TYPE_PLAINTEXT = 'text/plain'; const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar'; const CONTENT_TYPE_TEXT_HTML = 'text/html'; const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'; const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed'; const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related'; const ENCODING_7BIT = '7bit'; const ENCODING_8BIT = '8bit'; const ENCODING_BASE64 = 'base64'; const ENCODING_BINARY = 'binary'; const ENCODING_QUOTED_PRINTABLE = 'quoted-printable'; const ENCRYPTION_STARTTLS = 'tls'; const ENCRYPTION_SMTPS = 'ssl'; const ICAL_METHOD_REQUEST = 'REQUEST'; const ICAL_METHOD_PUBLISH = 'PUBLISH'; const ICAL_METHOD_REPLY = 'REPLY'; const ICAL_METHOD_ADD = 'ADD'; const ICAL_METHOD_CANCEL = 'CANCEL'; const ICAL_METHOD_REFRESH = 'REFRESH'; const ICAL_METHOD_COUNTER = 'COUNTER'; const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER'; /** * Email priority. * Options: null (default), 1 = High, 3 = Normal, 5 = low. * When null, the header is not set at all. * * @var int|null */ public $Priority; /** * The character set of the message. * * @var string */ public $CharSet = self::CHARSET_ISO88591; /** * The MIME Content-type of the message. * * @var string */ public $ContentType = self::CONTENT_TYPE_PLAINTEXT; /** * The message encoding. * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". * * @var string */ public $Encoding = self::ENCODING_8BIT; /** * Holds the most recent mailer error message. * * @var string */ public $ErrorInfo = ''; /** * The From email address for the message. * * @var string */ public $From = ''; /** * The From name of the message. * * @var string */ public $FromName = ''; /** * The envelope sender of the message. * This will usually be turned into a Return-Path header by the receiver, * and is the address that bounces will be sent to. * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP. * * @var string */ public $Sender = ''; /** * The Subject of the message. * * @var string */ public $Subject = ''; /** * An HTML or plain text message body. * If HTML then call isHTML(true). * * @var string */ public $Body = ''; /** * The plain-text message body. * This body can be read by mail clients that do not have HTML email * capability such as mutt & Eudora. * Clients that can read HTML will view the normal Body. * * @var string */ public $AltBody = ''; /** * An iCal message part body. * Only supported in simple alt or alt_inline message types * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. * * @see https://kigkonsult.se/iCalcreator/ * * @var string */ public $Ical = ''; /** * Value-array of "method" in Contenttype header "text/calendar" * * @var string[] */ protected static $IcalMethods = [self::ICAL_METHOD_REQUEST, self::ICAL_METHOD_PUBLISH, self::ICAL_METHOD_REPLY, self::ICAL_METHOD_ADD, self::ICAL_METHOD_CANCEL, self::ICAL_METHOD_REFRESH, self::ICAL_METHOD_COUNTER, self::ICAL_METHOD_DECLINECOUNTER]; /** * The complete compiled MIME message body. * * @var string */ protected $MIMEBody = ''; /** * The complete compiled MIME message headers. * * @var string */ protected $MIMEHeader = ''; /** * Extra headers that createHeader() doesn't fold in. * * @var string */ protected $mailHeader = ''; /** * Word-wrap the message body to this number of chars. * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. * * @see static::STD_LINE_LENGTH * * @var int */ public $WordWrap = 0; /** * Which method to use to send mail. * Options: "mail", "sendmail", or "smtp". * * @var string */ public $Mailer = 'mail'; /** * The path to the sendmail program. * * @var string */ public $Sendmail = '/usr/sbin/sendmail'; /** * Whether mail() uses a fully sendmail-compatible MTA. * One which supports sendmail's "-oi -f" options. * * @var bool */ public $UseSendmailOptions = true; /** * The email address that a reading confirmation should be sent to, also known as read receipt. * * @var string */ public $ConfirmReadingTo = ''; /** * The hostname to use in the Message-ID header and as default HELO string. * If empty, PHPMailer attempts to find one with, in order, * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value * 'localhost.localdomain'. * * @see PHPMailer::$Helo * * @var string */ public $Hostname = ''; /** * An ID to be used in the Message-ID header. * If empty, a unique id will be generated. * You can set your own, but it must be in the format "", * as defined in RFC5322 section 3.6.4 or it will be ignored. * * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 * * @var string */ public $MessageID = ''; /** * The message Date to be used in the Date header. * If empty, the current date will be added. * * @var string */ public $MessageDate = ''; /** * SMTP hosts. * Either a single hostname or multiple semicolon-delimited hostnames. * You can also specify a different port * for each host by using this format: [hostname:port] * (e.g. "smtp1.example.com:25;smtp2.example.com"). * You can also specify encryption type, for example: * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). * Hosts will be tried in order. * * @var string */ public $Host = 'localhost'; /** * The default SMTP server port. * * @var int */ public $Port = 25; /** * The SMTP HELO/EHLO name used for the SMTP connection. * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find * one with the same method described above for $Hostname. * * @see PHPMailer::$Hostname * * @var string */ public $Helo = ''; /** * What kind of encryption to use on the SMTP connection. * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS. * * @var string */ public $SMTPSecure = ''; /** * Whether to enable TLS encryption automatically if a server supports it, * even if `SMTPSecure` is not set to 'tls'. * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. * * @var bool */ public $SMTPAutoTLS = true; /** * Whether to use SMTP authentication. * Uses the Username and Password properties. * * @see PHPMailer::$Username * @see PHPMailer::$Password * * @var bool */ public $SMTPAuth = false; /** * Options array passed to stream_context_create when connecting via SMTP. * * @var array */ public $SMTPOptions = []; /** * SMTP username. * * @var string */ public $Username = ''; /** * SMTP password. * * @var string */ public $Password = ''; /** * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2. * If not specified, the first one from that list that the server supports will be selected. * * @var string */ public $AuthType = ''; /** * SMTP SMTPXClient command attributes * * @var array */ protected $SMTPXClient = []; /** * An implementation of the PHPMailer OAuthTokenProvider interface. * * @var OAuthTokenProvider */ protected $oauth; /** * The SMTP server timeout in seconds. * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. * * @var int */ public $Timeout = 300; /** * Comma separated list of DSN notifications * 'NEVER' under no circumstances a DSN must be returned to the sender. * If you use NEVER all other notifications will be ignored. * 'SUCCESS' will notify you when your mail has arrived at its destination. * 'FAILURE' will arrive if an error occurred during delivery. * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual * delivery's outcome (success or failure) is not yet decided. * * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY */ public $dsn = ''; /** * SMTP class debug output mode. * Debug output level. * Options: * @see SMTP::DEBUG_OFF: No output * @see SMTP::DEBUG_CLIENT: Client messages * @see SMTP::DEBUG_SERVER: Client and server messages * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed * * @see SMTP::$do_debug * * @var int */ public $SMTPDebug = 0; /** * How to handle debug output. * Options: * * `echo` Output plain-text as-is, appropriate for CLI * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output * * `error_log` Output to error log as configured in php.ini * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. * Alternatively, you can provide a callable expecting two params: a message string and the debug level: * * ```php * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; * ``` * * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` * level output is used: * * ```php * $mail->Debugoutput = new myPsr3Logger; * ``` * * @see SMTP::$Debugoutput * * @var string|callable|\Psr\Log\LoggerInterface */ public $Debugoutput = 'echo'; /** * Whether to keep the SMTP connection open after each message. * If this is set to true then the connection will remain open after a send, * and closing the connection will require an explicit call to smtpClose(). * It's a good idea to use this if you are sending multiple messages as it reduces overhead. * See the mailing list example for how to use it. * * @var bool */ public $SMTPKeepAlive = false; /** * Whether to split multiple to addresses into multiple messages * or send them all in one message. * Only supported in `mail` and `sendmail` transports, not in SMTP. * * @var bool * * @deprecated 6.0.0 PHPMailer isn't a mailing list manager! */ public $SingleTo = false; /** * Storage for addresses when SingleTo is enabled. * * @var array */ protected $SingleToArray = []; /** * Whether to generate VERP addresses on send. * Only applicable when sending via SMTP. * * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path * @see https://www.postfix.org/VERP_README.html Postfix VERP info * * @var bool */ public $do_verp = false; /** * Whether to allow sending messages with an empty body. * * @var bool */ public $AllowEmpty = false; /** * DKIM selector. * * @var string */ public $DKIM_selector = ''; /** * DKIM Identity. * Usually the email address used as the source of the email. * * @var string */ public $DKIM_identity = ''; /** * DKIM passphrase. * Used if your key is encrypted. * * @var string */ public $DKIM_passphrase = ''; /** * DKIM signing domain name. * * @example 'example.com' * * @var string */ public $DKIM_domain = ''; /** * DKIM Copy header field values for diagnostic use. * * @var bool */ public $DKIM_copyHeaderFields = true; /** * DKIM Extra signing headers. * * @example ['List-Unsubscribe', 'List-Help'] * * @var array */ public $DKIM_extraHeaders = []; /** * DKIM private key file path. * * @var string */ public $DKIM_private = ''; /** * DKIM private key string. * * If set, takes precedence over `$DKIM_private`. * * @var string */ public $DKIM_private_string = ''; /** * Callback Action function name. * * The function that handles the result of the send email action. * It is called out by send() for each email sent. * * Value can be any php callable: https://www.php.net/is_callable * * Parameters: * bool $result result of the send action * array $to email addresses of the recipients * array $cc cc email addresses * array $bcc bcc email addresses * string $subject the subject * string $body the email body * string $from email address of sender * string $extra extra information of possible use * "smtp_transaction_id' => last smtp transaction id * * @var string */ public $action_function = ''; /** * What to put in the X-Mailer header. * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use. * * @var string|null */ public $XMailer = ''; /** * Which validator to use by default when validating email addresses. * May be a callable to inject your own validator, but there are several built-in validators. * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. * * @see PHPMailer::validateAddress() * * @var string|callable */ public static $validator = 'php'; /** * An instance of the SMTP sender class. * * @var SMTP */ protected $smtp; /** * The array of 'to' names and addresses. * * @var array */ protected $to = []; /** * The array of 'cc' names and addresses. * * @var array */ protected $cc = []; /** * The array of 'bcc' names and addresses. * * @var array */ protected $bcc = []; /** * The array of reply-to names and addresses. * * @var array */ protected $ReplyTo = []; /** * An array of all kinds of addresses. * Includes all of $to, $cc, $bcc. * * @see PHPMailer::$to * @see PHPMailer::$cc * @see PHPMailer::$bcc * * @var array */ protected $all_recipients = []; /** * An array of names and addresses queued for validation. * In send(), valid and non duplicate entries are moved to $all_recipients * and one of $to, $cc, or $bcc. * This array is used only for addresses with IDN. * * @see PHPMailer::$to * @see PHPMailer::$cc * @see PHPMailer::$bcc * @see PHPMailer::$all_recipients * * @var array */ protected $RecipientsQueue = []; /** * An array of reply-to names and addresses queued for validation. * In send(), valid and non duplicate entries are moved to $ReplyTo. * This array is used only for addresses with IDN. * * @see PHPMailer::$ReplyTo * * @var array */ protected $ReplyToQueue = []; /** * The array of attachments. * * @var array */ protected $attachment = []; /** * The array of custom headers. * * @var array */ protected $CustomHeader = []; /** * The most recent Message-ID (including angular brackets). * * @var string */ protected $lastMessageID = ''; /** * The message's MIME type. * * @var string */ protected $message_type = ''; /** * The array of MIME boundary strings. * * @var array */ protected $boundary = []; /** * The array of available text strings for the current language. * * @var array */ protected $language = []; /** * The number of errors encountered. * * @var int */ protected $error_count = 0; /** * The S/MIME certificate file path. * * @var string */ protected $sign_cert_file = ''; /** * The S/MIME key file path. * * @var string */ protected $sign_key_file = ''; /** * The optional S/MIME extra certificates ("CA Chain") file path. * * @var string */ protected $sign_extracerts_file = ''; /** * The S/MIME password for the key. * Used only if the key is encrypted. * * @var string */ protected $sign_key_pass = ''; /** * Whether to throw exceptions for errors. * * @var bool */ protected $exceptions = false; /** * Unique ID used for message ID and boundaries. * * @var string */ protected $uniqueid = ''; /** * The PHPMailer Version number. * * @var string */ const VERSION = '6.9.2'; /** * Error severity: message only, continue processing. * * @var int */ const STOP_MESSAGE = 0; /** * Error severity: message, likely ok to continue processing. * * @var int */ const STOP_CONTINUE = 1; /** * Error severity: message, plus full stop, critical error reached. * * @var int */ const STOP_CRITICAL = 2; /** * The SMTP standard CRLF line break. * If you want to change line break format, change static::$LE, not this. */ const CRLF = "\r\n"; /** * "Folding White Space" a white space string used for line folding. */ const FWS = ' '; /** * SMTP RFC standard line ending; Carriage Return, Line Feed. * * @var string */ protected static $LE = self::CRLF; /** * The maximum line length supported by mail(). * * Background: mail() will sometimes corrupt messages * with headers longer than 65 chars, see #818. * * @var int */ const MAIL_MAX_LINE_LENGTH = 63; /** * The maximum line length allowed by RFC 2822 section 2.1.1. * * @var int */ const MAX_LINE_LENGTH = 998; /** * The lower maximum line length allowed by RFC 2822 section 2.1.1. * This length does NOT include the line break * 76 means that lines will be 77 or 78 chars depending on whether * the line break format is LF or CRLF; both are valid. * * @var int */ const STD_LINE_LENGTH = 76; /** * Constructor. * * @param bool $exceptions Should we throw external exceptions? */ public function __construct($exceptions = null) { } /** * Destructor. */ public function __destruct() { } /** * Output debugging info via a user-defined method. * Only generates output if debug output is enabled. * * @see PHPMailer::$Debugoutput * @see PHPMailer::$SMTPDebug * * @param string $str * @phpstan-return void */ protected function edebug($str) { } /** * Sets message type to HTML or plain. * * @param bool $isHtml True for HTML mode */ public function isHTML($isHtml = true) { } /** * Send messages using SMTP. */ public function isSMTP() { } /** * Send messages using PHP's mail() function. */ public function isMail() { } /** * Send messages using $Sendmail. */ public function isSendmail() { } /** * Send messages using qmail. */ public function isQmail() { } /** * Add a "To" address. * * @param string $address The email address to send to * @param string $name * * @throws Exception * * @return bool true on success, false if address already used or invalid in some way */ public function addAddress($address, $name = '') { } /** * Add a "CC" address. * * @param string $address The email address to send to * @param string $name * * @throws Exception * * @return bool true on success, false if address already used or invalid in some way */ public function addCC($address, $name = '') { } /** * Add a "BCC" address. * * @param string $address The email address to send to * @param string $name * * @throws Exception * * @return bool true on success, false if address already used or invalid in some way */ public function addBCC($address, $name = '') { } /** * Add a "Reply-To" address. * * @param string $address The email address to reply to * @param string $name * * @throws Exception * * @return bool true on success, false if address already used or invalid in some way */ public function addReplyTo($address, $name = '') { } /** * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still * be modified after calling this function), addition of such addresses is delayed until send(). * Addresses that have been added already return false, but do not throw exceptions. * * @param string $kind One of 'to', 'cc', 'bcc', or 'Reply-To' * @param string $address The email address * @param string $name An optional username associated with the address * * @throws Exception * * @return bool true on success, false if address already used or invalid in some way * @phpstan-param 'to'|'cc'|'bcc'|'Reply-To' $kind */ protected function addOrEnqueueAnAddress($kind, $address, $name) { } /** * Set the boundaries to use for delimiting MIME parts. * If you override this, ensure you set all 3 boundaries to unique values. * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 * * @return void */ public function setBoundaries() { } /** * Add an address to one of the recipient arrays or to the ReplyTo array. * Addresses that have been added already return false, but do not throw exceptions. * * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' * @param string $address The email address to send, resp. to reply to * @param string $name * * @throws Exception * * @return bool true on success, false if address already used or invalid in some way * @phpstan-param 'to'|'cc'|'bcc'|'ReplyTo' $kind */ protected function addAnAddress($kind, $address, $name = '') { } /** * Parse and validate a string containing one or more RFC822-style comma-separated email addresses * of the form "display name
" into an array of name/address pairs. * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. * Note that quotes in the name part are removed. * * @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation * * @param string $addrstr The address list string * @param bool $useimap Whether to use the IMAP extension to parse the list * @param string $charset The charset to use when decoding the address list string. * * @return array */ public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) { } /** * Set the From and FromName properties. * * @param string $address * @param string $name * @param bool $auto Whether to also set the Sender address, defaults to true * * @throws Exception * * @return bool */ public function setFrom($address, $name = '', $auto = true) { } /** * Return the Message-ID header of the last email. * Technically this is the value from the last time the headers were created, * but it's also the message ID of the last sent message except in * pathological cases. * * @return string */ public function getLastMessageID() { } /** * Check that a string looks like an email address. * Validation patterns supported: * * `auto` Pick best pattern automatically; * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0; * * `pcre` Use old PCRE implementation; * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. * * `noregex` Don't use a regex: super fast, really dumb. * Alternatively you may pass in a callable to inject your own validator, for example: * * ```php * PHPMailer::validateAddress('user@example.com', function($address) { * return (strpos($address, '@') !== false); * }); * ``` * * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. * * @param string $address The email address to check * @param string|callable $patternselect Which pattern to use * * @return bool */ public static function validateAddress($address, $patternselect = null) { } /** * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the * `intl` and `mbstring` PHP extensions. * * @return bool `true` if required functions for IDN support are present */ public static function idnSupported() { } /** * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. * This function silently returns unmodified address if: * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) * - Conversion to punycode is impossible (e.g. required PHP functions are not available) * or fails for any reason (e.g. domain contains characters not allowed in an IDN). * * @see PHPMailer::$CharSet * * @param string $address The email address to convert * * @return string The encoded address in ASCII form */ public function punyencodeAddress($address) { } /** * Create a message and send it. * Uses the sending method specified by $Mailer. * * @throws Exception * * @return bool false on error - See the ErrorInfo property for details of the error */ public function send() { } /** * Prepare a message for sending. * * @throws Exception * * @return bool */ public function preSend() { } /** * Actually send a message via the selected mechanism. * * @throws Exception * * @return bool */ public function postSend() { } /** * Send mail using the $Sendmail program. * * @see PHPMailer::$Sendmail * * @param string $header The message headers * @param string $body The message body * * @throws Exception * * @return bool */ protected function sendmailSend($header, $body) { } /** * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. * * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report * * @param string $string The string to be validated * * @return bool */ protected static function isShellSafe($string) { } /** * Check whether a file path is of a permitted type. * Used to reject URLs and phar files from functions that access local file paths, * such as addAttachment. * * @param string $path A relative or absolute path to a file * * @return bool */ protected static function isPermittedPath($path) { } /** * Check whether a file path is safe, accessible, and readable. * * @param string $path A relative or absolute path to a file * * @return bool */ protected static function fileIsAccessible($path) { } /** * Send mail using the PHP mail() function. * * @see https://www.php.net/manual/en/book.mail.php * * @param string $header The message headers * @param string $body The message body * * @throws Exception * * @return bool */ protected function mailSend($header, $body) { } /** * Get an instance to use for SMTP operations. * Override this function to load your own SMTP implementation, * or set one with setSMTPInstance. * * @return SMTP */ public function getSMTPInstance() { } /** * Provide an instance to use for SMTP operations. * * @return SMTP */ public function setSMTPInstance(\PHPMailer\PHPMailer\SMTP $smtp) { } /** * Provide SMTP XCLIENT attributes * * @param string $name Attribute name * @param ?string $value Attribute value * * @return bool */ public function setSMTPXclientAttribute($name, $value) { } /** * Get SMTP XCLIENT attributes * * @return array */ public function getSMTPXclientAttributes() { } /** * Send mail via SMTP. * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. * * @see PHPMailer::setSMTPInstance() to use a different class. * * @uses \PHPMailer\PHPMailer\SMTP * * @param string $header The message headers * @param string $body The message body * * @throws Exception * * @return bool */ protected function smtpSend($header, $body) { } /** * Initiate a connection to an SMTP server. * Returns false if the operation failed. * * @param array $options An array of options compatible with stream_context_create() * * @throws Exception * * @uses \PHPMailer\PHPMailer\SMTP * * @return bool */ public function smtpConnect($options = null) { } /** * Close the active SMTP session if one exists. */ public function smtpClose() { } /** * Set the language for error messages. * The default language is English. * * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") * Optionally, the language code can be enhanced with a 4-character * script annotation and/or a 2-character country annotation. * @param string $lang_path Path to the language file directory, with trailing separator (slash) * Do not set this from user input! * * @return bool Returns true if the requested language was loaded, false otherwise. */ public function setLanguage($langcode = 'en', $lang_path = '') { } /** * Get the array of strings for the current language. * * @return array */ public function getTranslations() { } /** * Create recipient headers. * * @param string $type * @param array $addr An array of recipients, * where each recipient is a 2-element indexed array with element 0 containing an address * and element 1 containing a name, like: * [['joe@example.com', 'Joe User'], ['zoe@example.com', 'Zoe User']] * * @return string */ public function addrAppend($type, $addr) { } /** * Format an address for use in a message header. * * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name like * ['joe@example.com', 'Joe User'] * * @return string */ public function addrFormat($addr) { } /** * Word-wrap message. * For use with mailers that do not automatically perform wrapping * and for quoted-printable encoded messages. * Original written by philippe. * * @param string $message The message to wrap * @param int $length The line length to wrap to * @param bool $qp_mode Whether to run in Quoted-Printable mode * * @return string */ public function wrapText($message, $length, $qp_mode = false) { } /** * Find the last character boundary prior to $maxLength in a utf-8 * quoted-printable encoded string. * Original written by Colin Brown. * * @param string $encodedText utf-8 QP text * @param int $maxLength Find the last character boundary prior to this length * * @return int */ public function utf8CharBoundary($encodedText, $maxLength) { } /** * Apply word wrapping to the message body. * Wraps the message body to the number of chars set in the WordWrap property. * You should only do this to plain-text bodies as wrapping HTML tags may break them. * This is called automatically by createBody(), so you don't need to call it yourself. * @phpstan-return void */ public function setWordWrap() { } /** * Assemble message headers. * * @return string The assembled headers */ public function createHeader() { } /** * Get the message MIME type headers. * * @return string */ public function getMailMIME() { } /** * Returns the whole MIME message. * Includes complete headers and body. * Only valid post preSend(). * * @see PHPMailer::preSend() * * @return string */ public function getSentMIMEMessage() { } /** * Create a unique ID to use for boundaries. * * @return string */ protected function generateId() { } /** * Assemble the message body. * Returns an empty string on failure. * * @throws Exception * * @return string The assembled message body */ public function createBody() { } /** * Get the boundaries that this message will use * @return array */ public function getBoundaries() { } /** * Return the start of a message boundary. * * @param string $boundary * @param string $charSet * @param string $contentType * @param string $encoding * * @return string */ protected function getBoundary($boundary, $charSet, $contentType, $encoding) { } /** * Return the end of a message boundary. * * @param string $boundary * * @return string */ protected function endBoundary($boundary) { } /** * Set the message type. * PHPMailer only supports some preset message types, not arbitrary MIME structures. */ protected function setMessageType() { } /** * Format a header line. * * @param string $name * @param string|int $value * * @return string */ public function headerLine($name, $value) { } /** * Return a formatted mail line. * * @param string $value * * @return string */ public function textLine($value) { } /** * Add an attachment from a path on the filesystem. * Never use a user-supplied path to a file! * Returns false if the file could not be found or read. * Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. * If you need to do that, fetch the resource yourself and pass it in via a local file or string. * * @param string $path Path to the attachment * @param string $name Overrides the attachment name * @param string $encoding File encoding (see $Encoding) * @param string $type MIME type, e.g. `image/jpeg`; determined automatically from $path if not specified * @param string $disposition Disposition to use * * @throws Exception * * @return bool */ public function addAttachment($path, $name = '', $encoding = self::ENCODING_BASE64, $type = '', $disposition = 'attachment') { } /** * Return the array of attachments. * * @return array */ public function getAttachments() { } /** * Attach all file, string, and binary attachments to the message. * Returns an empty string on failure. * * @param string $disposition_type * @param string $boundary * * @throws Exception * * @return string */ protected function attachAll($disposition_type, $boundary) { } /** * Encode a file attachment in requested format. * Returns an empty string on failure. * * @param string $path The full path to the file * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * * @return string */ protected function encodeFile($path, $encoding = self::ENCODING_BASE64) { } /** * Encode a string in requested format. * Returns an empty string on failure. * * @param string $str The text to encode * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * * @throws Exception * * @return string */ public function encodeString($str, $encoding = self::ENCODING_BASE64) { } /** * Encode a header value (not including its label) optimally. * Picks shortest of Q, B, or none. Result includes folding if needed. * See RFC822 definitions for phrase, comment and text positions. * * @param string $str The header value to encode * @param string $position What context the string will be used in * * @return string */ public function encodeHeader($str, $position = 'text') { } /** * Check if a string contains multi-byte characters. * * @param string $str multi-byte text to wrap encode * * @return bool */ public function hasMultiBytes($str) { } /** * Does a string contain any 8-bit chars (in any charset)? * * @param string $text * * @return bool */ public function has8bitChars($text) { } /** * Encode and wrap long multibyte strings for mail headers * without breaking lines within a character. * Adapted from a function by paravoid. * * @see https://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 * * @param string $str multi-byte text to wrap encode * @param string $linebreak string to use as linefeed/end-of-line * * @return string */ public function base64EncodeWrapMB($str, $linebreak = null) { } /** * Encode a string in quoted-printable format. * According to RFC2045 section 6.7. * * @param string $string The text to encode * * @return string */ public function encodeQP($string) { } /** * Encode a string using Q encoding. * * @see https://www.rfc-editor.org/rfc/rfc2047#section-4.2 * * @param string $str the text to encode * @param string $position Where the text is going to be used, see the RFC for what that means * * @return string */ public function encodeQ($str, $position = 'text') { } /** * Add a string or binary attachment (non-filesystem). * This method can be used to attach ascii or binary data, * such as a BLOB record from a database. * * @param string $string String attachment data * @param string $filename Name of the attachment * @param string $encoding File encoding (see $Encoding) * @param string $type File extension (MIME) type * @param string $disposition Disposition to use * * @throws Exception * * @return bool True on successfully adding an attachment */ public function addStringAttachment($string, $filename, $encoding = self::ENCODING_BASE64, $type = '', $disposition = 'attachment') { } /** * Add an embedded (inline) attachment from a file. * This can include images, sounds, and just about any other document type. * These differ from 'regular' attachments in that they are intended to be * displayed inline with the message, not just attached for download. * This is used in HTML messages that embed the images * the HTML refers to using the `$cid` value in `img` tags, for example ``. * Never use a user-supplied path to a file! * * @param string $path Path to the attachment * @param string $cid Content ID of the attachment; Use this to reference * the content when using an embedded image in HTML * @param string $name Overrides the attachment filename * @param string $encoding File encoding (see $Encoding) defaults to `base64` * @param string $type File MIME type (by default mapped from the `$path` filename's extension) * @param string $disposition Disposition to use: `inline` (default) or `attachment` * (unlikely you want this – {@see `addAttachment()`} instead) * * @return bool True on successfully adding an attachment * @throws Exception * */ public function addEmbeddedImage($path, $cid, $name = '', $encoding = self::ENCODING_BASE64, $type = '', $disposition = 'inline') { } /** * Add an embedded stringified attachment. * This can include images, sounds, and just about any other document type. * If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type. * * @param string $string The attachment binary data * @param string $cid Content ID of the attachment; Use this to reference * the content when using an embedded image in HTML * @param string $name A filename for the attachment. If this contains an extension, * PHPMailer will attempt to set a MIME type for the attachment. * For example 'file.jpg' would get an 'image/jpeg' MIME type. * @param string $encoding File encoding (see $Encoding), defaults to 'base64' * @param string $type MIME type - will be used in preference to any automatically derived type * @param string $disposition Disposition to use * * @throws Exception * * @return bool True on successfully adding an attachment */ public function addStringEmbeddedImage($string, $cid, $name = '', $encoding = self::ENCODING_BASE64, $type = '', $disposition = 'inline') { } /** * Validate encodings. * * @param string $encoding * * @return bool */ protected function validateEncoding($encoding) { } /** * Check if an embedded attachment is present with this cid. * * @param string $cid * * @return bool */ protected function cidExists($cid) { } /** * Check if an inline attachment is present. * * @return bool */ public function inlineImageExists() { } /** * Check if an attachment (non-inline) is present. * * @return bool */ public function attachmentExists() { } /** * Check if this message has an alternative body set. * * @return bool */ public function alternativeExists() { } /** * Clear queued addresses of given kind. * * @param string $kind 'to', 'cc', or 'bcc' */ public function clearQueuedAddresses($kind) { } /** * Clear all To recipients. */ public function clearAddresses() { } /** * Clear all CC recipients. */ public function clearCCs() { } /** * Clear all BCC recipients. */ public function clearBCCs() { } /** * Clear all ReplyTo recipients. */ public function clearReplyTos() { } /** * Clear all recipient types. */ public function clearAllRecipients() { } /** * Clear all filesystem, string, and binary attachments. */ public function clearAttachments() { } /** * Clear all custom headers. */ public function clearCustomHeaders() { } /** * Clear a specific custom header by name or name and value. * $name value can be overloaded to contain * both header name and value (name:value). * * @param string $name Custom header name * @param string|null $value Header value * * @return bool True if a header was replaced successfully */ public function clearCustomHeader($name, $value = null) { } /** * Replace a custom header. * $name value can be overloaded to contain * both header name and value (name:value). * * @param string $name Custom header name * @param string|null $value Header value * * @return bool True if a header was replaced successfully * @throws Exception */ public function replaceCustomHeader($name, $value = null) { } /** * Add an error message to the error container. * * @param string $msg */ protected function setError($msg) { } /** * Return an RFC 822 formatted date. * * @return string */ public static function rfcDate() { } /** * Get the server hostname. * Returns 'localhost.localdomain' if unknown. * * @return string */ protected function serverHostname() { } /** * Validate whether a string contains a valid value to use as a hostname or IP address. * IPv6 addresses must include [], e.g. `[::1]`, not just `::1`. * * @param string $host The host name or IP address to check * * @return bool */ public static function isValidHost($host) { } /** * Get an error message in the current language. * * @param string $key * * @return string */ protected function lang($key) { } /** * Check if an error occurred. * * @return bool True if an error did occur */ public function isError() { } /** * Add a custom header. * $name value can be overloaded to contain * both header name and value (name:value). * * @param string $name Custom header name * @param string|null $value Header value * * @return bool True if a header was set successfully * @throws Exception */ public function addCustomHeader($name, $value = null) { } /** * Returns all custom headers. * * @return array */ public function getCustomHeaders() { } /** * Create a message body from an HTML string. * Automatically inlines images and creates a plain-text version by converting the HTML, * overwriting any existing values in Body and AltBody. * Do not source $message content from user input! * $basedir is prepended when handling relative URLs, e.g. and must not be empty * will look for an image file in $basedir/images/a.png and convert it to inline. * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) * Converts data-uri images into embedded attachments. * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly. * * @param string $message HTML message string * @param string $basedir Absolute path to a base directory to prepend to relative paths to images * @param bool|callable $advanced Whether to use the internal HTML to text converter * or your own custom converter * @return string The transformed message body * * @throws Exception * * @see PHPMailer::html2text() */ public function msgHTML($message, $basedir = '', $advanced = false) { } /** * Convert an HTML string into plain text. * This is used by msgHTML(). * Note - older versions of this function used a bundled advanced converter * which was removed for license reasons in #232. * Example usage: * * ```php * //Use default conversion * $plain = $mail->html2text($html); * //Use your own custom converter * $plain = $mail->html2text($html, function($html) { * $converter = new MyHtml2text($html); * return $converter->get_text(); * }); * ``` * * @param string $html The HTML text to convert * @param bool|callable $advanced Any boolean value to use the internal converter, * or provide your own callable for custom conversion. * *Never* pass user-supplied data into this parameter * * @return string */ public function html2text($html, $advanced = false) { } /** * Get the MIME type for a file extension. * * @param string $ext File extension * * @return string MIME type of file */ public static function _mime_types($ext = '') { } /** * Map a file name to a MIME type. * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. * * @param string $filename A file name or full path, does not need to exist as a file * * @return string */ public static function filenameToType($filename) { } /** * Multi-byte-safe pathinfo replacement. * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe. * * @see https://www.php.net/manual/en/function.pathinfo.php#107461 * * @param string $path A filename or path, does not need to exist as a file * @param int|string $options Either a PATHINFO_* constant, * or a string name to return only the specified piece * * @return string|array */ public static function mb_pathinfo($path, $options = null) { } /** * Set or reset instance properties. * You should avoid this function - it's more verbose, less efficient, more error-prone and * harder to debug than setting properties directly. * Usage Example: * `$mail->set('SMTPSecure', static::ENCRYPTION_STARTTLS);` * is the same as: * `$mail->SMTPSecure = static::ENCRYPTION_STARTTLS;`. * * @param string $name The property name to set * @param mixed $value The value to set the property to * * @return bool */ public function set($name, $value = '') { } /** * Strip newlines to prevent header injection. * * @param string $str * * @return string */ public function secureHeader($str) { } /** * Normalize line breaks in a string. * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. * Defaults to CRLF (for message bodies) and preserves consecutive breaks. * * @param string $text * @param string $breaktype What kind of line break to use; defaults to static::$LE * * @return string */ public static function normalizeBreaks($text, $breaktype = null) { } /** * Remove trailing whitespace from a string. * * @param string $text * * @return string The text to remove whitespace from */ public static function stripTrailingWSP($text) { } /** * Strip trailing line breaks from a string. * * @param string $text * * @return string The text to remove breaks from */ public static function stripTrailingBreaks($text) { } /** * Return the current line break format string. * * @return string */ public static function getLE() { } /** * Set the line break format string, e.g. "\r\n". * * @param string $le */ protected static function setLE($le) { } /** * Set the public and private key files and password for S/MIME signing. * * @param string $cert_filename * @param string $key_filename * @param string $key_pass Password for private key * @param string $extracerts_filename Optional path to chain certificate */ public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') { } /** * Quoted-Printable-encode a DKIM header. * * @param string $txt * * @return string */ public function DKIM_QP($txt) { } /** * Generate a DKIM signature. * * @param string $signHeader * * @throws Exception * * @return string The DKIM signature value */ public function DKIM_Sign($signHeader) { } /** * Generate a DKIM canonicalization header. * Uses the 'relaxed' algorithm from RFC6376 section 3.4.2. * Canonicalized headers should *always* use CRLF, regardless of mailer setting. * * @see https://tools.ietf.org/html/rfc6376#section-3.4.2 * * @param string $signHeader Header * * @return string */ public function DKIM_HeaderC($signHeader) { } /** * Generate a DKIM canonicalization body. * Uses the 'simple' algorithm from RFC6376 section 3.4.3. * Canonicalized bodies should *always* use CRLF, regardless of mailer setting. * * @see https://tools.ietf.org/html/rfc6376#section-3.4.3 * * @param string $body Message Body * * @return string */ public function DKIM_BodyC($body) { } /** * Create the DKIM header and body in a new message header. * * @param string $headers_line Header lines * @param string $subject Subject * @param string $body Body * * @throws Exception * * @return string */ public function DKIM_Add($headers_line, $subject, $body) { } /** * Detect if a string contains a line longer than the maximum line length * allowed by RFC 2822 section 2.1.1. * * @param string $str * * @return bool */ public static function hasLineLongerThanMax($str) { } /** * If a string contains any "special" characters, double-quote the name, * and escape any double quotes with a backslash. * * @param string $str * * @return string * * @see RFC822 3.4.1 */ public static function quotedString($str) { } /** * Allows for public read access to 'to' property. * Before the send() call, queued addresses (i.e. with IDN) are not yet included. * * @return array */ public function getToAddresses() { } /** * Allows for public read access to 'cc' property. * Before the send() call, queued addresses (i.e. with IDN) are not yet included. * * @return array */ public function getCcAddresses() { } /** * Allows for public read access to 'bcc' property. * Before the send() call, queued addresses (i.e. with IDN) are not yet included. * * @return array */ public function getBccAddresses() { } /** * Allows for public read access to 'ReplyTo' property. * Before the send() call, queued addresses (i.e. with IDN) are not yet included. * * @return array */ public function getReplyToAddresses() { } /** * Allows for public read access to 'all_recipients' property. * Before the send() call, queued addresses (i.e. with IDN) are not yet included. * * @return array */ public function getAllRecipientAddresses() { } /** * Perform a callback. * * @param bool $isSent * @param array $to * @param array $cc * @param array $bcc * @param string $subject * @param string $body * @param string $from * @param array $extra */ protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra) { } /** * Get the OAuthTokenProvider instance. * * @return OAuthTokenProvider */ public function getOAuth() { } /** * Set an OAuthTokenProvider instance. */ public function setOAuth(\PHPMailer\PHPMailer\OAuthTokenProvider $oauth) { } } /** * PHPMailer RFC821 SMTP email transport class. * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. * * @author Chris Ryan * @author Marcus Bointon */ class SMTP { /** * The PHPMailer SMTP version number. * * @var string */ const VERSION = '6.9.2'; /** * SMTP line break constant. * * @var string */ const LE = "\r\n"; /** * The SMTP port to use if one is not specified. * * @var int */ const DEFAULT_PORT = 25; /** * The SMTPs port to use if one is not specified. * * @var int */ const DEFAULT_SECURE_PORT = 465; /** * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, * *excluding* a trailing CRLF break. * * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 * * @var int */ const MAX_LINE_LENGTH = 998; /** * The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5, * *including* a trailing CRLF line break. * * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5 * * @var int */ const MAX_REPLY_LENGTH = 512; /** * Debug level for no output. * * @var int */ const DEBUG_OFF = 0; /** * Debug level to show client -> server messages. * * @var int */ const DEBUG_CLIENT = 1; /** * Debug level to show client -> server and server -> client messages. * * @var int */ const DEBUG_SERVER = 2; /** * Debug level to show connection status, client -> server and server -> client messages. * * @var int */ const DEBUG_CONNECTION = 3; /** * Debug level to show all messages. * * @var int */ const DEBUG_LOWLEVEL = 4; /** * Debug output level. * Options: * * self::DEBUG_OFF (`0`) No debug output, default * * self::DEBUG_CLIENT (`1`) Client commands * * self::DEBUG_SERVER (`2`) Client commands and server responses * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages. * * @var int */ public $do_debug = self::DEBUG_OFF; /** * How to handle debug output. * Options: * * `echo` Output plain-text as-is, appropriate for CLI * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output * * `error_log` Output to error log as configured in php.ini * Alternatively, you can provide a callable expecting two params: a message string and the debug level: * * ```php * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; * ``` * * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` * level output is used: * * ```php * $mail->Debugoutput = new myPsr3Logger; * ``` * * @var string|callable|\Psr\Log\LoggerInterface */ public $Debugoutput = 'echo'; /** * Whether to use VERP. * * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path * @see https://www.postfix.org/VERP_README.html Info on VERP * * @var bool */ public $do_verp = false; /** * The timeout value for connection, in seconds. * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. * * @see https://www.rfc-editor.org/rfc/rfc2821#section-4.5.3.2 * * @var int */ public $Timeout = 300; /** * How long to wait for commands to complete, in seconds. * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. * * @var int */ public $Timelimit = 300; /** * Patterns to extract an SMTP transaction id from reply to a DATA command. * The first capture group in each regex will be used as the ID. * MS ESMTP returns the message ID, which may not be correct for internal tracking. * * @var string[] */ protected $smtp_transaction_id_patterns = ['exim' => '/[\\d]{3} OK id=(.*)/', 'sendmail' => '/[\\d]{3} 2\\.0\\.0 (.*) Message/', 'postfix' => '/[\\d]{3} 2\\.0\\.0 Ok: queued as (.*)/', 'Microsoft_ESMTP' => '/[0-9]{3} 2\\.[\\d]\\.0 (.*)@(?:.*) Queued mail for delivery/', 'Amazon_SES' => '/[\\d]{3} Ok (.*)/', 'SendGrid' => '/[\\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\\d]{3} 2\\.0\\.0 OK:([a-zA-Z\\d]{48})/', 'Haraka' => '/[\\d]{3} Message Queued \\((.*)\\)/', 'ZoneMTA' => '/[\\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\\d]{3} OK queued as (.*)/']; /** * Allowed SMTP XCLIENT attributes. * Must be allowed by the SMTP server. EHLO response is not checked. * * @see https://www.postfix.org/XCLIENT_README.html * * @var array */ public static $xclient_allowed_attributes = ['NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT']; /** * The last transaction ID issued in response to a DATA command, * if one was detected. * * @var string|bool|null */ protected $last_smtp_transaction_id; /** * The socket for the server connection. * * @var ?resource */ protected $smtp_conn; /** * Error information, if any, for the last SMTP command. * * @var array */ protected $error = ['error' => '', 'detail' => '', 'smtp_code' => '', 'smtp_code_ex' => '']; /** * The reply the server sent to us for HELO. * If null, no HELO string has yet been received. * * @var string|null */ protected $helo_rply; /** * The set of SMTP extensions sent in reply to EHLO command. * Indexes of the array are extension names. * Value at index 'HELO' or 'EHLO' (according to command that was sent) * represents the server name. In case of HELO it is the only element of the array. * Other values can be boolean TRUE or an array containing extension options. * If null, no HELO/EHLO string has yet been received. * * @var array|null */ protected $server_caps; /** * The most recent reply received from the server. * * @var string */ protected $last_reply = ''; /** * Output debugging info via a user-selected method. * * @param string $str Debug string to output * @param int $level The debug level of this message; see DEBUG_* constants * * @see SMTP::$Debugoutput * @see SMTP::$do_debug * @phpstan-return void */ protected function edebug($str, $level = 0) { } /** * Connect to an SMTP server. * * @param string $host SMTP server IP or host name * @param int $port The port number to connect to * @param int $timeout How long to wait for the connection to open * @param array $options An array of options for stream_context_create() * * @return bool */ public function connect($host, $port = null, $timeout = 30, $options = []) { } /** * Create connection to the SMTP server. * * @param string $host SMTP server IP or host name * @param int $port The port number to connect to * @param int $timeout How long to wait for the connection to open * @param array $options An array of options for stream_context_create() * * @return false|resource */ protected function getSMTPConnection($host, $port = null, $timeout = 30, $options = []) { } /** * Initiate a TLS (encrypted) session. * * @return bool */ public function startTLS() { } /** * Perform SMTP authentication. * Must be run after hello(). * * @see hello() * * @param string $username The user name * @param string $password The password * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) * @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication * * @return bool True if successfully authenticated */ public function authenticate($username, $password, $authtype = null, $OAuth = null) { } /** * Calculate an MD5 HMAC hash. * Works like hash_hmac('md5', $data, $key) * in case that function is not available. * * @param string $data The data to hash * @param string $key The key to hash with * * @return string */ protected function hmac($data, $key) { } /** * Check connection state. * * @return bool True if connected */ public function connected() { } /** * Close the socket and clean up the state of the class. * Don't use this function without first trying to use QUIT. * * @see quit() */ public function close() { } /** * Send an SMTP DATA command. * Issues a data command and sends the msg_data to the server, * finalizing the mail transaction. $msg_data is the message * that is to be sent with the headers. Each header needs to be * on a single line followed by a with the message headers * and the message body being separated by an additional . * Implements RFC 821: DATA . * * @param string $msg_data Message data to send * * @return bool */ public function data($msg_data) { } /** * Send an SMTP HELO or EHLO command. * Used to identify the sending server to the receiving server. * This makes sure that client and server are in a known state. * Implements RFC 821: HELO * and RFC 2821 EHLO. * * @param string $host The host name or IP to connect to * * @return bool */ public function hello($host = '') { } /** * Send an SMTP HELO or EHLO command. * Low-level implementation used by hello(). * * @param string $hello The HELO string * @param string $host The hostname to say we are * * @return bool * * @see hello() */ protected function sendHello($hello, $host) { } /** * Parse a reply to HELO/EHLO command to discover server extensions. * In case of HELO, the only parameter that can be discovered is a server name. * * @param string $type `HELO` or `EHLO` */ protected function parseHelloFields($type) { } /** * Send an SMTP MAIL command. * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more recipient * commands may be called followed by a data command. * Implements RFC 821: MAIL FROM: . * * @param string $from Source address of this message * * @return bool */ public function mail($from) { } /** * Send an SMTP QUIT command. * Closes the socket if there is no error or the $close_on_error argument is true. * Implements from RFC 821: QUIT . * * @param bool $close_on_error Should the connection close if an error occurs? * * @return bool */ public function quit($close_on_error = true) { } /** * Send an SMTP RCPT command. * Sets the TO argument to $toaddr. * Returns true if the recipient was accepted false if it was rejected. * Implements from RFC 821: RCPT TO: . * * @param string $address The address the message is being sent to * @param string $dsn Comma separated list of DSN notifications. NEVER, SUCCESS, FAILURE * or DELAY. If you specify NEVER all other notifications are ignored. * * @return bool */ public function recipient($address, $dsn = '') { } /** * Send SMTP XCLIENT command to server and check its return code. * * @return bool True on success */ public function xclient(array $vars) { } /** * Send an SMTP RSET command. * Abort any transaction that is currently in progress. * Implements RFC 821: RSET . * * @return bool True on success */ public function reset() { } /** * Send a command to an SMTP server and check its return code. * * @param string $command The command name - not sent to the server * @param string $commandstring The actual command to send * @param int|array $expect One or more expected integer success codes * * @return bool True on success */ protected function sendCommand($command, $commandstring, $expect) { } /** * Send an SMTP SAML command. * Starts a mail transaction from the email address specified in $from. * Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more recipient * commands may be called followed by a data command. This command * will send the message to the users terminal if they are logged * in and send them an email. * Implements RFC 821: SAML FROM: . * * @param string $from The address the message is from * * @return bool */ public function sendAndMail($from) { } /** * Send an SMTP VRFY command. * * @param string $name The name to verify * * @return bool */ public function verify($name) { } /** * Send an SMTP NOOP command. * Used to keep keep-alives alive, doesn't actually do anything. * * @return bool */ public function noop() { } /** * Send an SMTP TURN command. * This is an optional command for SMTP that this class does not support. * This method is here to make the RFC821 Definition complete for this class * and _may_ be implemented in future. * Implements from RFC 821: TURN . * * @return bool */ public function turn() { } /** * Send raw data to the server. * * @param string $data The data to send * @param string $command Optionally, the command this is part of, used only for controlling debug output * * @return int|bool The number of bytes sent to the server or false on error */ public function client_send($data, $command = '') { } /** * Get the latest error. * * @return array */ public function getError() { } /** * Get SMTP extensions available on the server. * * @return array|null */ public function getServerExtList() { } /** * Get metadata about the SMTP server from its HELO/EHLO response. * The method works in three ways, dependent on argument value and current state: * 1. HELO/EHLO has not been sent - returns null and populates $this->error. * 2. HELO has been sent - * $name == 'HELO': returns server name * $name == 'EHLO': returns boolean false * $name == any other string: returns null and populates $this->error * 3. EHLO has been sent - * $name == 'HELO'|'EHLO': returns the server name * $name == any other string: if extension $name exists, returns True * or its options (e.g. AUTH mechanisms supported). Otherwise returns False. * * @param string $name Name of SMTP extension or 'HELO'|'EHLO' * * @return string|bool|null */ public function getServerExt($name) { } /** * Get the last reply from the server. * * @return string */ public function getLastReply() { } /** * Read the SMTP server's response. * Either before eof or socket timeout occurs on the operation. * With SMTP we can tell if we have more lines to read if the * 4th character is '-' symbol. If it is a space then we don't * need to read anything else. * * @return string */ protected function get_lines() { } /** * Enable or disable VERP address generation. * * @param bool $enabled */ public function setVerp($enabled = false) { } /** * Get VERP address generation mode. * * @return bool */ public function getVerp() { } /** * Set error messages and codes. * * @param string $message The error message * @param string $detail Further detail on the error * @param string $smtp_code An associated SMTP error code * @param string $smtp_code_ex Extended SMTP code */ protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') { } /** * Set debug output method. * * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it */ public function setDebugOutput($method = 'echo') { } /** * Get debug output method. * * @return string */ public function getDebugOutput() { } /** * Set debug output level. * * @param int $level */ public function setDebugLevel($level = 0) { } /** * Get debug output level. * * @return int */ public function getDebugLevel() { } /** * Set SMTP timeout. * * @param int $timeout The timeout duration in seconds */ public function setTimeout($timeout = 0) { } /** * Get SMTP timeout. * * @return int */ public function getTimeout() { } /** * Reports an error number and string. * * @param int $errno The error number returned by PHP * @param string $errmsg The error message returned by PHP * @param string $errfile The file the error occurred in * @param int $errline The line number the error occurred on */ protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0) { } /** * Extract and return the ID of the last SMTP transaction based on * a list of patterns provided in SMTP::$smtp_transaction_id_patterns. * Relies on the host providing the ID in response to a DATA command. * If no reply has been received yet, it will return null. * If no pattern was matched, it will return false. * * @return bool|string|null */ protected function recordLastTransactionID() { } /** * Get the queue/transaction ID of the last SMTP transaction * If no reply has been received yet, it will return null. * If no pattern was matched, it will return false. * * @return bool|string|null * * @see recordLastTransactionID() */ public function getLastTransactionID() { } } } namespace WpOrg\Requests { /** * Authentication provider interface * * Implement this interface to act as an authentication provider. * * Parameters should be passed via the constructor where possible, as this * makes it much easier for users to use your provider. * * @see \WpOrg\Requests\Hooks * * @package Requests\Authentication */ interface Auth { /** * Register hooks as needed * * This method is called in {@see \WpOrg\Requests\Requests::request()} when the user * has set an instance as the 'auth' option. Use this callback to register all the * hooks you'll need. * * @see \WpOrg\Requests\Hooks::register() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(\WpOrg\Requests\Hooks $hooks); } } namespace WpOrg\Requests\Auth { /** * Basic Authentication provider * * Provides a handler for Basic HTTP authentication via the Authorization * header. * * @package Requests\Authentication */ class Basic implements \WpOrg\Requests\Auth { /** * Username * * @var string */ public $user; /** * Password * * @var string */ public $pass; /** * Constructor * * @since 2.0 Throws an `InvalidArgument` exception. * @since 2.0 Throws an `ArgumentCount` exception instead of the Requests base `Exception. * * @param array|null $args Array of user and password. Must have exactly two elements * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array or null. * @throws \WpOrg\Requests\Exception\ArgumentCount On incorrect number of array elements (`authbasicbadargs`). * @phpstan-return void */ public function __construct($args = null) { } /** * Register the necessary callbacks * * @see \WpOrg\Requests\Auth\Basic::curl_before_send() * @see \WpOrg\Requests\Auth\Basic::fsockopen_header() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(\WpOrg\Requests\Hooks $hooks) { } /** * Set cURL parameters before the data is sent * * @param resource|\CurlHandle $handle cURL handle */ public function curl_before_send(&$handle) { } /** * Add extra headers to the request before sending * * @param string $out HTTP header string */ public function fsockopen_header(&$out) { } /** * Get the authentication string (user:pass) * * @return string */ public function getAuthString() { } } } namespace WpOrg\Requests { /** * Autoloader for Requests for PHP. * * This autoloader supports the PSR-4 based Requests 2.0.0 classes in a case-sensitive manner * as the most common server OS-es are case-sensitive and the file names are in mixed case. * * For the PSR-0 Requests 1.x BC-layer, requested classes will be treated case-insensitively. * * @package Requests */ final class Autoload { /** * Register the autoloader. * * Note: the autoloader is *prepended* in the autoload queue. * This is done to ensure that the Requests 2.0 autoloader takes precedence * over a potentially (dependency-registered) Requests 1.x autoloader. * * @internal This method contains a safeguard against the autoloader being * registered multiple times. This safeguard uses a global constant to * (hopefully/in most cases) still function correctly, even if the * class would be renamed. * * @return void */ public static function register() { } /** * Autoloader. * * @param string $class_name Name of the class name to load. * * @return bool Whether a class was loaded or not. */ public static function load($class_name) { } } /** * Capability interface declaring the known capabilities. * * This is used as the authoritative source for which capabilities can be queried. * * @package Requests\Utilities */ interface Capability { /** * Support for SSL. * * @var string */ const SSL = 'ssl'; /** * Collection of all capabilities supported in Requests. * * Note: this does not automatically mean that the capability will be supported for your chosen transport! * * @var string[] */ const ALL = [self::SSL]; } /** * Cookie storage object * * @package Requests\Cookies */ class Cookie { /** * Cookie name. * * @var string */ public $name; /** * Cookie value. * * @var string */ public $value; /** * Cookie attributes * * Valid keys are `'path'`, `'domain'`, `'expires'`, `'max-age'`, `'secure'` and * `'httponly'`. * * @var \WpOrg\Requests\Utility\CaseInsensitiveDictionary|array Array-like object */ public $attributes = []; /** * Cookie flags * * Valid keys are `'creation'`, `'last-access'`, `'persistent'` and `'host-only'`. * * @var array */ public $flags = []; /** * Reference time for relative calculations * * This is used in place of `time()` when calculating Max-Age expiration and * checking time validity. * * @var int */ public $reference_time = 0; /** * Create a new cookie object * * @param string $name The name of the cookie. * @param string $value The value for the cookie. * @param array|\WpOrg\Requests\Utility\CaseInsensitiveDictionary $attributes Associative array of attribute data * @param array $flags The flags for the cookie. * Valid keys are `'creation'`, `'last-access'`, * `'persistent'` and `'host-only'`. * @param int|null $reference_time Reference time for relative calculations. * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $name argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $value argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $attributes argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $flags argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $reference_time argument is not an integer or null. */ public function __construct($name, $value, $attributes = [], $flags = [], $reference_time = null) { } /** * Get the cookie value * * Attributes and other data can be accessed via methods. */ public function __toString() { } /** * Check if a cookie is expired. * * Checks the age against $this->reference_time to determine if the cookie * is expired. * * @return boolean True if expired, false if time is valid. */ public function is_expired() { } /** * Check if a cookie is valid for a given URI * * @param \WpOrg\Requests\Iri $uri URI to check * @return boolean Whether the cookie is valid for the given URI */ public function uri_matches(\WpOrg\Requests\Iri $uri) { } /** * Check if a cookie is valid for a given domain * * @param string $domain Domain to check * @return boolean Whether the cookie is valid for the given domain */ public function domain_matches($domain) { } /** * Check if a cookie is valid for a given path * * From the path-match check in RFC 6265 section 5.1.4 * * @param string $request_path Path to check * @return boolean Whether the cookie is valid for the given path */ public function path_matches($request_path) { } /** * Normalize cookie and attributes * * @return boolean Whether the cookie was successfully normalized */ public function normalize() { } /** * Parse an individual cookie attribute * * Handles parsing individual attributes from the cookie values. * * @param string $name Attribute name * @param string|int|bool $value Attribute value (string/integer value, or true if empty/flag) * @return mixed Value if available, or null if the attribute value is invalid (and should be skipped) */ protected function normalize_attribute($name, $value) { } /** * Format a cookie for a Cookie header * * This is used when sending cookies to a server. * * @return string Cookie formatted for Cookie header */ public function format_for_header() { } /** * Format a cookie for a Set-Cookie header * * This is used when sending cookies to clients. This isn't really * applicable to client-side usage, but might be handy for debugging. * * @return string Cookie formatted for Set-Cookie header */ public function format_for_set_cookie() { } /** * Parse a cookie string into a cookie object * * Based on Mozilla's parsing code in Firefox and related projects, which * is an intentional deviation from RFC 2109 and RFC 2616. RFC 6265 * specifies some of this handling, but not in a thorough manner. * * @param string $cookie_header Cookie header value (from a Set-Cookie header) * @param string $name * @param int|null $reference_time * @return \WpOrg\Requests\Cookie Parsed cookie object * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $cookie_header argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $name argument is not a string. */ public static function parse($cookie_header, $name = '', $reference_time = null) { } /** * Parse all Set-Cookie headers from request headers * * @param \WpOrg\Requests\Response\Headers $headers Headers to parse from * @param \WpOrg\Requests\Iri|null $origin URI for comparing cookie origins * @param int|null $time Reference time for expiration calculation * @return array * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $origin argument is not null or an instance of the Iri class. */ public static function parse_from_headers(\WpOrg\Requests\Response\Headers $headers, $origin = null, $time = null) { } } } namespace WpOrg\Requests\Cookie { /** * Cookie holder object * * @package Requests\Cookies */ class Jar implements \ArrayAccess, \IteratorAggregate { /** * Actual item data * * @var array */ protected $cookies = []; /** * Create a new jar * * @param array $cookies Existing cookie values * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array. */ public function __construct($cookies = []) { } /** * Normalise cookie data into a \WpOrg\Requests\Cookie * * @param string|\WpOrg\Requests\Cookie $cookie Cookie header value, possibly pre-parsed (object). * @param string $key Optional. The name for this cookie. * @return \WpOrg\Requests\Cookie */ public function normalize_cookie($cookie, $key = '') { } /** * Check if the given item exists * * @param string $offset Item key * @return boolean Does the item exist? */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Get the value for the item * * @param string $offset Item key * @return string|null Item value (null if offsetExists is false) */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } /** * Set the given item * * @param string $offset Item name * @param string $value Item value * * @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`) */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } /** * Unset the given header * * @param string $offset The key for the item to unset. */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { } /** * Get an iterator for the data * * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { } /** * Register the cookie handler with the request's hooking system * * @param \WpOrg\Requests\HookManager $hooks Hooking system */ public function register(\WpOrg\Requests\HookManager $hooks) { } /** * Add Cookie header to a request if we have any * * As per RFC 6265, cookies are separated by '; ' * * @param string $url * @param array $headers * @param array $data * @param string $type * @param array $options */ public function before_request($url, &$headers, &$data, &$type, &$options) { } /** * Parse all cookies from a response and attach them to the response * * @param \WpOrg\Requests\Response $response Response as received. */ public function before_redirect_check(\WpOrg\Requests\Response $response) { } } } namespace WpOrg\Requests { /** * Exception for HTTP requests * * @package Requests\Exceptions */ class Exception extends \Exception { /** * Type of exception * * @var string */ protected $type; /** * Data associated with the exception * * @var mixed */ protected $data; /** * Create a new exception * * @param string $message Exception message * @param string $type Exception type * @param mixed $data Associated data * @param integer $code Exception numerical code, if applicable */ public function __construct($message, $type, $data = null, $code = 0) { } /** * Like {@see \Exception::getCode()}, but a string code. * * @codeCoverageIgnore * @return string */ public function getType() { } /** * Gives any relevant data * * @codeCoverageIgnore * @return mixed */ public function getData() { } } } namespace WpOrg\Requests\Exception { /** * Exception for when an incorrect number of arguments are passed to a method. * * Typically, this exception is used when all arguments for a method are optional, * but certain arguments need to be passed together, i.e. a method which can be called * with no arguments or with two arguments, but not with one argument. * * Along the same lines, this exception is also used if a method expects an array * with a certain number of elements and the provided number of elements does not comply. * * @package Requests\Exceptions * @since 2.0.0 */ final class ArgumentCount extends \WpOrg\Requests\Exception { /** * Create a new argument count exception with a standardized text. * * @param string $expected The argument count expected as a phrase. * For example: `at least 2 arguments` or `exactly 1 argument`. * @param int $received The actual argument count received. * @param string $type Exception type. * * @return \WpOrg\Requests\Exception\ArgumentCount */ public static function create($expected, $received, $type) { } } /** * Exception based on HTTP response * * @package Requests\Exceptions */ class Http extends \WpOrg\Requests\Exception { /** * HTTP status code * * @var integer */ protected $code = 0; /** * Reason phrase * * @var string */ protected $reason = 'Unknown'; /** * Create a new exception * * There is no mechanism to pass in the status code, as this is set by the * subclass used. Reason phrases can vary, however. * * @param string|null $reason Reason phrase * @param mixed $data Associated data */ public function __construct($reason = null, $data = null) { } /** * Get the status message. * * @return string */ public function getReason() { } /** * Get the correct exception class for a given error code * * @param int|bool $code HTTP status code, or false if unavailable * @return string Exception class name to use */ public static function get_class($code) { } } } namespace WpOrg\Requests\Exception\Http { /** * Exception for 304 Not Modified responses * * @package Requests\Exceptions */ final class Status304 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 305 Use Proxy responses * * @package Requests\Exceptions */ final class Status305 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 306 Switch Proxy responses * * @package Requests\Exceptions */ final class Status306 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 400 Bad Request responses * * @package Requests\Exceptions */ final class Status400 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 401 Unauthorized responses * * @package Requests\Exceptions */ final class Status401 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 402 Payment Required responses * * @package Requests\Exceptions */ final class Status402 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 403 Forbidden responses * * @package Requests\Exceptions */ final class Status403 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 404 Not Found responses * * @package Requests\Exceptions */ final class Status404 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 405 Method Not Allowed responses * * @package Requests\Exceptions */ final class Status405 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 406 Not Acceptable responses * * @package Requests\Exceptions */ final class Status406 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 407 Proxy Authentication Required responses * * @package Requests\Exceptions */ final class Status407 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 408 Request Timeout responses * * @package Requests\Exceptions */ final class Status408 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 409 Conflict responses * * @package Requests\Exceptions */ final class Status409 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 410 Gone responses * * @package Requests\Exceptions */ final class Status410 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 411 Length Required responses * * @package Requests\Exceptions */ final class Status411 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 412 Precondition Failed responses * * @package Requests\Exceptions */ final class Status412 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 413 Request Entity Too Large responses * * @package Requests\Exceptions */ final class Status413 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 414 Request-URI Too Large responses * * @package Requests\Exceptions */ final class Status414 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 415 Unsupported Media Type responses * * @package Requests\Exceptions */ final class Status415 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 416 Requested Range Not Satisfiable responses * * @package Requests\Exceptions */ final class Status416 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 417 Expectation Failed responses * * @package Requests\Exceptions */ final class Status417 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 418 I'm A Teapot responses * * @link https://tools.ietf.org/html/rfc2324 * * @package Requests\Exceptions */ final class Status418 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 428 Precondition Required responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ final class Status428 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 429 Too Many Requests responses * * @link https://tools.ietf.org/html/draft-nottingham-http-new-status-04 * * @package Requests\Exceptions */ final class Status429 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 431 Request Header Fields Too Large responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ final class Status431 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 500 Internal Server Error responses * * @package Requests\Exceptions */ final class Status500 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 501 Not Implemented responses * * @package Requests\Exceptions */ final class Status501 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 502 Bad Gateway responses * * @package Requests\Exceptions */ final class Status502 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 503 Service Unavailable responses * * @package Requests\Exceptions */ final class Status503 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 504 Gateway Timeout responses * * @package Requests\Exceptions */ final class Status504 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 505 HTTP Version Not Supported responses * * @package Requests\Exceptions */ final class Status505 extends \WpOrg\Requests\Exception\Http { } /** * Exception for 511 Network Authentication Required responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ final class Status511 extends \WpOrg\Requests\Exception\Http { } /** * Exception for unknown status responses * * @package Requests\Exceptions */ final class StatusUnknown extends \WpOrg\Requests\Exception\Http { /** * Create a new exception * * If `$data` is an instance of {@see \WpOrg\Requests\Response}, uses the status * code from it. Otherwise, sets as 0 * * @param string|null $reason Reason phrase * @param mixed $data Associated data */ public function __construct($reason = null, $data = null) { } } } namespace WpOrg\Requests\Exception { /** * Exception for an invalid argument passed. * * @package Requests\Exceptions * @since 2.0.0 */ final class InvalidArgument extends \InvalidArgumentException { /** * Create a new invalid argument exception with a standardized text. * * @param int $position The argument position in the function signature. 1-based. * @param string $name The argument name in the function signature. * @param string $expected The argument type expected as a string. * @param string $received The actual argument type received. * * @return \WpOrg\Requests\Exception\InvalidArgument */ public static function create($position, $name, $expected, $received) { } } /** * Transport Exception * * @package Requests\Exceptions */ class Transport extends \WpOrg\Requests\Exception { } } namespace WpOrg\Requests\Exception\Transport { /** * CURL Transport Exception. * * @package Requests\Exceptions */ final class Curl extends \WpOrg\Requests\Exception\Transport { const EASY = 'cURLEasy'; const MULTI = 'cURLMulti'; const SHARE = 'cURLShare'; /** * Create a new exception. * * @param string $message Exception message. * @param string $type Exception type. * @param mixed $data Associated data, if applicable. * @param int $code Exception numerical code, if applicable. */ public function __construct($message, $type, $data = null, $code = 0) { } /** * Get the error message. * * @return string */ public function getReason() { } } } namespace WpOrg\Requests { /** * Event dispatcher * * @package Requests\EventDispatcher */ interface HookManager { /** * Register a callback for a hook * * @param string $hook Hook name * @param callable $callback Function/method to call on event * @param int $priority Priority number. <0 is executed earlier, >0 is executed later */ public function register($hook, $callback, $priority = 0); /** * Dispatch a message * * @param string $hook Hook name * @param array $parameters Parameters to pass to callbacks * @return boolean Successfulness */ public function dispatch($hook, $parameters = []); } /** * Handles adding and dispatching events * * @package Requests\EventDispatcher */ class Hooks implements \WpOrg\Requests\HookManager { /** * Registered callbacks for each hook * * @var array */ protected $hooks = []; /** * Register a callback for a hook * * @param string $hook Hook name * @param callable $callback Function/method to call on event * @param int $priority Priority number. <0 is executed earlier, >0 is executed later * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $callback argument is not callable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $priority argument is not an integer. */ public function register($hook, $callback, $priority = 0) { } /** * Dispatch a message * * @param string $hook Hook name * @param array $parameters Parameters to pass to callbacks * @return boolean Successfulness * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $parameters argument is not an array. */ public function dispatch($hook, $parameters = []) { } public function __wakeup() { } } /** * IDNA URL encoder * * Note: Not fully compliant, as nameprep does nothing yet. * * @package Requests\Utilities * * @link https://tools.ietf.org/html/rfc3490 IDNA specification * @link https://tools.ietf.org/html/rfc3492 Punycode/Bootstrap specification */ class IdnaEncoder { /** * ACE prefix used for IDNA * * @link https://tools.ietf.org/html/rfc3490#section-5 * @var string */ const ACE_PREFIX = 'xn--'; /** * Maximum length of a IDNA URL in ASCII. * * @see \WpOrg\Requests\IdnaEncoder::to_ascii() * * @since 2.0.0 * * @var int */ const MAX_LENGTH = 64; /**#@+ * Bootstrap constant for Punycode * * @link https://tools.ietf.org/html/rfc3492#section-5 * @var int */ const BOOTSTRAP_BASE = 36; const BOOTSTRAP_TMIN = 1; const BOOTSTRAP_TMAX = 26; const BOOTSTRAP_SKEW = 38; const BOOTSTRAP_DAMP = 700; const BOOTSTRAP_INITIAL_BIAS = 72; const BOOTSTRAP_INITIAL_N = 128; /**#@-*/ /** * Encode a hostname using Punycode * * @param string|Stringable $hostname Hostname * @return string Punycode-encoded hostname * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or a stringable object. */ public static function encode($hostname) { } /** * Convert a UTF-8 text string to an ASCII string using Punycode * * @param string $text ASCII or UTF-8 string (max length 64 characters) * @return string ASCII string * * @throws \WpOrg\Requests\Exception Provided string longer than 64 ASCII characters (`idna.provided_too_long`) * @throws \WpOrg\Requests\Exception Prepared string longer than 64 ASCII characters (`idna.prepared_too_long`) * @throws \WpOrg\Requests\Exception Provided string already begins with xn-- (`idna.provided_is_prefixed`) * @throws \WpOrg\Requests\Exception Encoded string longer than 64 ASCII characters (`idna.encoded_too_long`) */ public static function to_ascii($text) { } /** * Check whether a given text string contains only ASCII characters * * @internal (Testing found regex was the fastest implementation) * * @param string $text Text to examine. * @return bool Is the text string ASCII-only? */ protected static function is_ascii($text) { } /** * Prepare a text string for use as an IDNA name * * @todo Implement this based on RFC 3491 and the newer 5891 * @param string $text Text to prepare. * @return string Prepared string */ protected static function nameprep($text) { } /** * Convert a UTF-8 string to a UCS-4 codepoint array * * Based on \WpOrg\Requests\Iri::replace_invalid_with_pct_encoding() * * @param string $input Text to convert. * @return array Unicode code points * * @throws \WpOrg\Requests\Exception Invalid UTF-8 codepoint (`idna.invalidcodepoint`) */ protected static function utf8_to_codepoints($input) { } /** * RFC3492-compliant encoder * * @internal Pseudo-code from Section 6.3 is commented with "#" next to relevant code * * @param string $input UTF-8 encoded string to encode * @return string Punycode-encoded string * * @throws \WpOrg\Requests\Exception On character outside of the domain (never happens with Punycode) (`idna.character_outside_domain`) */ public static function punycode_encode($input) { } /** * Convert a digit to its respective character * * @link https://tools.ietf.org/html/rfc3492#section-5 * * @param int $digit Digit in the range 0-35 * @return string Single character corresponding to digit * * @throws \WpOrg\Requests\Exception On invalid digit (`idna.invalid_digit`) */ protected static function digit_to_char($digit) { } /** * Adapt the bias * * @link https://tools.ietf.org/html/rfc3492#section-6.1 * @param int $delta * @param int $numpoints * @param bool $firsttime * @return int|float New bias * * function adapt(delta,numpoints,firsttime): */ protected static function adapt($delta, $numpoints, $firsttime) { } } /** * Class to validate and to work with IPv6 addresses * * This was originally based on the PEAR class of the same name, but has been * entirely rewritten. * * @package Requests\Utilities */ final class Ipv6 { /** * Uncompresses an IPv6 address * * RFC 4291 allows you to compress consecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and expands the '::' to * the required number of zero pieces. * * Example: FF01::101 -> FF01:0:0:0:0:0:0:101 * ::1 -> 0:0:0:0:0:0:0:1 * * @author Alexander Merz * @author elfrink at introweb dot nl * @author Josh Peck * @copyright 2003-2005 The PHP Group * @license https://opensource.org/licenses/bsd-license.php * * @param string|Stringable $ip An IPv6 address * @return string The uncompressed IPv6 address * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or a stringable object. */ public static function uncompress($ip) { } /** * Compresses an IPv6 address * * RFC 4291 allows you to compress consecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and compresses consecutive * zero pieces to '::'. * * Example: FF01:0:0:0:0:0:0:101 -> FF01::101 * 0:0:0:0:0:0:0:1 -> ::1 * * @see \WpOrg\Requests\Ipv6::uncompress() * * @param string $ip An IPv6 address * @return string The compressed IPv6 address */ public static function compress($ip) { } /** * Checks an IPv6 address * * Checks if the given IP is a valid IPv6 address * * @param string $ip An IPv6 address * @return bool true if $ip is a valid IPv6 address */ public static function check_ipv6($ip) { } } /** * IRI parser/serialiser/normaliser * * Copyright (c) 2007-2010, Geoffrey Sneddon and Steve Minutillo. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package Requests\Utilities * @author Geoffrey Sneddon * @author Steve Minutillo * @copyright 2007-2009 Geoffrey Sneddon and Steve Minutillo * @license https://opensource.org/licenses/bsd-license.php * @link http://hg.gsnedders.com/iri/ * * @property string $iri IRI we're working with * @property-read string $uri IRI in URI form, {@see \WpOrg\Requests\Iri::to_uri()} * @property string $scheme Scheme part of the IRI * @property string $authority Authority part, formatted for a URI (userinfo + host + port) * @property string $iauthority Authority part of the IRI (userinfo + host + port) * @property string $userinfo Userinfo part, formatted for a URI (after '://' and before '@') * @property string $iuserinfo Userinfo part of the IRI (after '://' and before '@') * @property string $host Host part, formatted for a URI * @property string $ihost Host part of the IRI * @property string $port Port part of the IRI (after ':') * @property string $path Path part, formatted for a URI (after first '/') * @property string $ipath Path part of the IRI (after first '/') * @property string $query Query part, formatted for a URI (after '?') * @property string $iquery Query part of the IRI (after '?') * @property string $fragment Fragment, formatted for a URI (after '#') * @property string $ifragment Fragment part of the IRI (after '#') */ class Iri { /** * Scheme * * @var string|null */ protected $scheme = null; /** * User Information * * @var string|null */ protected $iuserinfo = null; /** * ihost * * @var string|null */ protected $ihost = null; /** * Port * * @var string|null */ protected $port = null; /** * ipath * * @var string */ protected $ipath = ''; /** * iquery * * @var string|null */ protected $iquery = null; /** * ifragment|null * * @var string */ protected $ifragment = null; /** * Normalization database * * Each key is the scheme, each value is an array with each key as the IRI * part and value as the default value for that part. * * @var array */ protected $normalization = array('acap' => array('port' => \WpOrg\Requests\Port::ACAP), 'dict' => array('port' => \WpOrg\Requests\Port::DICT), 'file' => array('ihost' => 'localhost'), 'http' => array('port' => \WpOrg\Requests\Port::HTTP), 'https' => array('port' => \WpOrg\Requests\Port::HTTPS)); /** * Return the entire IRI when you try and read the object as a string * * @return string */ public function __toString() { } /** * Overload __set() to provide access via properties * * @param string $name Property name * @param mixed $value Property value */ public function __set($name, $value) { } /** * Overload __get() to provide access via properties * * @param string $name Property name * @return mixed */ public function __get($name) { } /** * Overload __isset() to provide access via properties * * @param string $name Property name * @return bool */ public function __isset($name) { } /** * Overload __unset() to provide access via properties * * @param string $name Property name */ public function __unset($name) { } /** * Create a new IRI object, from a specified string * * @param string|Stringable|null $iri * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $iri argument is not a string, Stringable or null. */ public function __construct($iri = null) { } /** * Create a new IRI object by resolving a relative IRI * * Returns false if $base is not absolute, otherwise an IRI. * * @param \WpOrg\Requests\Iri|string $base (Absolute) Base IRI * @param \WpOrg\Requests\Iri|string $relative Relative IRI * @return \WpOrg\Requests\Iri|false */ public static function absolutize($base, $relative) { } /** * Parse an IRI into scheme/authority/path/query/fragment segments * * @param string $iri * @return array */ protected function parse_iri($iri) { } /** * Remove dot segments from a path * * @param string $input * @return string */ protected function remove_dot_segments($input) { } /** * Replace invalid character with percent encoding * * @param string $text Input string * @param string $extra_chars Valid characters not in iunreserved or * iprivate (this is ASCII-only) * @param bool $iprivate Allow iprivate * @return string */ protected function replace_invalid_with_pct_encoding($text, $extra_chars, $iprivate = false) { } /** * Callback function for preg_replace_callback. * * Removes sequences of percent encoded bytes that represent UTF-8 * encoded characters in iunreserved * * @param array $regex_match PCRE match * @return string Replacement */ protected function remove_iunreserved_percent_encoded($regex_match) { } protected function scheme_normalization() { } /** * Check if the object represents a valid IRI. This needs to be done on each * call as some things change depending on another part of the IRI. * * @return bool */ public function is_valid() { } public function __wakeup() { } /** * Set the entire IRI. Returns true on success, false on failure (if there * are any invalid characters). * * @param string $iri * @return bool */ protected function set_iri($iri) { } /** * Set the scheme. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $scheme * @return bool */ protected function set_scheme($scheme) { } /** * Set the authority. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $authority * @return bool */ protected function set_authority($authority) { } /** * Set the iuserinfo. * * @param string $iuserinfo * @return bool */ protected function set_userinfo($iuserinfo) { } /** * Set the ihost. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $ihost * @return bool */ protected function set_host($ihost) { } /** * Set the port. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $port * @return bool */ protected function set_port($port) { } /** * Set the ipath. * * @param string $ipath * @return bool */ protected function set_path($ipath) { } /** * Set the iquery. * * @param string $iquery * @return bool */ protected function set_query($iquery) { } /** * Set the ifragment. * * @param string $ifragment * @return bool */ protected function set_fragment($ifragment) { } /** * Convert an IRI to a URI (or parts thereof) * * @param string|bool $iri IRI to convert (or false from {@see \WpOrg\Requests\Iri::get_iri()}) * @return string|false URI if IRI is valid, false otherwise. */ protected function to_uri($iri) { } /** * Get the complete IRI * * @return string|false */ protected function get_iri() { } /** * Get the complete URI * * @return string */ protected function get_uri() { } /** * Get the complete iauthority * * @return string|null */ protected function get_iauthority() { } /** * Get the complete authority * * @return string */ protected function get_authority() { } } /** * Find the correct port depending on the Request type. * * @package Requests\Utilities * @since 2.0.0 */ final class Port { /** * Port to use with Acap requests. * * @var int */ const ACAP = 674; /** * Port to use with Dictionary requests. * * @var int */ const DICT = 2628; /** * Port to use with HTTP requests. * * @var int */ const HTTP = 80; /** * Port to use with HTTP over SSL requests. * * @var int */ const HTTPS = 443; /** * Retrieve the port number to use. * * @param string $type Request type. * The following requests types are supported: * 'acap', 'dict', 'http' and 'https'. * * @return int * * @throws \WpOrg\Requests\Exception\InvalidArgument When a non-string input has been passed. * @throws \WpOrg\Requests\Exception When a non-supported port is requested ('portnotsupported'). * @phpstan-param 'acap'|'dict'|'http'|'https' $type */ public static function get($type) { } } /** * Proxy connection interface * * Implement this interface to handle proxy settings and authentication * * Parameters should be passed via the constructor where possible, as this * makes it much easier for users to use your provider. * * @see \WpOrg\Requests\Hooks * * @package Requests\Proxy * @since 1.6 */ interface Proxy { /** * Register hooks as needed * * This method is called in {@see \WpOrg\Requests\Requests::request()} when the user * has set an instance as the 'auth' option. Use this callback to register all the * hooks you'll need. * * @see \WpOrg\Requests\Hooks::register() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(\WpOrg\Requests\Hooks $hooks); } } namespace WpOrg\Requests\Proxy { /** * HTTP Proxy connection interface * * Provides a handler for connection via an HTTP proxy * * @package Requests\Proxy * @since 1.6 */ final class Http implements \WpOrg\Requests\Proxy { /** * Proxy host and port * * Notation: "host:port" (eg 127.0.0.1:8080 or someproxy.com:3128) * * @var string */ public $proxy; /** * Username * * @var string */ public $user; /** * Password * * @var string */ public $pass; /** * Do we need to authenticate? (ie username & password have been provided) * * @var boolean */ public $use_authentication; /** * Constructor * * @since 1.6 * * @param array|string|null $args Proxy as a string or an array of proxy, user and password. * When passed as an array, must have exactly one (proxy) * or three elements (proxy, user, password). * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array, a string or null. * @throws \WpOrg\Requests\Exception\ArgumentCount On incorrect number of arguments (`proxyhttpbadargs`) */ public function __construct($args = null) { } /** * Register the necessary callbacks * * @since 1.6 * @see \WpOrg\Requests\Proxy\Http::curl_before_send() * @see \WpOrg\Requests\Proxy\Http::fsockopen_remote_socket() * @see \WpOrg\Requests\Proxy\Http::fsockopen_remote_host_path() * @see \WpOrg\Requests\Proxy\Http::fsockopen_header() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(\WpOrg\Requests\Hooks $hooks) { } /** * Set cURL parameters before the data is sent * * @since 1.6 * @param resource|\CurlHandle $handle cURL handle */ public function curl_before_send(&$handle) { } /** * Alter remote socket information before opening socket connection * * @since 1.6 * @param string $remote_socket Socket connection string */ public function fsockopen_remote_socket(&$remote_socket) { } /** * Alter remote path before getting stream data * * @since 1.6 * @param string $path Path to send in HTTP request string ("GET ...") * @param string $url Full URL we're requesting */ public function fsockopen_remote_host_path(&$path, $url) { } /** * Add extra headers to the request before sending * * @since 1.6 * @param string $out HTTP header string */ public function fsockopen_header(&$out) { } /** * Get the authentication string (user:pass) * * @since 1.6 * @return string */ public function get_auth_string() { } } } namespace WpOrg\Requests { /** * Requests for PHP * * Inspired by Requests for Python. * * Based on concepts from SimplePie_File, RequestCore and WP_Http. * * @package Requests */ class Requests { /** * POST method * * @var string */ const POST = 'POST'; /** * PUT method * * @var string */ const PUT = 'PUT'; /** * GET method * * @var string */ const GET = 'GET'; /** * HEAD method * * @var string */ const HEAD = 'HEAD'; /** * DELETE method * * @var string */ const DELETE = 'DELETE'; /** * OPTIONS method * * @var string */ const OPTIONS = 'OPTIONS'; /** * TRACE method * * @var string */ const TRACE = 'TRACE'; /** * PATCH method * * @link https://tools.ietf.org/html/rfc5789 * @var string */ const PATCH = 'PATCH'; /** * Default size of buffer size to read streams * * @var integer */ const BUFFER_SIZE = 1160; /** * Option defaults. * * @see \WpOrg\Requests\Requests::get_default_options() * @see \WpOrg\Requests\Requests::request() for values returned by this method * * @since 2.0.0 * * @var array */ const OPTION_DEFAULTS = ['timeout' => 10, 'connect_timeout' => 10, 'useragent' => 'php-requests/' . self::VERSION, 'protocol_version' => 1.1, 'redirected' => 0, 'redirects' => 10, 'follow_redirects' => true, 'blocking' => true, 'type' => self::GET, 'filename' => false, 'auth' => false, 'proxy' => false, 'cookies' => false, 'max_bytes' => false, 'idn' => true, 'hooks' => null, 'transport' => null, 'verify' => null, 'verifyname' => true]; /** * Default supported Transport classes. * * @since 2.0.0 * * @var array */ const DEFAULT_TRANSPORTS = [\WpOrg\Requests\Transport\Curl::class => \WpOrg\Requests\Transport\Curl::class, \WpOrg\Requests\Transport\Fsockopen::class => \WpOrg\Requests\Transport\Fsockopen::class]; /** * Current version of Requests * * @var string */ const VERSION = '2.0.11'; /** * Selected transport name * * Use {@see \WpOrg\Requests\Requests::get_transport()} instead * * @var array */ public static $transport = []; /** * Registered transport classes * * @var array */ protected static $transports = []; /** * Default certificate path. * * @see \WpOrg\Requests\Requests::get_certificate_path() * @see \WpOrg\Requests\Requests::set_certificate_path() * * @var string */ protected static $certificate_path = __DIR__ . '/../certificates/cacert.pem'; /** * Register a transport * * @param string $transport Transport class to add, must support the \WpOrg\Requests\Transport interface */ public static function add_transport($transport) { } /** * Get the fully qualified class name (FQCN) for a working transport. * * @param array $capabilities Optional. Associative array of capabilities to test against, i.e. `['' => true]`. * @return string FQCN of the transport to use, or an empty string if no transport was * found which provided the requested capabilities. */ protected static function get_transport_class(array $capabilities = []) { } /** * Get a working transport. * * @param array $capabilities Optional. Associative array of capabilities to test against, i.e. `['' => true]`. * @return \WpOrg\Requests\Transport * @throws \WpOrg\Requests\Exception If no valid transport is found (`notransport`). */ protected static function get_transport(array $capabilities = []) { } /** * Checks to see if we have a transport for the capabilities requested. * * Supported capabilities can be found in the {@see \WpOrg\Requests\Capability} * interface as constants. * * Example usage: * `Requests::has_capabilities([Capability::SSL => true])`. * * @param array $capabilities Optional. Associative array of capabilities to test against, i.e. `['' => true]`. * @return bool Whether the transport has the requested capabilities. */ public static function has_capabilities(array $capabilities = []) { } /**#@+ * @see \WpOrg\Requests\Requests::request() * @param string $url * @param array $headers * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a GET request */ public static function get($url, $headers = [], $options = []) { } /** * Send a HEAD request */ public static function head($url, $headers = [], $options = []) { } /** * Send a DELETE request */ public static function delete($url, $headers = [], $options = []) { } /** * Send a TRACE request */ public static function trace($url, $headers = [], $options = []) { } /**#@-*/ /**#@+ * @see \WpOrg\Requests\Requests::request() * @param string $url * @param array $headers * @param array $data * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a POST request */ public static function post($url, $headers = [], $data = [], $options = []) { } /** * Send a PUT request */ public static function put($url, $headers = [], $data = [], $options = []) { } /** * Send an OPTIONS request */ public static function options($url, $headers = [], $data = [], $options = []) { } /** * Send a PATCH request * * Note: Unlike {@see \WpOrg\Requests\Requests::post()} and {@see \WpOrg\Requests\Requests::put()}, * `$headers` is required, as the specification recommends that should send an ETag * * @link https://tools.ietf.org/html/rfc5789 */ public static function patch($url, $headers, $data = [], $options = []) { } /**#@-*/ /** * Main interface for HTTP requests * * This method initiates a request and sends it via a transport before * parsing. * * The `$options` parameter takes an associative array with the following * options: * * - `timeout`: How long should we wait for a response? * Note: for cURL, a minimum of 1 second applies, as DNS resolution * operates at second-resolution only. * (float, seconds with a millisecond precision, default: 10, example: 0.01) * - `connect_timeout`: How long should we wait while trying to connect? * (float, seconds with a millisecond precision, default: 10, example: 0.01) * - `useragent`: Useragent to send to the server * (string, default: php-requests/$version) * - `follow_redirects`: Should we follow 3xx redirects? * (boolean, default: true) * - `redirects`: How many times should we redirect before erroring? * (integer, default: 10) * - `blocking`: Should we block processing on this request? * (boolean, default: true) * - `filename`: File to stream the body to instead. * (string|boolean, default: false) * - `auth`: Authentication handler or array of user/password details to use * for Basic authentication * (\WpOrg\Requests\Auth|array|boolean, default: false) * - `proxy`: Proxy details to use for proxy by-passing and authentication * (\WpOrg\Requests\Proxy|array|string|boolean, default: false) * - `max_bytes`: Limit for the response body size. * (integer|boolean, default: false) * - `idn`: Enable IDN parsing * (boolean, default: true) * - `transport`: Custom transport. Either a class name, or a * transport object. Defaults to the first working transport from * {@see \WpOrg\Requests\Requests::getTransport()} * (string|\WpOrg\Requests\Transport, default: {@see \WpOrg\Requests\Requests::getTransport()}) * - `hooks`: Hooks handler. * (\WpOrg\Requests\HookManager, default: new WpOrg\Requests\Hooks()) * - `verify`: Should we verify SSL certificates? Allows passing in a custom * certificate file as a string. (Using true uses the system-wide root * certificate store instead, but this may have different behaviour * across transports.) * (string|boolean, default: certificates/cacert.pem) * - `verifyname`: Should we verify the common name in the SSL certificate? * (boolean, default: true) * - `data_format`: How should we send the `$data` parameter? * (string, one of 'query' or 'body', default: 'query' for * HEAD/GET/DELETE, 'body' for POST/PUT/OPTIONS/PATCH) * * @param string|Stringable $url URL to request * @param array $headers Extra headers to send with the request * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests * @param string $type HTTP request type (use Requests constants) * @param array $options Options for the request (see description for more information) * @return \WpOrg\Requests\Response * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string or Stringable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $type argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. * @throws \WpOrg\Requests\Exception On invalid URLs (`nonhttp`) */ public static function request($url, $headers = [], $data = [], $type = self::GET, $options = []) { } /** * Send multiple HTTP requests simultaneously * * The `$requests` parameter takes an associative or indexed array of * request fields. The key of each request can be used to match up the * request with the returned data, or with the request passed into your * `multiple.request.complete` callback. * * The request fields value is an associative array with the following keys: * * - `url`: Request URL Same as the `$url` parameter to * {@see \WpOrg\Requests\Requests::request()} * (string, required) * - `headers`: Associative array of header fields. Same as the `$headers` * parameter to {@see \WpOrg\Requests\Requests::request()} * (array, default: `array()`) * - `data`: Associative array of data fields or a string. Same as the * `$data` parameter to {@see \WpOrg\Requests\Requests::request()} * (array|string, default: `array()`) * - `type`: HTTP request type (use \WpOrg\Requests\Requests constants). Same as the `$type` * parameter to {@see \WpOrg\Requests\Requests::request()} * (string, default: `\WpOrg\Requests\Requests::GET`) * - `cookies`: Associative array of cookie name to value, or cookie jar. * (array|\WpOrg\Requests\Cookie\Jar) * * If the `$options` parameter is specified, individual requests will * inherit options from it. This can be used to use a single hooking system, * or set all the types to `\WpOrg\Requests\Requests::POST`, for example. * * In addition, the `$options` parameter takes the following global options: * * - `complete`: A callback for when a request is complete. Takes two * parameters, a \WpOrg\Requests\Response/\WpOrg\Requests\Exception reference, and the * ID from the request array (Note: this can also be overridden on a * per-request basis, although that's a little silly) * (callback) * * @param array $requests Requests data (see description for more information) * @param array $options Global and default options (see {@see \WpOrg\Requests\Requests::request()}) * @return array Responses (either \WpOrg\Requests\Response or a \WpOrg\Requests\Exception object) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public static function request_multiple($requests, $options = []) { } /** * Get the default options * * @see \WpOrg\Requests\Requests::request() for values returned by this method * @param boolean $multirequest Is this a multirequest? * @return array Default option values */ protected static function get_default_options($multirequest = false) { } /** * Get default certificate path. * * @return string Default certificate path. */ public static function get_certificate_path() { } /** * Set default certificate path. * * @param string|Stringable|bool $path Certificate path, pointing to a PEM file. * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string, Stringable or boolean. */ public static function set_certificate_path($path) { } /** * Set the default values * * The $options parameter is updated with the results. * * @param string $url URL to request * @param array $headers Extra headers to send with the request * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests * @param string $type HTTP request type * @param array $options Options for the request * @return void * * @throws \WpOrg\Requests\Exception When the $url is not an http(s) URL. */ protected static function set_defaults(&$url, &$headers, &$data, &$type, &$options) { } /** * HTTP response parser * * @param string $headers Full response text including headers and body * @param string $url Original request URL * @param array $req_headers Original $headers array passed to {@link request()}, in case we need to follow redirects * @param array $req_data Original $data array passed to {@link request()}, in case we need to follow redirects * @param array $options Original $options array passed to {@link request()}, in case we need to follow redirects * @return \WpOrg\Requests\Response * * @throws \WpOrg\Requests\Exception On missing head/body separator (`requests.no_crlf_separator`) * @throws \WpOrg\Requests\Exception On missing head/body separator (`noversion`) * @throws \WpOrg\Requests\Exception On missing head/body separator (`toomanyredirects`) */ protected static function parse_response($headers, $url, $req_headers, $req_data, $options) { } /** * Callback for `transport.internal.parse_response` * * Internal use only. Converts a raw HTTP response to a \WpOrg\Requests\Response * while still executing a multiple request. * * `$response` is either set to a \WpOrg\Requests\Response instance, or a \WpOrg\Requests\Exception object * * @param string $response Full response text including headers and body (will be overwritten with Response instance) * @param array $request Request data as passed into {@see \WpOrg\Requests\Requests::request_multiple()} * @return void */ public static function parse_multiple(&$response, $request) { } /** * Decoded a chunked body as per RFC 2616 * * @link https://tools.ietf.org/html/rfc2616#section-3.6.1 * @param string $data Chunked body * @return string Decoded body */ protected static function decode_chunked($data) { } /** * Convert a key => value array to a 'key: value' array for headers * * @param iterable $dictionary Dictionary of header values * @return array List of headers * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not iterable. */ public static function flatten($dictionary) { } /** * Decompress an encoded body * * Implements gzip, compress and deflate. Guesses which it is by attempting * to decode. * * @param string $data Compressed data in one of the above formats * @return string Decompressed string * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string. */ public static function decompress($data) { } /** * Decompression of deflated string while staying compatible with the majority of servers. * * Certain Servers will return deflated data with headers which PHP's gzinflate() * function cannot handle out of the box. The following function has been created from * various snippets on the gzinflate() PHP documentation. * * Warning: Magic numbers within. Due to the potential different formats that the compressed * data may be returned in, some "magic offsets" are needed to ensure proper decompression * takes place. For a simple progmatic way to determine the magic offset in use, see: * https://core.trac.wordpress.org/ticket/18273 * * @since 1.6.0 * @link https://core.trac.wordpress.org/ticket/18273 * @link https://www.php.net/gzinflate#70875 * @link https://www.php.net/gzinflate#77336 * * @param string $gz_data String to decompress. * @return string|bool False on failure. * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string. */ public static function compatible_gzinflate($gz_data) { } } /** * HTTP response class * * Contains a response from \WpOrg\Requests\Requests::request() * * @package Requests */ class Response { /** * Response body * * @var string */ public $body = ''; /** * Raw HTTP data from the transport * * @var string */ public $raw = ''; /** * Headers, as an associative array * * @var \WpOrg\Requests\Response\Headers Array-like object representing headers */ public $headers = []; /** * Status code, false if non-blocking * * @var integer|boolean */ public $status_code = false; /** * Protocol version, false if non-blocking * * @var float|boolean */ public $protocol_version = false; /** * Whether the request succeeded or not * * @var boolean */ public $success = false; /** * Number of redirects the request used * * @var integer */ public $redirects = 0; /** * URL requested * * @var string */ public $url = ''; /** * Previous requests (from redirects) * * @var array Array of \WpOrg\Requests\Response objects */ public $history = []; /** * Cookies from the request * * @var \WpOrg\Requests\Cookie\Jar Array-like object representing a cookie jar */ public $cookies = []; /** * Constructor */ public function __construct() { } /** * Is the response a redirect? * * @return boolean True if redirect (3xx status), false if not. */ public function is_redirect() { } /** * Throws an exception if the request was not successful * * @param boolean $allow_redirects Set to false to throw on a 3xx as well * * @throws \WpOrg\Requests\Exception If `$allow_redirects` is false, and code is 3xx (`response.no_redirects`) * @throws \WpOrg\Requests\Exception\Http On non-successful status code. Exception class corresponds to "Status" + code (e.g. {@see \WpOrg\Requests\Exception\Http\Status404}) */ public function throw_for_status($allow_redirects = true) { } /** * JSON decode the response body. * * The method parameters are the same as those for the PHP native `json_decode()` function. * * @link https://php.net/json-decode * * @param bool|null $associative Optional. When `true`, JSON objects will be returned as associative arrays; * When `false`, JSON objects will be returned as objects. * When `null`, JSON objects will be returned as associative arrays * or objects depending on whether `JSON_OBJECT_AS_ARRAY` is set in the flags. * Defaults to `true` (in contrast to the PHP native default of `null`). * @param int $depth Optional. Maximum nesting depth of the structure being decoded. * Defaults to `512`. * @param int $options Optional. Bitmask of JSON_BIGINT_AS_STRING, JSON_INVALID_UTF8_IGNORE, * JSON_INVALID_UTF8_SUBSTITUTE, JSON_OBJECT_AS_ARRAY, JSON_THROW_ON_ERROR. * Defaults to `0` (no options set). * * @return array * * @throws \WpOrg\Requests\Exception If `$this->body` is not valid json. */ public function decode_body($associative = true, $depth = 512, $options = 0) { } } } namespace WpOrg\Requests\Utility { /** * Case-insensitive dictionary, suitable for HTTP headers * * @package Requests\Utilities */ class CaseInsensitiveDictionary implements \ArrayAccess, \IteratorAggregate { /** * Actual item data * * @var array */ protected $data = []; /** * Creates a case insensitive dictionary. * * @param array $data Dictionary/map to convert to case-insensitive */ public function __construct(array $data = []) { } /** * Check if the given item exists * * @param string $offset Item key * @return boolean Does the item exist? */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Get the value for the item * * @param string $offset Item key * @return string|null Item value (null if the item key doesn't exist) */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } /** * Set the given item * * @param string $offset Item name * @param string $value Item value * * @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`) */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } /** * Unset the given header * * @param string $offset The key for the item to unset. */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { } /** * Get an iterator for the data * * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { } /** * Get the headers as an array * * @return array Header data */ public function getAll() { } } } namespace WpOrg\Requests\Response { /** * Case-insensitive dictionary, suitable for HTTP headers * * @package Requests */ class Headers extends \WpOrg\Requests\Utility\CaseInsensitiveDictionary { /** * Get the given header * * Unlike {@see \WpOrg\Requests\Response\Headers::getValues()}, this returns a string. If there are * multiple values, it concatenates them with a comma as per RFC2616. * * Avoid using this where commas may be used unquoted in values, such as * Set-Cookie headers. * * @param string $offset Name of the header to retrieve. * @return string|null Header value */ public function offsetGet($offset) { } /** * Set the given item * * @param string $offset Item name * @param string $value Item value * * @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`) */ public function offsetSet($offset, $value) { } /** * Get all values for a given header * * @param string $offset Name of the header to retrieve. * @return array|null Header values * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not valid as an array key. */ public function getValues($offset) { } /** * Flattens a value into a string * * Converts an array into a string by imploding values with a comma, as per * RFC2616's rules for folding headers. * * @param string|array $value Value to flatten * @return string Flattened value * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or an array. */ public function flatten($value) { } /** * Get an iterator for the data * * Converts the internally stored values to a comma-separated string if there is more * than one value for a key. * * @return \ArrayIterator */ public function getIterator() { } } } namespace WpOrg\Requests { /** * Session handler for persistent requests and default parameters * * Allows various options to be set as default values, and merges both the * options and URL properties together. A base URL can be set for all requests, * with all subrequests resolved from this. Base options can be set (including * a shared cookie jar), then overridden for individual requests. * * @package Requests\SessionHandler */ class Session { /** * Base URL for requests * * URLs will be made absolute using this as the base * * @var string|null */ public $url = null; /** * Base headers for requests * * @var array */ public $headers = []; /** * Base data for requests * * If both the base data and the per-request data are arrays, the data will * be merged before sending the request. * * @var array */ public $data = []; /** * Base options for requests * * The base options are merged with the per-request data for each request. * The only default option is a shared cookie jar between requests. * * Values here can also be set directly via properties on the Session * object, e.g. `$session->useragent = 'X';` * * @var array */ public $options = []; /** * Create a new session * * @param string|Stringable|null $url Base URL for requests * @param array $headers Default headers for requests * @param array $data Default data for requests * @param array $options Default options for requests * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string, Stringable or null. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $headers argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function __construct($url = null, $headers = [], $data = [], $options = []) { } /** * Get a property's value * * @param string $name Property name. * @return mixed|null Property value, null if none found */ public function __get($name) { } /** * Set a property's value * * @param string $name Property name. * @param mixed $value Property value */ public function __set($name, $value) { } /** * Remove a property's value * * @param string $name Property name. */ public function __isset($name) { } /** * Remove a property's value * * @param string $name Property name. */ public function __unset($name) { } /**#@+ * @see \WpOrg\Requests\Session::request() * @param string $url * @param array $headers * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a GET request */ public function get($url, $headers = [], $options = []) { } /** * Send a HEAD request */ public function head($url, $headers = [], $options = []) { } /** * Send a DELETE request */ public function delete($url, $headers = [], $options = []) { } /**#@-*/ /**#@+ * @see \WpOrg\Requests\Session::request() * @param string $url * @param array $headers * @param array $data * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a POST request */ public function post($url, $headers = [], $data = [], $options = []) { } /** * Send a PUT request */ public function put($url, $headers = [], $data = [], $options = []) { } /** * Send a PATCH request * * Note: Unlike {@see \WpOrg\Requests\Session::post()} and {@see \WpOrg\Requests\Session::put()}, * `$headers` is required, as the specification recommends that should send an ETag * * @link https://tools.ietf.org/html/rfc5789 */ public function patch($url, $headers, $data = [], $options = []) { } /**#@-*/ /** * Main interface for HTTP requests * * This method initiates a request and sends it via a transport before * parsing. * * @see \WpOrg\Requests\Requests::request() * * @param string $url URL to request * @param array $headers Extra headers to send with the request * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests * @param string $type HTTP request type (use \WpOrg\Requests\Requests constants) * @param array $options Options for the request (see {@see \WpOrg\Requests\Requests::request()}) * @return \WpOrg\Requests\Response * * @throws \WpOrg\Requests\Exception On invalid URLs (`nonhttp`) */ public function request($url, $headers = [], $data = [], $type = \WpOrg\Requests\Requests::GET, $options = []) { } /** * Send multiple HTTP requests simultaneously * * @see \WpOrg\Requests\Requests::request_multiple() * * @param array $requests Requests data (see {@see \WpOrg\Requests\Requests::request_multiple()}) * @param array $options Global and default options (see {@see \WpOrg\Requests\Requests::request()}) * @return array Responses (either \WpOrg\Requests\Response or a \WpOrg\Requests\Exception object) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function request_multiple($requests, $options = []) { } public function __wakeup() { } /** * Merge a request's data with the default data * * @param array $request Request data (same form as {@see \WpOrg\Requests\Session::request_multiple()}) * @param boolean $merge_options Should we merge options as well? * @return array Request data */ protected function merge_request($request, $merge_options = true) { } } /** * SSL utilities for Requests * * Collection of utilities for working with and verifying SSL certificates. * * @package Requests\Utilities */ final class Ssl { /** * Verify the certificate against common name and subject alternative names * * Unfortunately, PHP doesn't check the certificate against the alternative * names, leading things like 'https://www.github.com/' to be invalid. * * @link https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1 * * @param string|Stringable $host Host name to verify against * @param array $cert Certificate data from openssl_x509_parse() * @return bool * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $host argument is not a string or a stringable object. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $cert argument is not an array or array accessible. */ public static function verify_certificate($host, $cert) { } /** * Verify that a reference name is valid * * Verifies a dNSName for HTTPS usage, (almost) as per Firefox's rules: * - Wildcards can only occur in a name with more than 3 components * - Wildcards can only occur as the last character in the first * component * - Wildcards may be preceded by additional characters * * We modify these rules to be a bit stricter and only allow the wildcard * character to be the full first component; that is, with the exclusion of * the third rule. * * @param string|Stringable $reference Reference dNSName * @return boolean Is the name valid? * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or a stringable object. */ public static function verify_reference_name($reference) { } /** * Match a hostname against a dNSName reference * * @param string|Stringable $host Requested host * @param string|Stringable $reference dNSName to match against * @return boolean Does the domain match? * @throws \WpOrg\Requests\Exception\InvalidArgument When either of the passed arguments is not a string or a stringable object. */ public static function match_domain($host, $reference) { } } /** * Base HTTP transport * * @package Requests\Transport */ interface Transport { /** * Perform a request * * @param string $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return string Raw HTTP result */ public function request($url, $headers = [], $data = [], $options = []); /** * Send multiple requests simultaneously * * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see \WpOrg\Requests\Transport::request()} * @param array $options Global options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well) */ public function request_multiple($requests, $options); /** * Self-test whether the transport can be used. * * The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}. * * @param array $capabilities Optional. Associative array of capabilities to test against, i.e. `['' => true]`. * @return bool Whether the transport can be used. */ public static function test($capabilities = []); } } namespace WpOrg\Requests\Transport { /** * cURL HTTP transport * * @package Requests\Transport */ final class Curl implements \WpOrg\Requests\Transport { const CURL_7_10_5 = 0x70a05; const CURL_7_16_2 = 0x71002; /** * Raw HTTP data * * @var string */ public $headers = ''; /** * Raw body data * * @var string */ public $response_data = ''; /** * Information on the current request * * @var array cURL information array, see {@link https://www.php.net/curl_getinfo} */ public $info; /** * cURL version number * * @var int */ public $version; /** * Constructor */ public function __construct() { } /** * Destructor */ public function __destruct() { } /** * Perform a request * * @param string|Stringable $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return string Raw HTTP result * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string or Stringable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $headers argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data parameter is not an array or string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. * @throws \WpOrg\Requests\Exception On a cURL error (`curlerror`) */ public function request($url, $headers = [], $data = [], $options = []) { } /** * Send multiple requests simultaneously * * @param array $requests Request data * @param array $options Global options * @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function request_multiple($requests, $options) { } /** * Get the cURL handle for use in a multi-request * * @param string $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return resource|\CurlHandle Subrequest's cURL handle */ public function &get_subrequest_handle($url, $headers, $data, $options) { } /** * Process a response * * @param string $response Response data from the body * @param array $options Request options * @return string|false HTTP response data including headers. False if non-blocking. * @throws \WpOrg\Requests\Exception If the request resulted in a cURL error. */ public function process_response($response, $options) { } /** * Collect the headers as they are received * * @param resource|\CurlHandle $handle cURL handle * @param string $headers Header string * @return integer Length of provided header */ public function stream_headers($handle, $headers) { } /** * Collect data as it's received * * @since 1.6.1 * * @param resource|\CurlHandle $handle cURL handle * @param string $data Body data * @return integer Length of provided data */ public function stream_body($handle, $data) { } /** * Self-test whether the transport can be used. * * The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}. * * @codeCoverageIgnore * @param array $capabilities Optional. Associative array of capabilities to test against, i.e. `['' => true]`. * @return bool Whether the transport can be used. */ public static function test($capabilities = []) { } } /** * fsockopen HTTP transport * * @package Requests\Transport */ final class Fsockopen implements \WpOrg\Requests\Transport { /** * Second to microsecond conversion * * @var integer */ const SECOND_IN_MICROSECONDS = 1000000; /** * Raw HTTP data * * @var string */ public $headers = ''; /** * Stream metadata * * @var array Associative array of properties, see {@link https://www.php.net/stream_get_meta_data} */ public $info; /** * Perform a request * * @param string|Stringable $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return string Raw HTTP result * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string or Stringable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $headers argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data parameter is not an array or string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. * @throws \WpOrg\Requests\Exception On failure to connect to socket (`fsockopenerror`) * @throws \WpOrg\Requests\Exception On socket timeout (`timeout`) */ public function request($url, $headers = [], $data = [], $options = []) { } /** * Send multiple requests simultaneously * * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see \WpOrg\Requests\Transport::request()} * @param array $options Global options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function request_multiple($requests, $options) { } /** * Error handler for stream_socket_client() * * @param int $errno Error number (e.g. E_WARNING) * @param string $errstr Error message */ public function connect_error_handler($errno, $errstr) { } /** * Verify the certificate against common name and subject alternative names * * Unfortunately, PHP doesn't check the certificate against the alternative * names, leading things like 'https://www.github.com/' to be invalid. * Instead * * @link https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1 * * @param string $host Host name to verify against * @param resource $context Stream context * @return bool * * @throws \WpOrg\Requests\Exception On failure to connect via TLS (`fsockopen.ssl.connect_error`) * @throws \WpOrg\Requests\Exception On not obtaining a match for the host (`fsockopen.ssl.no_match`) */ public function verify_certificate_from_context($host, $context) { } /** * Self-test whether the transport can be used. * * The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}. * * @codeCoverageIgnore * @param array $capabilities Optional. Associative array of capabilities to test against, i.e. `['' => true]`. * @return bool Whether the transport can be used. */ public static function test($capabilities = []) { } } } namespace WpOrg\Requests\Utility { /** * Iterator for arrays requiring filtered values * * @package Requests\Utilities */ final class FilteredIterator extends \ArrayIterator { /** * Create a new iterator * * @param array $data The array or object to be iterated on. * @param callable $callback Callback to be called on each value * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data argument is not iterable. */ public function __construct($data, $callback) { } /** * Prevent unserialization of the object for security reasons. * * @phpcs:disable PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound * * @param array $data Restored array of data originally serialized. * * @return void */ #[\ReturnTypeWillChange] public function __unserialize($data) { } /** * Perform reinitialization tasks. * * Prevents a callback from being injected during unserialization of an object. * * @return void */ public function __wakeup() { } /** * Get the current item's value after filtering * * @return string */ #[\ReturnTypeWillChange] public function current() { } /** * Prevent creating a PHP value from a stored representation of the object for security reasons. * * @param string $data The serialized string. * * @return void */ #[\ReturnTypeWillChange] public function unserialize($data) { } } /** * Input validation utilities. * * @package Requests\Utilities */ final class InputValidator { /** * Verify that a received input parameter is of type string or is "stringable". * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_string_or_stringable($input) { } /** * Verify whether a received input parameter is usable as an integer array key. * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_numeric_array_key($input) { } /** * Verify whether a received input parameter is "stringable". * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_stringable_object($input) { } /** * Verify whether a received input parameter is _accessible as if it were an array_. * * @param mixed $input Input parameter to verify. * * @return bool */ public static function has_array_access($input) { } /** * Verify whether a received input parameter is "iterable". * * @internal The PHP native `is_iterable()` function was only introduced in PHP 7.1 * and this library still supports PHP 5.6. * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_iterable($input) { } /** * Verify whether a received input parameter is a Curl handle. * * The PHP Curl extension worked with resources prior to PHP 8.0 and with * an instance of the `CurlHandle` class since PHP 8.0. * {@link https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object} * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_curl_handle($input) { } } } namespace { /** * Autoloader class * * @package SimplePie * @subpackage API */ class SimplePie_Autoloader { protected $path; /** * Constructor */ public function __construct() { } /** * Autoloader * * @param string $class The name of the class to attempt to load. * @phpstan-return void */ public function autoload($class) { } } } namespace SimplePie { /** * SimplePie * * @package SimplePie * @subpackage API */ class SimplePie { /** * SimplePie Name */ public const NAME = 'SimplePie'; /** * SimplePie Version */ public const VERSION = '1.8.0'; /** * SimplePie Website URL */ public const URL = 'http://simplepie.org'; /** * SimplePie Linkback */ public const LINKBACK = '' . self::NAME . ''; /** * No Autodiscovery * @see SimplePie::set_autodiscovery_level() */ public const LOCATOR_NONE = 0; /** * Feed Link Element Autodiscovery * @see SimplePie::set_autodiscovery_level() */ public const LOCATOR_AUTODISCOVERY = 1; /** * Local Feed Extension Autodiscovery * @see SimplePie::set_autodiscovery_level() */ public const LOCATOR_LOCAL_EXTENSION = 2; /** * Local Feed Body Autodiscovery * @see SimplePie::set_autodiscovery_level() */ public const LOCATOR_LOCAL_BODY = 4; /** * Remote Feed Extension Autodiscovery * @see SimplePie::set_autodiscovery_level() */ public const LOCATOR_REMOTE_EXTENSION = 8; /** * Remote Feed Body Autodiscovery * @see SimplePie::set_autodiscovery_level() */ public const LOCATOR_REMOTE_BODY = 16; /** * All Feed Autodiscovery * @see SimplePie::set_autodiscovery_level() */ public const LOCATOR_ALL = 31; /** * No known feed type */ public const TYPE_NONE = 0; /** * RSS 0.90 */ public const TYPE_RSS_090 = 1; /** * RSS 0.91 (Netscape) */ public const TYPE_RSS_091_NETSCAPE = 2; /** * RSS 0.91 (Userland) */ public const TYPE_RSS_091_USERLAND = 4; /** * RSS 0.91 (both Netscape and Userland) */ public const TYPE_RSS_091 = 6; /** * RSS 0.92 */ public const TYPE_RSS_092 = 8; /** * RSS 0.93 */ public const TYPE_RSS_093 = 16; /** * RSS 0.94 */ public const TYPE_RSS_094 = 32; /** * RSS 1.0 */ public const TYPE_RSS_10 = 64; /** * RSS 2.0 */ public const TYPE_RSS_20 = 128; /** * RDF-based RSS */ public const TYPE_RSS_RDF = 65; /** * Non-RDF-based RSS (truly intended as syndication format) */ public const TYPE_RSS_SYNDICATION = 190; /** * All RSS */ public const TYPE_RSS_ALL = 255; /** * Atom 0.3 */ public const TYPE_ATOM_03 = 256; /** * Atom 1.0 */ public const TYPE_ATOM_10 = 512; /** * All Atom */ public const TYPE_ATOM_ALL = 768; /** * All feed types */ public const TYPE_ALL = 1023; /** * No construct */ public const CONSTRUCT_NONE = 0; /** * Text construct */ public const CONSTRUCT_TEXT = 1; /** * HTML construct */ public const CONSTRUCT_HTML = 2; /** * XHTML construct */ public const CONSTRUCT_XHTML = 4; /** * base64-encoded construct */ public const CONSTRUCT_BASE64 = 8; /** * IRI construct */ public const CONSTRUCT_IRI = 16; /** * A construct that might be HTML */ public const CONSTRUCT_MAYBE_HTML = 32; /** * All constructs */ public const CONSTRUCT_ALL = 63; /** * Don't change case */ public const SAME_CASE = 1; /** * Change to lowercase */ public const LOWERCASE = 2; /** * Change to uppercase */ public const UPPERCASE = 4; /** * PCRE for HTML attributes */ public const PCRE_HTML_ATTRIBUTE = '((?:[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]+[^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x2F\\x3D\\x3E]*(?:[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*=[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x22\\x27\\x3E][^\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\x3E]*)?))?)*)[\\x09\\x0A\\x0B\\x0C\\x0D\\x20]*'; /** * PCRE for XML attributes */ public const PCRE_XML_ATTRIBUTE = '((?:\\s+(?:(?:[^\\s:]+:)?[^\\s:]+)\\s*=\\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\\s*'; /** * XML Namespace */ public const NAMESPACE_XML = 'http://www.w3.org/XML/1998/namespace'; /** * Atom 1.0 Namespace */ public const NAMESPACE_ATOM_10 = 'http://www.w3.org/2005/Atom'; /** * Atom 0.3 Namespace */ public const NAMESPACE_ATOM_03 = 'http://purl.org/atom/ns#'; /** * RDF Namespace */ public const NAMESPACE_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; /** * RSS 0.90 Namespace */ public const NAMESPACE_RSS_090 = 'http://my.netscape.com/rdf/simple/0.9/'; /** * RSS 1.0 Namespace */ public const NAMESPACE_RSS_10 = 'http://purl.org/rss/1.0/'; /** * RSS 1.0 Content Module Namespace */ public const NAMESPACE_RSS_10_MODULES_CONTENT = 'http://purl.org/rss/1.0/modules/content/'; /** * RSS 2.0 Namespace * (Stupid, I know, but I'm certain it will confuse people less with support.) */ public const NAMESPACE_RSS_20 = ''; /** * DC 1.0 Namespace */ public const NAMESPACE_DC_10 = 'http://purl.org/dc/elements/1.0/'; /** * DC 1.1 Namespace */ public const NAMESPACE_DC_11 = 'http://purl.org/dc/elements/1.1/'; /** * W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace */ public const NAMESPACE_W3C_BASIC_GEO = 'http://www.w3.org/2003/01/geo/wgs84_pos#'; /** * GeoRSS Namespace */ public const NAMESPACE_GEORSS = 'http://www.georss.org/georss'; /** * Media RSS Namespace */ public const NAMESPACE_MEDIARSS = 'http://search.yahoo.com/mrss/'; /** * Wrong Media RSS Namespace. Caused by a long-standing typo in the spec. */ public const NAMESPACE_MEDIARSS_WRONG = 'http://search.yahoo.com/mrss'; /** * Wrong Media RSS Namespace #2. New namespace introduced in Media RSS 1.5. */ public const NAMESPACE_MEDIARSS_WRONG2 = 'http://video.search.yahoo.com/mrss'; /** * Wrong Media RSS Namespace #3. A possible typo of the Media RSS 1.5 namespace. */ public const NAMESPACE_MEDIARSS_WRONG3 = 'http://video.search.yahoo.com/mrss/'; /** * Wrong Media RSS Namespace #4. New spec location after the RSS Advisory Board takes it over, but not a valid namespace. */ public const NAMESPACE_MEDIARSS_WRONG4 = 'http://www.rssboard.org/media-rss'; /** * Wrong Media RSS Namespace #5. A possible typo of the RSS Advisory Board URL. */ public const NAMESPACE_MEDIARSS_WRONG5 = 'http://www.rssboard.org/media-rss/'; /** * iTunes RSS Namespace */ public const NAMESPACE_ITUNES = 'http://www.itunes.com/dtds/podcast-1.0.dtd'; /** * XHTML Namespace */ public const NAMESPACE_XHTML = 'http://www.w3.org/1999/xhtml'; /** * IANA Link Relations Registry */ public const IANA_LINK_RELATIONS_REGISTRY = 'http://www.iana.org/assignments/relation/'; /** * No file source */ public const FILE_SOURCE_NONE = 0; /** * Remote file source */ public const FILE_SOURCE_REMOTE = 1; /** * Local file source */ public const FILE_SOURCE_LOCAL = 2; /** * fsockopen() file source */ public const FILE_SOURCE_FSOCKOPEN = 4; /** * cURL file source */ public const FILE_SOURCE_CURL = 8; /** * file_get_contents() file source */ public const FILE_SOURCE_FILE_GET_CONTENTS = 16; /** * @var array Raw data * @access private */ public $data = []; /** * @var mixed Error string * @access private */ public $error; /** * @var int HTTP status code * @see SimplePie::status_code() * @access private */ public $status_code = 0; /** * @var object Instance of \SimplePie\Sanitize (or other class) * @see SimplePie::set_sanitize_class() * @access private */ public $sanitize; /** * @var string SimplePie Useragent * @see SimplePie::set_useragent() * @access private */ public $useragent = ''; /** * @var string Feed URL * @see SimplePie::set_feed_url() * @access private */ public $feed_url; /** * @var string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently * @see SimplePie::subscribe_url() * @access private */ public $permanent_url = null; /** * @var object Instance of \SimplePie\File to use as a feed * @see SimplePie::set_file() * @access private */ public $file; /** * @var string Raw feed data * @see SimplePie::set_raw_data() * @access private */ public $raw_data; /** * @var int Timeout for fetching remote files * @see SimplePie::set_timeout() * @access private */ public $timeout = 10; /** * @var array Custom curl options * @see SimplePie::set_curl_options() * @access private */ public $curl_options = []; /** * @var bool Forces fsockopen() to be used for remote files instead * of cURL, even if a new enough version is installed * @see SimplePie::force_fsockopen() * @access private */ public $force_fsockopen = false; /** * @var bool Force the given data/URL to be treated as a feed no matter what * it appears like * @see SimplePie::force_feed() * @access private */ public $force_feed = false; /** * @var bool Force SimplePie to fallback to expired cache, if enabled, * when feed is unavailable. * @see SimplePie::force_cache_fallback() * @access private */ public $force_cache_fallback = false; /** * @var int Cache duration (in seconds) * @see SimplePie::set_cache_duration() * @access private */ public $cache_duration = 3600; /** * @var int Auto-discovery cache duration (in seconds) * @see SimplePie::set_autodiscovery_cache_duration() * @access private */ public $autodiscovery_cache_duration = 604800; /** * @var string Cache location (relative to executing script) * @see SimplePie::set_cache_location() * @access private */ public $cache_location = './cache'; /** * @var string Function that creates the cache filename * @see SimplePie::set_cache_name_function() * @access private */ public $cache_name_function = 'md5'; /** * @var bool Reorder feed by date descending * @see SimplePie::enable_order_by_date() * @access private */ public $order_by_date = true; /** * @var mixed Force input encoding to be set to the follow value * (false, or anything type-cast to false, disables this feature) * @see SimplePie::set_input_encoding() * @access private */ public $input_encoding = false; /** * @var int Feed Autodiscovery Level * @see SimplePie::set_autodiscovery_level() * @access private */ public $autodiscovery = self::LOCATOR_ALL; /** * Class registry object * * @var \SimplePie\Registry */ public $registry; /** * @var int Maximum number of feeds to check with autodiscovery * @see SimplePie::set_max_checked_feeds() * @access private */ public $max_checked_feeds = 10; /** * @var array All the feeds found during the autodiscovery process * @see SimplePie::get_all_discovered_feeds() * @access private */ public $all_discovered_feeds = []; /** * @var string Web-accessible path to the handler_image.php file. * @see SimplePie::set_image_handler() * @access private */ public $image_handler = ''; /** * @var array Stores the URLs when multiple feeds are being initialized. * @see SimplePie::set_feed_url() * @access private */ public $multifeed_url = []; /** * @var array Stores SimplePie objects when multiple feeds initialized. * @access private */ public $multifeed_objects = []; /** * @var array Stores the get_object_vars() array for use with multifeeds. * @see SimplePie::set_feed_url() * @access private */ public $config_settings = null; /** * @var integer Stores the number of items to return per-feed with multifeeds. * @see SimplePie::set_item_limit() * @access private */ public $item_limit = 0; /** * @var bool Stores if last-modified and/or etag headers were sent with the * request when checking a feed. */ public $check_modified = false; /** * @var array Stores the default attributes to be stripped by strip_attributes(). * @see SimplePie::strip_attributes() * @access private */ public $strip_attributes = ['bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']; /** * @var array Stores the default attributes to add to different tags by add_attributes(). * @see SimplePie::add_attributes() * @access private */ public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]; /** * @var array Stores the default tags to be stripped by strip_htmltags(). * @see SimplePie::strip_htmltags() * @access private */ public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']; /** * @var array Stores the default attributes to be renamed by rename_attributes(). * @see SimplePie::rename_attributes() * @access private */ public $rename_attributes = []; /** * @var bool Should we throw exceptions, or use the old-style error property? * @access private */ public $enable_exceptions = false; /** * The SimplePie class contains feed level data and options * * To use SimplePie, create the SimplePie object with no parameters. You can * then set configuration options using the provided methods. After setting * them, you must initialise the feed using $feed->init(). At that point the * object's methods and properties will be available to you. * * Previously, it was possible to pass in the feed URL along with cache * options directly into the constructor. This has been removed as of 1.3 as * it caused a lot of confusion. * * @since 1.0 Preview Release */ public function __construct() { } /** * Used for converting object to a string */ public function __toString() { } /** * Remove items that link back to this before destroying this object */ public function __destruct() { } /** * Force the given data/URL to be treated as a feed * * This tells SimplePie to ignore the content-type provided by the server. * Be careful when using this option, as it will also disable autodiscovery. * * @since 1.1 * @param bool $enable Force the given data/URL to be treated as a feed */ public function force_feed($enable = false) { } /** * Set the URL of the feed you want to parse * * This allows you to enter the URL of the feed you want to parse, or the * website you want to try to use auto-discovery on. This takes priority * over any set raw data. * * You can set multiple feeds to mash together by passing an array instead * of a string for the $url. Remember that with each additional feed comes * additional processing and resources. * * @since 1.0 Preview Release * @see set_raw_data() * @param string|array $url This is the URL (or array of URLs) that you want to parse. */ public function set_feed_url($url) { } /** * Set an instance of {@see \SimplePie\File} to use as a feed * * @param \SimplePie\File &$file * @return bool True on success, false on failure */ public function set_file(&$file) { } /** * Set the raw XML data to parse * * Allows you to use a string of RSS/Atom data instead of a remote feed. * * If you have a feed available as a string in PHP, you can tell SimplePie * to parse that data string instead of a remote feed. Any set feed URL * takes precedence. * * @since 1.0 Beta 3 * @param string $data RSS or Atom data as a string. * @see set_feed_url() */ public function set_raw_data($data) { } /** * Set the default timeout for fetching remote feeds * * This allows you to change the maximum time the feed's server to respond * and send the feed back. * * @since 1.0 Beta 3 * @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed. */ public function set_timeout($timeout = 10) { } /** * Set custom curl options * * This allows you to change default curl options * * @since 1.0 Beta 3 * @param array $curl_options Curl options to add to default settings */ public function set_curl_options(array $curl_options = []) { } /** * Force SimplePie to use fsockopen() instead of cURL * * @since 1.0 Beta 3 * @param bool $enable Force fsockopen() to be used */ public function force_fsockopen($enable = false) { } /** * Enable/disable caching in SimplePie. * * This option allows you to disable caching all-together in SimplePie. * However, disabling the cache can lead to longer load times. * * @since 1.0 Preview Release * @param bool $enable Enable caching */ public function enable_cache($enable = true) { } /** * Set a PSR-16 implementation as cache * * @param CacheInterface $psr16cache The PSR-16 cache implementation * * @return void */ public function set_cache(\Psr\SimpleCache\CacheInterface $cache) { } /** * SimplePie to continue to fall back to expired cache, if enabled, when * feed is unavailable. * * This tells SimplePie to ignore any file errors and fall back to cache * instead. This only works if caching is enabled and cached content * still exists. * * @deprecated since SimplePie 1.8.0, expired cache will not be used anymore. * * @param bool $enable Force use of cache on fail. */ public function force_cache_fallback($enable = false) { } /** * Set the length of time (in seconds) that the contents of a feed will be * cached * * @param int $seconds The feed content cache duration */ public function set_cache_duration($seconds = 3600) { } /** * Set the length of time (in seconds) that the autodiscovered feed URL will * be cached * * @param int $seconds The autodiscovered feed URL cache duration. */ public function set_autodiscovery_cache_duration($seconds = 604800) { } /** * Set the file system location where the cached files should be stored * * @deprecated since SimplePie 1.8.0, use \SimplePie\SimplePie::set_cache() instead. * * @param string $location The file system location. */ public function set_cache_location($location = './cache') { } /** * Return the filename (i.e. hash, without path and without extension) of the file to cache a given URL. * * @param string $url The URL of the feed to be cached. * @return string A filename (i.e. hash, without path and without extension). */ public function get_cache_filename($url) { } /** * Set whether feed items should be sorted into reverse chronological order * * @param bool $enable Sort as reverse chronological order. */ public function enable_order_by_date($enable = true) { } /** * Set the character encoding used to parse the feed * * This overrides the encoding reported by the feed, however it will fall * back to the normal encoding detection if the override fails * * @param string $encoding Character encoding */ public function set_input_encoding($encoding = false) { } /** * Set how much feed autodiscovery to do * * @see \SimplePie\SimplePie::LOCATOR_NONE * @see \SimplePie\SimplePie::LOCATOR_AUTODISCOVERY * @see \SimplePie\SimplePie::LOCATOR_LOCAL_EXTENSION * @see \SimplePie\SimplePie::LOCATOR_LOCAL_BODY * @see \SimplePie\SimplePie::LOCATOR_REMOTE_EXTENSION * @see \SimplePie\SimplePie::LOCATOR_REMOTE_BODY * @see \SimplePie\SimplePie::LOCATOR_ALL * @param int $level Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator) */ public function set_autodiscovery_level($level = self::LOCATOR_ALL) { } /** * Get the class registry * * Use this to override SimplePie's default classes * @see \SimplePie\Registry * * @return Registry */ public function &get_registry() { } /** * Set which class SimplePie uses for caching * * @deprecated since SimplePie 1.3, use {@see set_cache()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_cache_class($class = \SimplePie\Cache::class) { } /** * Set which class SimplePie uses for auto-discovery * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_locator_class($class = \SimplePie\Locator::class) { } /** * Set which class SimplePie uses for XML parsing * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_parser_class($class = \SimplePie\Parser::class) { } /** * Set which class SimplePie uses for remote file fetching * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_file_class($class = \SimplePie\File::class) { } /** * Set which class SimplePie uses for data sanitization * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_sanitize_class($class = \SimplePie\Sanitize::class) { } /** * Set which class SimplePie uses for handling feed items * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_item_class($class = \SimplePie\Item::class) { } /** * Set which class SimplePie uses for handling author data * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_author_class($class = \SimplePie\Author::class) { } /** * Set which class SimplePie uses for handling category data * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_category_class($class = \SimplePie\Category::class) { } /** * Set which class SimplePie uses for feed enclosures * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_enclosure_class($class = \SimplePie\Enclosure::class) { } /** * Set which class SimplePie uses for `` captions * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_caption_class($class = \SimplePie\Caption::class) { } /** * Set which class SimplePie uses for `` * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_copyright_class($class = \SimplePie\Copyright::class) { } /** * Set which class SimplePie uses for `` * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_credit_class($class = \SimplePie\Credit::class) { } /** * Set which class SimplePie uses for `` * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_rating_class($class = \SimplePie\Rating::class) { } /** * Set which class SimplePie uses for `` * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_restriction_class($class = \SimplePie\Restriction::class) { } /** * Set which class SimplePie uses for content-type sniffing * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_content_type_sniffer_class($class = \SimplePie\Content\Type\Sniffer::class) { } /** * Set which class SimplePie uses item sources * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * * @param string $class Name of custom class * * @return boolean True on success, false otherwise */ public function set_source_class($class = \SimplePie\Source::class) { } /** * Set the user agent string * * @param string $ua New user agent string. */ public function set_useragent($ua = null) { } /** * Set a namefilter to modify the cache filename with * * @param NameFilter $filter * * @return void */ public function set_cache_namefilter(\SimplePie\Cache\NameFilter $filter) : void { } /** * Set callback function to create cache filename with * * @deprecated since SimplePie 1.8.0, use {@see set_cache_namefilter()} instead * * @param mixed $function Callback function */ public function set_cache_name_function($function = 'md5') { } /** * Set options to make SP as fast as possible * * Forgoes a substantial amount of data sanitization in favor of speed. This * turns SimplePie into a dumb parser of feeds. * * @param bool $set Whether to set them or not */ public function set_stupidly_fast($set = false) { } /** * Set maximum number of feeds to check with autodiscovery * * @param int $max Maximum number of feeds to check */ public function set_max_checked_feeds($max = 10) { } public function remove_div($enable = true) { } public function strip_htmltags($tags = '', $encode = null) { } public function encode_instead_of_strip($enable = true) { } public function rename_attributes($attribs = '') { } public function strip_attributes($attribs = '') { } public function add_attributes($attribs = '') { } /** * Set the output encoding * * Allows you to override SimplePie's output to match that of your webpage. * This is useful for times when your webpages are not being served as * UTF-8. This setting will be obeyed by {@see handle_content_type()}, and * is similar to {@see set_input_encoding()}. * * It should be noted, however, that not all character encodings can support * all characters. If your page is being served as ISO-8859-1 and you try * to display a Japanese feed, you'll likely see garbled characters. * Because of this, it is highly recommended to ensure that your webpages * are served as UTF-8. * * The number of supported character encodings depends on whether your web * host supports {@link http://php.net/mbstring mbstring}, * {@link http://php.net/iconv iconv}, or both. See * {@link http://simplepie.org/wiki/faq/Supported_Character_Encodings} for * more information. * * @param string $encoding */ public function set_output_encoding($encoding = 'UTF-8') { } public function strip_comments($strip = false) { } /** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite, * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite, * |q|@cite * * @since 1.0 * @param array|null $element_attribute Element/attribute key/value pairs, null for default */ public function set_url_replacements($element_attribute = null) { } /** * Set the list of domains for which to force HTTPS. * @see \SimplePie\Sanitize::set_https_domains() * @param array List of HTTPS domains. Example array('biz', 'example.com', 'example.org', 'www.example.net'). */ public function set_https_domains($domains = []) { } /** * Set the handler to enable the display of cached images. * * @param string $page Web-accessible path to the handler_image.php file. * @param string $qs The query string that the value should be passed to. */ public function set_image_handler($page = false, $qs = 'i') { } /** * Set the limit for items returned per-feed with multifeeds * * @param integer $limit The maximum number of items to return. */ public function set_item_limit($limit = 0) { } /** * Enable throwing exceptions * * @param boolean $enable Should we throw exceptions, or use the old-style error property? */ public function enable_exceptions($enable = true) { } /** * Initialize the feed object * * This is what makes everything happen. Period. This is where all of the * configuration options get processed, feeds are fetched, cached, and * parsed, and all of that other good stuff. * * @return boolean True if successful, false otherwise */ public function init() { } /** * Fetch the data via \SimplePie\File * * If the data is already cached, attempt to fetch it from there instead * @param Base|DataCache|false $cache Cache handler, or false to not load from the cache * @return array|true Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type */ protected function fetch_data(&$cache) { } /** * Get the error message for the occurred error * * @return string|array Error message, or array of messages for multifeeds */ public function error() { } /** * Get the last HTTP status code * * @return int Status code */ public function status_code() { } /** * Get the raw XML * * This is the same as the old `$feed->enable_xml_dump(true)`, but returns * the data instead of printing it. * * @return string|boolean Raw XML data, false if the cache is used */ public function get_raw_data() { } /** * Get the character encoding used for output * * @since Preview Release * @return string */ public function get_encoding() { } /** * Send the content-type header with correct encoding * * This method ensures that the SimplePie-enabled page is being served with * the correct {@link http://www.iana.org/assignments/media-types/ mime-type} * and character encoding HTTP headers (character encoding determined by the * {@see set_output_encoding} config option). * * This won't work properly if any content or whitespace has already been * sent to the browser, because it relies on PHP's * {@link http://php.net/header header()} function, and these are the * circumstances under which the function works. * * Because it's setting these settings for the entire page (as is the nature * of HTTP headers), this should only be used once per page (again, at the * top). * * @param string $mime MIME type to serve the page as */ public function handle_content_type($mime = 'text/html') { } /** * Get the type of the feed * * This returns a \SimplePie\SimplePie::TYPE_* constant, which can be tested against * using {@link http://php.net/language.operators.bitwise bitwise operators} * * @since 0.8 (usage changed to using constants in 1.0) * @see \SimplePie\SimplePie::TYPE_NONE Unknown. * @see \SimplePie\SimplePie::TYPE_RSS_090 RSS 0.90. * @see \SimplePie\SimplePie::TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape). * @see \SimplePie\SimplePie::TYPE_RSS_091_USERLAND RSS 0.91 (Userland). * @see \SimplePie\SimplePie::TYPE_RSS_091 RSS 0.91. * @see \SimplePie\SimplePie::TYPE_RSS_092 RSS 0.92. * @see \SimplePie\SimplePie::TYPE_RSS_093 RSS 0.93. * @see \SimplePie\SimplePie::TYPE_RSS_094 RSS 0.94. * @see \SimplePie\SimplePie::TYPE_RSS_10 RSS 1.0. * @see \SimplePie\SimplePie::TYPE_RSS_20 RSS 2.0.x. * @see \SimplePie\SimplePie::TYPE_RSS_RDF RDF-based RSS. * @see \SimplePie\SimplePie::TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format). * @see \SimplePie\SimplePie::TYPE_RSS_ALL Any version of RSS. * @see \SimplePie\SimplePie::TYPE_ATOM_03 Atom 0.3. * @see \SimplePie\SimplePie::TYPE_ATOM_10 Atom 1.0. * @see \SimplePie\SimplePie::TYPE_ATOM_ALL Any version of Atom. * @see \SimplePie\SimplePie::TYPE_ALL Any known/supported feed type. * @return int \SimplePie\SimplePie::TYPE_* constant */ public function get_type() { } /** * Get the URL for the feed * * When the 'permanent' mode is enabled, returns the original feed URL, * except in the case of an `HTTP 301 Moved Permanently` status response, * in which case the location of the first redirection is returned. * * When the 'permanent' mode is disabled (default), * may or may not be different from the URL passed to {@see set_feed_url()}, * depending on whether auto-discovery was used, and whether there were * any redirects along the way. * * @since Preview Release (previously called `get_feed_url()` since SimplePie 0.8.) * @todo Support * @todo Also, |atom:link|@rel=self * @param bool $permanent Permanent mode to return only the original URL or the first redirection * iff it is a 301 redirection * @return string|null */ public function subscribe_url($permanent = false) { } /** * Get data for an feed-level element * * This method allows you to get access to ANY element/attribute that is a * sub-element of the opening feed tag. * * The return value is an indexed array of elements matching the given * namespace and tag name. Each element has `attribs`, `data` and `child` * subkeys. For `attribs` and `child`, these contain namespace subkeys. * `attribs` then has one level of associative name => value data (where * `value` is a string) after the namespace. `child` has tag-indexed keys * after the namespace, each member of which is an indexed array matching * this same format. * * For example: *
         * // This is probably a bad example because we already support
         * //  natively, but it shows you how to parse through
         * // the nodes.
         * $group = $item->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'group');
         * $content = $group[0]['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['content'];
         * $file = $content[0]['attribs']['']['url'];
         * echo $file;
         * 
* * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_feed_tags($namespace, $tag) { } /** * Get data for an channel-level element * * This method allows you to get access to ANY element/attribute in the * channel/header section of the feed. * * See {@see SimplePie::get_feed_tags()} for a description of the return value * * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_channel_tags($namespace, $tag) { } /** * Get data for an channel-level element * * This method allows you to get access to ANY element/attribute in the * image/logo section of the feed. * * See {@see SimplePie::get_feed_tags()} for a description of the return value * * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_image_tags($namespace, $tag) { } /** * Get the base URL value from the feed * * Uses `` if available, otherwise uses the first link in the * feed, or failing that, the URL of the feed itself. * * @see get_link * @see subscribe_url * * @param array $element * @return string */ public function get_base($element = []) { } /** * Sanitize feed data * * @access private * @see \SimplePie\Sanitize::sanitize() * @param string $data Data to sanitize * @param int $type One of the \SimplePie\SimplePie::CONSTRUCT_* constants * @param string $base Base URL to resolve URLs against * @return string Sanitized data */ public function sanitize($data, $type, $base = '') { } /** * Get the title of the feed * * Uses ``, `` or `<dc:title>` * * @since 1.0 (previously called `get_feed_title` since 0.8) * @return string|null */ public function get_title() { } /** * Get a category for the feed * * @since Unknown * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Category|null */ public function get_category($key = 0) { } /** * Get all categories for the feed * * Uses `<atom:category>`, `<category>` or `<dc:subject>` * * @since Unknown * @return array|null List of {@see \SimplePie\Category} objects */ public function get_categories() { } /** * Get an author for the feed * * @since 1.1 * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Author|null */ public function get_author($key = 0) { } /** * Get all authors for the feed * * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>` * * @since 1.1 * @return array|null List of {@see \SimplePie\Author} objects */ public function get_authors() { } /** * Get a contributor for the feed * * @since 1.1 * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Author|null */ public function get_contributor($key = 0) { } /** * Get all contributors for the feed * * Uses `<atom:contributor>` * * @since 1.1 * @return array|null List of {@see \SimplePie\Author} objects */ public function get_contributors() { } /** * Get a single link for the feed * * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8) * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1 * @param string $rel The relationship of the link to return * @return string|null Link URL */ public function get_link($key = 0, $rel = 'alternate') { } /** * Get the permalink for the item * * Returns the first link available with a relationship of "alternate". * Identical to {@see get_link()} with key 0 * * @see get_link * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8) * @internal Added for parity between the parent-level and the item/entry-level. * @return string|null Link URL */ public function get_permalink() { } /** * Get all links for the feed * * Uses `<atom:link>` or `<link>` * * @since Beta 2 * @param string $rel The relationship of links to return * @return array|null Links found for the feed (strings) */ public function get_links($rel = 'alternate') { } public function get_all_discovered_feeds() { } /** * Get the content for the item * * Uses `<atom:subtitle>`, `<atom:tagline>`, `<description>`, * `<dc:description>`, `<itunes:summary>` or `<itunes:subtitle>` * * @since 1.0 (previously called `get_feed_description()` since 0.8) * @return string|null */ public function get_description() { } /** * Get the copyright info for the feed * * Uses `<atom:rights>`, `<atom:copyright>` or `<dc:rights>` * * @since 1.0 (previously called `get_feed_copyright()` since 0.8) * @return string|null */ public function get_copyright() { } /** * Get the language for the feed * * Uses `<language>`, `<dc:language>`, or @xml_lang * * @since 1.0 (previously called `get_feed_language()` since 0.8) * @return string|null */ public function get_language() { } /** * Get the latitude coordinates for the item * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:lat>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_latitude() { } /** * Get the longitude coordinates for the feed * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_longitude() { } /** * Get the feed logo's title * * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" title. * * Uses `<image><title>` or `<image><dc:title>` * * @return string|null */ public function get_image_title() { } /** * Get the feed logo's URL * * RSS 0.9.0, 2.0, Atom 1.0, and feeds with iTunes RSS tags are allowed to * have a "feed logo" URL. This points directly to the image itself. * * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`, * `<image><title>` or `<image><dc:title>` * * @return string|null */ public function get_image_url() { } /** * Get the feed logo's link * * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" link. This * points to a human-readable page that the image should link to. * * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`, * `<image><title>` or `<image><dc:title>` * * @return string|null */ public function get_image_link() { } /** * Get the feed logo's link * * RSS 2.0 feeds are allowed to have a "feed logo" width. * * Uses `<image><width>` or defaults to 88 if no width is specified and * the feed is an RSS 2.0 feed. * * @return int|null */ public function get_image_width() { } /** * Get the feed logo's height * * RSS 2.0 feeds are allowed to have a "feed logo" height. * * Uses `<image><height>` or defaults to 31 if no height is specified and * the feed is an RSS 2.0 feed. * * @return int|null */ public function get_image_height() { } /** * Get the number of items in the feed * * This is well-suited for {@link http://php.net/for for()} loops with * {@see get_item()} * * @param int $max Maximum value to return. 0 for no limit * @return int Number of items in the feed */ public function get_item_quantity($max = 0) { } /** * Get a single item from the feed * * This is better suited for {@link http://php.net/for for()} loops, whereas * {@see get_items()} is better suited for * {@link http://php.net/foreach foreach()} loops. * * @see get_item_quantity() * @since Beta 2 * @param int $key The item that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Item|null */ public function get_item($key = 0) { } /** * Get all items from the feed * * This is better suited for {@link http://php.net/for for()} loops, whereas * {@see get_items()} is better suited for * {@link http://php.net/foreach foreach()} loops. * * @see get_item_quantity * @since Beta 2 * @param int $start Index to start at * @param int $end Number of items to return. 0 for all items after `$start` * @return \SimplePie\Item[]|null List of {@see \SimplePie\Item} objects */ public function get_items($start = 0, $end = 0) { } /** * Set the favicon handler * * @deprecated Use your own favicon handling instead */ public function set_favicon_handler($page = false, $qs = 'i') { } /** * Get the favicon for the current feed * * @deprecated Use your own favicon handling instead */ public function get_favicon() { } /** * Magic method handler * * @param string $method Method name * @param array $args Arguments to the method * @return mixed */ public function __call($method, $args) { } /** * Sorting callback for items * * @access private * @param SimplePie $a * @param SimplePie $b * @return boolean */ public static function sort_items($a, $b) { } /** * Merge items from several feeds into one * * If you're merging multiple feeds together, they need to all have dates * for the items or else SimplePie will refuse to sort them. * * @link http://simplepie.org/wiki/tutorial/sort_multiple_feeds_by_time_and_date#if_feeds_require_separate_per-feed_settings * @param array $urls List of SimplePie feed objects to merge * @param int $start Starting item * @param int $end Number of items to return * @param int $limit Maximum number of items per feed * @return array */ public static function merge_items($urls, $start = 0, $end = 0, $limit = 0) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\SimplePie" instead */ class SimplePie extends \SimplePie\SimplePie { } } namespace SimplePie { /** * Manages all author-related data * * Used by {@see Item::get_author()} and {@see SimplePie::get_authors()} * * This class can be overloaded with {@see SimplePie::set_author_class()} * * @package SimplePie * @subpackage API */ class Author { /** * Author's name * * @var string * @see get_name() */ public $name; /** * Author's link * * @var string * @see get_link() */ public $link; /** * Author's email address * * @var string * @see get_email() */ public $email; /** * Constructor, used to input the data * * @param string $name * @param string $link * @param string $email */ public function __construct($name = null, $link = null, $email = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Author's name * * @return string|null */ public function get_name() { } /** * Author's link * * @return string|null */ public function get_link() { } /** * Author's email address * * @return string|null */ public function get_email() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Author" instead */ class SimplePie_Author extends \SimplePie\Author { } } namespace SimplePie { /** * Used to create cache objects * * This class can be overloaded with {@see SimplePie::set_cache_class()}, * although the preferred way is to create your own handler * via {@see register()} * * @package SimplePie * @subpackage Caching * @deprecated since SimplePie 1.8.0, use "SimplePie\SimplePie::set_cache()" instead */ class Cache { /** * Cache handler classes * * These receive 3 parameters to their constructor, as documented in * {@see register()} * @var array */ protected static $handlers = ['mysql' => 'SimplePie\\Cache\\MySQL', 'memcache' => 'SimplePie\\Cache\\Memcache', 'memcached' => 'SimplePie\\Cache\\Memcached', 'redis' => 'SimplePie\\Cache\\Redis']; /** * Create a new SimplePie\Cache object * * @param string $location URL location (scheme is used to determine handler) * @param string $filename Unique identifier for cache object * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 'spi' or 'spc' * @return Base Type of object depends on scheme of `$location` */ public static function get_handler($location, $filename, $extension) { } /** * Create a new SimplePie\Cache object * * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead */ public function create($location, $filename, $extension) { } /** * Register a handler * * @param string $type DSN type to register for * @param class-string<Base> $class Name of handler class. Must implement Base */ public static function register($type, $class) { } /** * Parse a URL into an array * * @param string $url * @return array */ public static function parse_URL($url) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache" instead */ class SimplePie_Cache extends \SimplePie\Cache { } } namespace SimplePie\Cache { /** * Base for cache objects * * Classes to be used with {@see \SimplePie\Cache::register()} are expected * to implement this interface. * * @package SimplePie * @subpackage Caching * @deprecated since SimplePie 1.8.0, use "Psr\SimpleCache\CacheInterface" instead */ interface Base { /** * Feed cache type * * @var string */ public const TYPE_FEED = 'spc'; /** * Image cache type * * @var string */ public const TYPE_IMAGE = 'spi'; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type); /** * Save data to the cache * * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data); /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load(); /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime(); /** * Set the last modified time to the current time * * @return bool Success status */ public function touch(); /** * Remove the cache * * @return bool Success status */ public function unlink(); } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Base" instead */ interface SimplePie_Cache_Base extends \SimplePie\Cache\Base { } } namespace SimplePie\Cache { /** * Base class for database-based caches * * @package SimplePie * @subpackage Caching * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead */ abstract class DB implements \SimplePie\Cache\Base { /** * Helper for database conversion * * Converts a given {@see SimplePie} object into data to be stored * * @param \SimplePie\SimplePie $data * @return array First item is the serialized data for storage, second item is the unique ID for this item */ protected static function prepare_simplepie_object_for_cache($data) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\DB" instead */ abstract class SimplePie_Cache_DB extends \SimplePie\Cache\DB { } } namespace SimplePie\Cache { /** * Caches data to the filesystem * * @package SimplePie * @subpackage Caching * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead */ class File implements \SimplePie\Cache\Base { /** * Location string * * @see SimplePie::$cache_location * @var string */ protected $location; /** * Filename * * @var string */ protected $filename; /** * File extension * * @var string */ protected $extension; /** * File path * * @var string */ protected $name; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type) { } /** * Save data to the cache * * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { } /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load() { } /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime() { } /** * Set the last modified time to the current time * * @return bool Success status */ public function touch() { } /** * Remove the cache * * @return bool Success status */ public function unlink() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\File" instead */ class SimplePie_Cache_File extends \SimplePie\Cache\File { } } namespace SimplePie\Cache { /** * Caches data to memcache * * Registered for URLs with the "memcache" protocol * * For example, `memcache://localhost:11211/?timeout=3600&prefix=sp_` will * connect to memcache on `localhost` on port 11211. All tables will be * prefixed with `sp_` and data will expire after 3600 seconds * * @package SimplePie * @subpackage Caching * @uses Memcache * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead */ class Memcache implements \SimplePie\Cache\Base { /** * Memcache instance * * @var Memcache */ protected $cache; /** * Options * * @var array */ protected $options; /** * Cache name * * @var string */ protected $name; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type) { } /** * Save data to the cache * * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { } /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load() { } /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime() { } /** * Set the last modified time to the current time * * @return bool Success status */ public function touch() { } /** * Remove the cache * * @return bool Success status */ public function unlink() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Memcache" instead */ class SimplePie_Cache_Memcache extends \SimplePie\Cache\Memcache { } } namespace SimplePie\Cache { /** * Caches data to memcached * * Registered for URLs with the "memcached" protocol * * For example, `memcached://localhost:11211/?timeout=3600&prefix=sp_` will * connect to memcached on `localhost` on port 11211. All tables will be * prefixed with `sp_` and data will expire after 3600 seconds * * @package SimplePie * @subpackage Caching * @author Paul L. McNeely * @uses Memcached * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead */ class Memcached implements \SimplePie\Cache\Base { /** * NativeMemcached instance * @var NativeMemcached */ protected $cache; /** * Options * @var array */ protected $options; /** * Cache name * @var string */ protected $name; /** * Create a new cache object * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $type) { } /** * Save data to the cache * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { } /** * Retrieve the data saved to the cache * @return array Data for SimplePie::$data */ public function load() { } /** * Retrieve the last modified time for the cache * @return int Timestamp */ public function mtime() { } /** * Set the last modified time to the current time * @return bool Success status */ public function touch() { } /** * Remove the cache * @return bool Success status */ public function unlink() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Memcached" instead */ class SimplePie_Cache_Memcached extends \SimplePie\Cache\Memcached { } } namespace SimplePie\Cache { /** * Caches data to a MySQL database * * Registered for URLs with the "mysql" protocol * * For example, `mysql://root:password@localhost:3306/mydb?prefix=sp_` will * connect to the `mydb` database on `localhost` on port 3306, with the user * `root` and the password `password`. All tables will be prefixed with `sp_` * * @package SimplePie * @subpackage Caching * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead */ class MySQL extends \SimplePie\Cache\DB { /** * PDO instance * * @var \PDO */ protected $mysql; /** * Options * * @var array */ protected $options; /** * Cache ID * * @var string */ protected $id; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data * @phpstan-return void */ public function __construct($location, $name, $type) { } /** * Save data to the cache * * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { } /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load() { } /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime() { } /** * Set the last modified time to the current time * * @return bool Success status */ public function touch() { } /** * Remove the cache * * @return bool Success status */ public function unlink() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\MySQL" instead */ class SimplePie_Cache_MySQL extends \SimplePie\Cache\MySQL { } } namespace SimplePie\Cache { /** * Caches data to redis * * Registered for URLs with the "redis" protocol * * For example, `redis://localhost:6379/?timeout=3600&prefix=sp_&dbIndex=0` will * connect to redis on `localhost` on port 6379. All tables will be * prefixed with `simple_primary-` and data will expire after 3600 seconds * * @package SimplePie * @subpackage Caching * @uses Redis * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead */ class Redis implements \SimplePie\Cache\Base { /** * Redis instance * * @var NativeRedis */ protected $cache; /** * Options * * @var array */ protected $options; /** * Cache name * * @var string */ protected $name; /** * Create a new cache object * * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data */ public function __construct($location, $name, $options = null) { } /** * @param NativeRedis $cache */ public function setRedisClient(\Redis $cache) { } /** * Save data to the cache * * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property * @return bool Successfulness */ public function save($data) { } /** * Retrieve the data saved to the cache * * @return array Data for SimplePie::$data */ public function load() { } /** * Retrieve the last modified time for the cache * * @return int Timestamp */ public function mtime() { } /** * Set the last modified time to the current time * * @return bool Success status */ public function touch() { } /** * Remove the cache * * @return bool Success status */ public function unlink() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Redis" instead */ class SimplePie_Cache_Redis extends \SimplePie\Cache\Redis { } } namespace SimplePie { /** * Handles `<media:text>` captions as defined in Media RSS. * * Used by {@see \SimplePie\Enclosure::get_caption()} and {@see \SimplePie\Enclosure::get_captions()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_caption_class()} * * @package SimplePie * @subpackage API */ class Caption { /** * Content type * * @var string * @see get_type() */ public $type; /** * Language * * @var string * @see get_language() */ public $lang; /** * Start time * * @var string * @see get_starttime() */ public $startTime; /** * End time * * @var string * @see get_endtime() */ public $endTime; /** * Caption text * * @var string * @see get_text() */ public $text; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Get the end time * * @return string|null Time in the format 'hh:mm:ss.SSS' */ public function get_endtime() { } /** * Get the language * * @link http://tools.ietf.org/html/rfc3066 * @return string|null Language code as per RFC 3066 */ public function get_language() { } /** * Get the start time * * @return string|null Time in the format 'hh:mm:ss.SSS' */ public function get_starttime() { } /** * Get the text of the caption * * @return string|null */ public function get_text() { } /** * Get the content type (not MIME type) * * @return string|null Either 'text' or 'html' */ public function get_type() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Caption" instead */ class SimplePie_Caption extends \SimplePie\Caption { } } namespace SimplePie { /** * Manages all category-related data * * Used by {@see \SimplePie\Item::get_category()} and {@see \SimplePie\Item::get_categories()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_category_class()} * * @package SimplePie * @subpackage API */ class Category { /** * Category identifier * * @var string|null * @see get_term */ public $term; /** * Categorization scheme identifier * * @var string|null * @see get_scheme() */ public $scheme; /** * Human readable label * * @var string|null * @see get_label() */ public $label; /** * Category type * * category for <category> * subject for <dc:subject> * * @var string|null * @see get_type() */ public $type; /** * Constructor, used to input the data * * @param string|null $term * @param string|null $scheme * @param string|null $label * @param string|null $type */ public function __construct($term = null, $scheme = null, $label = null, $type = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Get the category identifier * * @return string|null */ public function get_term() { } /** * Get the categorization scheme identifier * * @return string|null */ public function get_scheme() { } /** * Get the human readable label * * @param bool $strict * @return string|null */ public function get_label($strict = false) { } /** * Get the category type * * @return string|null */ public function get_type() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Category" instead */ class SimplePie_Category extends \SimplePie\Category { } } namespace SimplePie\Content\Type { /** * Content-type sniffing * * Based on the rules in http://tools.ietf.org/html/draft-abarth-mime-sniff-06 * * This is used since we can't always trust Content-Type headers, and is based * upon the HTML5 parsing rules. * * * This class can be overloaded with {@see \SimplePie\SimplePie::set_content_type_sniffer_class()} * * @package SimplePie * @subpackage HTTP */ class Sniffer { /** * File object * * @var \SimplePie\File */ public $file; /** * Create an instance of the class with the input file * * @param Sniffer $file Input file */ public function __construct($file) { } /** * Get the Content-Type of the specified file * * @return string Actual Content-Type */ public function get_type() { } /** * Sniff text or binary * * @return string Actual Content-Type */ public function text_or_binary() { } /** * Sniff unknown * * @return string Actual Content-Type */ public function unknown() { } /** * Sniff images * * @return string Actual Content-Type */ public function image() { } /** * Sniff HTML * * @return string Actual Content-Type */ public function feed_or_html() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Content\Type\Sniffer" instead */ class SimplePie_Content_Type_Sniffer extends \SimplePie\Content\Type\Sniffer { } } namespace SimplePie { /** * Manages `<media:copyright>` copyright tags as defined in Media RSS * * Used by {@see \SimplePie\Enclosure::get_copyright()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_copyright_class()} * * @package SimplePie * @subpackage API */ class Copyright { /** * Copyright URL * * @var string * @see get_url() */ public $url; /** * Attribution * * @var string * @see get_attribution() */ public $label; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($url = null, $label = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Get the copyright URL * * @return string|null URL to copyright information */ public function get_url() { } /** * Get the attribution text * * @return string|null */ public function get_attribution() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Copyright" instead */ class SimplePie_Copyright extends \SimplePie\Copyright { } /** * SimplePie class. * * Class for backward compatibility. * * @deprecated Use {@see SimplePie} directly * @package SimplePie * @subpackage API */ class SimplePie_Core extends \SimplePie { } } namespace SimplePie { /** * Handles `<media:credit>` as defined in Media RSS * * Used by {@see \SimplePie\Enclosure::get_credit()} and {@see \SimplePie\Enclosure::get_credits()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_credit_class()} * * @package SimplePie * @subpackage API */ class Credit { /** * Credited role * * @var string * @see get_role() */ public $role; /** * Organizational scheme * * @var string * @see get_scheme() */ public $scheme; /** * Credited name * * @var string * @see get_name() */ public $name; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($role = null, $scheme = null, $name = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Get the role of the person receiving credit * * @return string|null */ public function get_role() { } /** * Get the organizational scheme * * @return string|null */ public function get_scheme() { } /** * Get the credited person/entity's name * * @return string|null */ public function get_name() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Credit" instead */ class SimplePie_Credit extends \SimplePie\Credit { } /** * Decode HTML Entities * * This implements HTML5 as of revision 967 (2007-06-28) * * @deprecated Use DOMDocument instead! * @package SimplePie */ class SimplePie_Decode_HTML_Entities { /** * Data to be parsed * * @access private * @var string */ public $data = ''; /** * Currently consumed bytes * * @access private * @var string */ public $consumed = ''; /** * Position of the current byte being parsed * * @access private * @var int */ public $position = 0; /** * Create an instance of the class with the input data * * @access public * @param string $data Input data */ public function __construct($data) { } /** * Parse the input data * * @access public * @return string Output data */ public function parse() { } /** * Consume the next byte * * @access private * @return mixed The next byte, or false, if there is no more data */ public function consume() { } /** * Consume a range of characters * * @access private * @param string $chars Characters to consume * @return mixed A series of characters that match the range, or false */ public function consume_range($chars) { } /** * Unconsume one byte * * @access private */ public function unconsume() { } /** * Decode an entity * * @access private */ public function entity() { } } } namespace SimplePie { /** * Handles everything related to enclosures (including Media RSS and iTunes RSS) * * Used by {@see \SimplePie\Item::get_enclosure()} and {@see \SimplePie\Item::get_enclosures()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_enclosure_class()} * * @package SimplePie * @subpackage API */ class Enclosure { /** * @var string * @see get_bitrate() */ public $bitrate; /** * @var array * @see get_captions() */ public $captions; /** * @var array * @see get_categories() */ public $categories; /** * @var int * @see get_channels() */ public $channels; /** * @var \SimplePie\Copyright * @see get_copyright() */ public $copyright; /** * @var array * @see get_credits() */ public $credits; /** * @var string * @see get_description() */ public $description; /** * @var int * @see get_duration() */ public $duration; /** * @var string * @see get_expression() */ public $expression; /** * @var string * @see get_framerate() */ public $framerate; /** * @var string * @see get_handler() */ public $handler; /** * @var array * @see get_hashes() */ public $hashes; /** * @var string * @see get_height() */ public $height; /** * @deprecated * @var null */ public $javascript; /** * @var array * @see get_keywords() */ public $keywords; /** * @var string * @see get_language() */ public $lang; /** * @var string * @see get_length() */ public $length; /** * @var string * @see get_link() */ public $link; /** * @var string * @see get_medium() */ public $medium; /** * @var string * @see get_player() */ public $player; /** * @var array * @see get_ratings() */ public $ratings; /** * @var array * @see get_restrictions() */ public $restrictions; /** * @var string * @see get_sampling_rate() */ public $samplingrate; /** * @var array * @see get_thumbnails() */ public $thumbnails; /** * @var string * @see get_title() */ public $title; /** * @var string * @see get_type() */ public $type; /** * @var string * @see get_width() */ public $width; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors * * @uses idna_convert If available, this will convert an IDN */ public function __construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Get the bitrate * * @return string|null */ public function get_bitrate() { } /** * Get a single caption * * @param int $key * @return \SimplePie\Caption|null */ public function get_caption($key = 0) { } /** * Get all captions * * @return array|null Array of {@see \SimplePie\Caption} objects */ public function get_captions() { } /** * Get a single category * * @param int $key * @return \SimplePie\Category|null */ public function get_category($key = 0) { } /** * Get all categories * * @return array|null Array of {@see \SimplePie\Category} objects */ public function get_categories() { } /** * Get the number of audio channels * * @return int|null */ public function get_channels() { } /** * Get the copyright information * * @return \SimplePie\Copyright|null */ public function get_copyright() { } /** * Get a single credit * * @param int $key * @return \SimplePie\Credit|null */ public function get_credit($key = 0) { } /** * Get all credits * * @return array|null Array of {@see \SimplePie\Credit} objects */ public function get_credits() { } /** * Get the description of the enclosure * * @return string|null */ public function get_description() { } /** * Get the duration of the enclosure * * @param bool $convert Convert seconds into hh:mm:ss * @return string|int|null 'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found) */ public function get_duration($convert = false) { } /** * Get the expression * * @return string Probably one of 'sample', 'full', 'nonstop', 'clip'. Defaults to 'full' */ public function get_expression() { } /** * Get the file extension * * @return string|null */ public function get_extension() { } /** * Get the framerate (in frames-per-second) * * @return string|null */ public function get_framerate() { } /** * Get the preferred handler * * @return string|null One of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3' */ public function get_handler() { } /** * Get a single hash * * @link http://www.rssboard.org/media-rss#media-hash * @param int $key * @return string|null Hash as per `media:hash`, prefixed with "$algo:" */ public function get_hash($key = 0) { } /** * Get all credits * * @return array|null Array of strings, see {@see get_hash()} */ public function get_hashes() { } /** * Get the height * * @return string|null */ public function get_height() { } /** * Get the language * * @link http://tools.ietf.org/html/rfc3066 * @return string|null Language code as per RFC 3066 */ public function get_language() { } /** * Get a single keyword * * @param int $key * @return string|null */ public function get_keyword($key = 0) { } /** * Get all keywords * * @return array|null Array of strings */ public function get_keywords() { } /** * Get length * * @return float Length in bytes */ public function get_length() { } /** * Get the URL * * @return string|null */ public function get_link() { } /** * Get the medium * * @link http://www.rssboard.org/media-rss#media-content * @return string|null Should be one of 'image', 'audio', 'video', 'document', 'executable' */ public function get_medium() { } /** * Get the player URL * * Typically the same as {@see get_permalink()} * @return string|null Player URL */ public function get_player() { } /** * Get a single rating * * @param int $key * @return \SimplePie\Rating|null */ public function get_rating($key = 0) { } /** * Get all ratings * * @return array|null Array of {@see \SimplePie\Rating} objects */ public function get_ratings() { } /** * Get a single restriction * * @param int $key * @return \SimplePie\Restriction|null */ public function get_restriction($key = 0) { } /** * Get all restrictions * * @return array|null Array of {@see \SimplePie\Restriction} objects */ public function get_restrictions() { } /** * Get the sampling rate (in kHz) * * @return string|null */ public function get_sampling_rate() { } /** * Get the file size (in MiB) * * @return float|null File size in mebibytes (1048 bytes) */ public function get_size() { } /** * Get a single thumbnail * * @param int $key * @return string|null Thumbnail URL */ public function get_thumbnail($key = 0) { } /** * Get all thumbnails * * @return array|null Array of thumbnail URLs */ public function get_thumbnails() { } /** * Get the title * * @return string|null */ public function get_title() { } /** * Get mimetype of the enclosure * * @see get_real_type() * @return string|null MIME type */ public function get_type() { } /** * Get the width * * @return string|null */ public function get_width() { } /** * Embed the enclosure using `<embed>` * * @deprecated Use the second parameter to {@see embed} instead * * @param array|string $options See first parameter to {@see embed} * @return string HTML string to output */ public function native_embed($options = '') { } /** * Embed the enclosure using Javascript * * `$options` is an array or comma-separated key:value string, with the * following properties: * * - `alt` (string): Alternate content for when an end-user does not have * the appropriate handler installed or when a file type is * unsupported. Can be any text or HTML. Defaults to blank. * - `altclass` (string): If a file type is unsupported, the end-user will * see the alt text (above) linked directly to the content. That link * will have this value as its class name. Defaults to blank. * - `audio` (string): This is an image that should be used as a * placeholder for audio files before they're loaded (QuickTime-only). * Can be any relative or absolute URL. Defaults to blank. * - `bgcolor` (string): The background color for the media, if not * already transparent. Defaults to `#ffffff`. * - `height` (integer): The height of the embedded media. Accepts any * numeric pixel value (such as `360`) or `auto`. Defaults to `auto`, * and it is recommended that you use this default. * - `loop` (boolean): Do you want the media to loop when it's done? * Defaults to `false`. * - `mediaplayer` (string): The location of the included * `mediaplayer.swf` file. This allows for the playback of Flash Video * (`.flv`) files, and is the default handler for non-Odeo MP3's. * Defaults to blank. * - `video` (string): This is an image that should be used as a * placeholder for video files before they're loaded (QuickTime-only). * Can be any relative or absolute URL. Defaults to blank. * - `width` (integer): The width of the embedded media. Accepts any * numeric pixel value (such as `480`) or `auto`. Defaults to `auto`, * and it is recommended that you use this default. * - `widescreen` (boolean): Is the enclosure widescreen or standard? * This applies only to video enclosures, and will automatically resize * the content appropriately. Defaults to `false`, implying 4:3 mode. * * Note: Non-widescreen (4:3) mode with `width` and `height` set to `auto` * will default to 480x360 video resolution. Widescreen (16:9) mode with * `width` and `height` set to `auto` will default to 480x270 video resolution. * * @todo If the dimensions for media:content are defined, use them when width/height are set to 'auto'. * @param array|string $options Comma-separated key:value list, or array * @param bool $native Use `<embed>` * @return string HTML string to output */ public function embed($options = '', $native = false) { } /** * Get the real media type * * Often, feeds lie to us, necessitating a bit of deeper inspection. This * converts types to their canonical representations based on the file * extension * * @see get_type() * @param bool $find_handler Internal use only, use {@see get_handler()} instead * @return string MIME type */ public function get_real_type($find_handler = false) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Enclosure" instead */ class SimplePie_Enclosure extends \SimplePie\Enclosure { } } namespace SimplePie { /** * General SimplePie exception class * * @package SimplePie */ class Exception extends \Exception { } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Exception" instead */ class SimplePie_Exception extends \SimplePie\Exception { } } namespace SimplePie { /** * Used for fetching remote files and reading local files * * Supports HTTP 1.0 via cURL or fsockopen, with spotty HTTP 1.1 support * * This class can be overloaded with {@see \SimplePie\SimplePie::set_file_class()} * * @package SimplePie * @subpackage HTTP * @todo Move to properly supporting RFC2616 (HTTP/1.1) */ class File { public $url; public $useragent; public $success = true; public $headers = []; public $body; public $status_code = 0; public $redirects = 0; public $error; public $method = \SimplePie\SimplePie::FILE_SOURCE_NONE; public $permanent_url; public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false, $curl_options = []) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\File" instead */ class SimplePie_File extends \SimplePie\File { } } namespace SimplePie\HTTP { /** * HTTP Response Parser * * @package SimplePie * @subpackage HTTP */ class Parser { /** * HTTP Version * * @var float */ public $http_version = 0.0; /** * Status code * * @var int */ public $status_code = 0; /** * Reason phrase * * @var string */ public $reason = ''; /** * Key/value pairs of the headers * * @var array */ public $headers = []; /** * Body of the response * * @var string */ public $body = ''; /** * Current state of the state machine * * @var self::STATE_* */ protected $state = self::STATE_HTTP_VERSION; /** * Input data * * @var string */ protected $data = ''; /** * Input data length (to avoid calling strlen() everytime this is needed) * * @var int */ protected $data_length = 0; /** * Current position of the pointer * * @var int */ protected $position = 0; /** * Name of the hedaer currently being parsed * * @var string */ protected $name = ''; /** * Value of the hedaer currently being parsed * * @var string */ protected $value = ''; /** * Create an instance of the class with the input data * * @param string $data Input data */ public function __construct($data) { } /** * Parse the input data * * @return bool true on success, false on failure */ public function parse() { } /** * Check whether there is data beyond the pointer * * @return bool true if there is further data, false if not */ protected function has_data() { } /** * See if the next character is LWS * * @return bool true if the next character is LWS, false if not */ protected function is_linear_whitespace() { } /** * Parse the HTTP version */ protected function http_version() { } /** * Parse the status code */ protected function status() { } /** * Parse the reason phrase */ protected function reason() { } /** * Deal with a new line, shifting data around as needed */ protected function new_line() { } /** * Parse a header name */ protected function name() { } /** * Parse LWS, replacing consecutive LWS characters with a single space */ protected function linear_whitespace() { } /** * See what state to move to while within non-quoted header values */ protected function value() { } /** * Parse a header value while outside quotes */ protected function value_char() { } /** * See what state to move to while within quoted header values */ protected function quote() { } /** * Parse a header value while within quotes */ protected function quote_char() { } /** * Parse an escaped character within quotes */ protected function quote_escaped() { } /** * Parse the body */ protected function body() { } /** * Parsed a "Transfer-Encoding: chunked" body * @phpstan-return void */ protected function chunked() { } /** * Prepare headers (take care of proxies headers) * * @param string $headers Raw headers * @param integer $count Redirection count. Default to 1. * * @return string */ public static function prepareHeaders($headers, $count = 1) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\HTTP\Parser" instead */ class SimplePie_HTTP_Parser extends \SimplePie\HTTP\Parser { } } namespace SimplePie { /** * IRI parser/serialiser/normaliser * * @package SimplePie * @subpackage HTTP * @author Sam Sneddon * @author Steve Minutillo * @author Ryan McCue * @copyright 2007-2012 Sam Sneddon, Steve Minutillo, Ryan McCue * @license http://www.opensource.org/licenses/bsd-license.php */ class IRI { /** * Scheme * * @var string */ protected $scheme = null; /** * User Information * * @var string */ protected $iuserinfo = null; /** * ihost * * @var string */ protected $ihost = null; /** * Port * * @var string */ protected $port = null; /** * ipath * * @var string */ protected $ipath = ''; /** * iquery * * @var string */ protected $iquery = null; /** * ifragment * * @var string */ protected $ifragment = null; /** * Normalization database * * Each key is the scheme, each value is an array with each key as the IRI * part and value as the default value for that part. */ protected $normalization = ['acap' => ['port' => 674], 'dict' => ['port' => 2628], 'file' => ['ihost' => 'localhost'], 'http' => ['port' => 80, 'ipath' => '/'], 'https' => ['port' => 443, 'ipath' => '/']]; /** * Return the entire IRI when you try and read the object as a string * * @return string */ public function __toString() { } /** * Overload __set() to provide access via properties * * @param string $name Property name * @param mixed $value Property value */ public function __set($name, $value) { } /** * Overload __get() to provide access via properties * * @param string $name Property name * @return mixed */ public function __get($name) { } /** * Overload __isset() to provide access via properties * * @param string $name Property name * @return bool */ public function __isset($name) { } /** * Overload __unset() to provide access via properties * * @param string $name Property name */ public function __unset($name) { } /** * Create a new IRI object, from a specified string * * @param string $iri */ public function __construct($iri = null) { } /** * Clean up */ public function __destruct() { } /** * Create a new IRI object by resolving a relative IRI * * Returns false if $base is not absolute, otherwise an IRI. * * @param IRI|string $base (Absolute) Base IRI * @param IRI|string $relative Relative IRI * @return IRI|false */ public static function absolutize($base, $relative) { } /** * Parse an IRI into scheme/authority/path/query/fragment segments * * @param string $iri * @return array */ protected function parse_iri($iri) { } /** * Remove dot segments from a path * * @param string $input * @return string */ protected function remove_dot_segments($input) { } /** * Replace invalid character with percent encoding * * @param string $string Input string * @param string $extra_chars Valid characters not in iunreserved or * iprivate (this is ASCII-only) * @param bool $iprivate Allow iprivate * @return string */ protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false) { } /** * Callback function for preg_replace_callback. * * Removes sequences of percent encoded bytes that represent UTF-8 * encoded characters in iunreserved * * @param array $match PCRE match * @return string Replacement */ protected function remove_iunreserved_percent_encoded($match) { } protected function scheme_normalization() { } /** * Check if the object represents a valid IRI. This needs to be done on each * call as some things change depending on another part of the IRI. * * @return bool */ public function is_valid() { } /** * Set the entire IRI. Returns true on success, false on failure (if there * are any invalid characters). * * @param string $iri * @return bool */ public function set_iri($iri, $clear_cache = false) { } /** * Set the scheme. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $scheme * @return bool */ public function set_scheme($scheme) { } /** * Set the authority. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $authority * @return bool */ public function set_authority($authority, $clear_cache = false) { } /** * Set the iuserinfo. * * @param string $iuserinfo * @return bool */ public function set_userinfo($iuserinfo) { } /** * Set the ihost. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $ihost * @return bool */ public function set_host($ihost) { } /** * Set the port. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $port * @return bool */ public function set_port($port) { } /** * Set the ipath. * * @param string $ipath * @return bool */ public function set_path($ipath, $clear_cache = false) { } /** * Set the iquery. * * @param string $iquery * @return bool */ public function set_query($iquery) { } /** * Set the ifragment. * * @param string $ifragment * @return bool */ public function set_fragment($ifragment) { } /** * Convert an IRI to a URI (or parts thereof) * * @return string */ public function to_uri($string) { } /** * Get the complete IRI * * @return string */ public function get_iri() { } /** * Get the complete URI * * @return string */ public function get_uri() { } /** * Get the complete iauthority * * @return string */ protected function get_iauthority() { } /** * Get the complete authority * * @return string */ protected function get_authority() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\IRI" instead */ class SimplePie_IRI extends \SimplePie\IRI { } } namespace SimplePie { /** * Handles the injection of Registry into other class * * {@see \SimplePie\SimplePie::get_registry()} * * @package SimplePie */ interface RegistryAware { /** * Set the Registry into the class * * @param Registry $registry * * @return void */ public function set_registry(\SimplePie\Registry $registry); } /** * Manages all item-related data * * Used by {@see \SimplePie\SimplePie::get_item()} and {@see \SimplePie\SimplePie::get_items()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_item_class()} * * @package \SimplePie\SimplePie * @subpackage API */ class Item implements \SimplePie\RegistryAware { /** * Parent feed * * @access private * @var \SimplePie\SimplePie */ public $feed; /** * Raw data * * @access private * @var array */ public $data = []; /** * Registry object * * @see set_registry * @var \SimplePie\Registry */ protected $registry; /** * Create a new item object * * This is usually used by {@see \SimplePie\SimplePie::get_items} and * {@see \SimplePie\SimplePie::get_item}. Avoid creating this manually. * * @param \SimplePie\SimplePie $feed Parent feed * @param array $data Raw data */ public function __construct($feed, $data) { } /** * Set the registry handler * * This is usually used by {@see \SimplePie\Registry::create} * * @since 1.3 * @param \SimplePie\Registry $registry */ public function set_registry(\SimplePie\Registry $registry) { } /** * Get a string representation of the item * * @return string */ public function __toString() { } /** * Remove items that link back to this before destroying this object */ public function __destruct() { } /** * Get data for an item-level element * * This method allows you to get access to ANY element/attribute that is a * sub-element of the item/entry tag. * * See {@see \SimplePie\SimplePie::get_feed_tags()} for a description of the return value * * @since 1.0 * @see http://simplepie.org/wiki/faq/supported_xml_namespaces * @param string $namespace The URL of the XML namespace of the elements you're trying to access * @param string $tag Tag name * @return array */ public function get_item_tags($namespace, $tag) { } /** * Get the base URL value. * Uses `<xml:base>`, or item link, or feed base URL. * * @param array $element * @return string */ public function get_base($element = []) { } /** * Sanitize feed data * * @access private * @see \SimplePie\SimplePie::sanitize() * @param string $data Data to sanitize * @param int $type One of the \SimplePie\SimplePie::CONSTRUCT_* constants * @param string $base Base URL to resolve URLs against * @return string Sanitized data */ public function sanitize($data, $type, $base = '') { } /** * Get the parent feed * * Note: this may not work as you think for multifeeds! * * @link http://simplepie.org/faq/typical_multifeed_gotchas#missing_data_from_feed * @since 1.0 * @return \SimplePie\SimplePie */ public function get_feed() { } /** * Get the unique identifier for the item * * This is usually used when writing code to check for new items in a feed. * * Uses `<atom:id>`, `<guid>`, `<dc:identifier>` or the `about` attribute * for RDF. If none of these are supplied (or `$hash` is true), creates an * MD5 hash based on the permalink, title and content. * * @since Beta 2 * @param boolean $hash Should we force using a hash instead of the supplied ID? * @param string|false $fn User-supplied function to generate an hash * @return string|null */ public function get_id($hash = false, $fn = 'md5') { } /** * Get the title of the item * * Uses `<atom:title>`, `<title>` or `<dc:title>` * * @since Beta 2 (previously called `get_item_title` since 0.8) * @return string|null */ public function get_title() { } /** * Get the content for the item * * Prefers summaries over full content , but will return full content if a * summary does not exist. * * To prefer full content instead, use {@see get_content} * * Uses `<atom:summary>`, `<description>`, `<dc:description>` or * `<itunes:subtitle>` * * @since 0.8 * @param boolean $description_only Should we avoid falling back to the content? * @return string|null */ public function get_description($description_only = false) { } /** * Get the content for the item * * Prefers full content over summaries, but will return a summary if full * content does not exist. * * To prefer summaries instead, use {@see get_description} * * Uses `<atom:content>` or `<content:encoded>` (RSS 1.0 Content Module) * * @since 1.0 * @param boolean $content_only Should we avoid falling back to the description? * @return string|null */ public function get_content($content_only = false) { } /** * Get the media:thumbnail of the item * * Uses `<media:thumbnail>` * * * @return array|null */ public function get_thumbnail() { } /** * Get a category for the item * * @since Beta 3 (previously called `get_categories()` since Beta 2) * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Category|null */ public function get_category($key = 0) { } /** * Get all categories for the item * * Uses `<atom:category>`, `<category>` or `<dc:subject>` * * @since Beta 3 * @return \SimplePie\Category[]|null List of {@see \SimplePie\Category} objects */ public function get_categories() { } /** * Get an author for the item * * @since Beta 2 * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Author|null */ public function get_author($key = 0) { } /** * Get a contributor for the item * * @since 1.1 * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Author|null */ public function get_contributor($key = 0) { } /** * Get all contributors for the item * * Uses `<atom:contributor>` * * @since 1.1 * @return \SimplePie\Author[]|null List of {@see \SimplePie\Author} objects */ public function get_contributors() { } /** * Get all authors for the item * * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>` * * @since Beta 2 * @return \SimplePie\Author[]|null List of {@see \SimplePie\Author} objects */ public function get_authors() { } /** * Get the copyright info for the item * * Uses `<atom:rights>` or `<dc:rights>` * * @since 1.1 * @return string */ public function get_copyright() { } /** * Get the posting date/time for the item * * Uses `<atom:published>`, `<atom:updated>`, `<atom:issued>`, * `<atom:modified>`, `<pubDate>` or `<dc:date>` * * Note: obeys PHP's timezone setting. To get a UTC date/time, use * {@see get_gmdate} * * @since Beta 2 (previously called `get_item_date` since 0.8) * * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data) * @return int|string|null */ public function get_date($date_format = 'j F Y, g:i a') { } /** * Get the update date/time for the item * * Uses `<atom:updated>` * * Note: obeys PHP's timezone setting. To get a UTC date/time, use * {@see get_gmdate} * * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data) * @return int|string|null */ public function get_updated_date($date_format = 'j F Y, g:i a') { } /** * Get the localized posting date/time for the item * * Returns the date formatted in the localized language. To display in * languages other than the server's default, you need to change the locale * with {@link http://php.net/setlocale setlocale()}. The available * localizations depend on which ones are installed on your web server. * * @since 1.0 * * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data) * @return int|string|null */ public function get_local_date($date_format = '%c') { } /** * Get the posting date/time for the item (UTC time) * * @see get_date * @param string $date_format Supports any PHP date format from {@see http://php.net/date} * @return int|string|null */ public function get_gmdate($date_format = 'j F Y, g:i a') { } /** * Get the update date/time for the item (UTC time) * * @see get_updated_date * @param string $date_format Supports any PHP date format from {@see http://php.net/date} * @return int|string|null */ public function get_updated_gmdate($date_format = 'j F Y, g:i a') { } /** * Get the permalink for the item * * Returns the first link available with a relationship of "alternate". * Identical to {@see get_link()} with key 0 * * @see get_link * @since 0.8 * @return string|null Permalink URL */ public function get_permalink() { } /** * Get a single link for the item * * @since Beta 3 * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1 * @param string $rel The relationship of the link to return * @return string|null Link URL */ public function get_link($key = 0, $rel = 'alternate') { } /** * Get all links for the item * * Uses `<atom:link>`, `<link>` or `<guid>` * * @since Beta 2 * @param string $rel The relationship of links to return * @return array|null Links found for the item (strings) */ public function get_links($rel = 'alternate') { } /** * Get an enclosure from the item * * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS. * * @since Beta 2 * @todo Add ability to prefer one type of content over another (in a media group). * @param int $key The enclosure that you want to return. Remember that arrays begin with 0, not 1 * @return \SimplePie\Enclosure|null */ public function get_enclosure($key = 0, $prefer = null) { } /** * Get all available enclosures (podcasts, etc.) * * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS. * * At this point, we're pretty much assuming that all enclosures for an item * are the same content. Anything else is too complicated to * properly support. * * @since Beta 2 * @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4). * @todo If an element exists at a level, but its value is empty, we should fall back to the value from the parent (if it exists). * @return \SimplePie\Enclosure[]|null List of \SimplePie\Enclosure items */ public function get_enclosures() { } /** * Get the latitude coordinates for the item * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:lat>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_latitude() { } /** * Get the longitude coordinates for the item * * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications * * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>` * * @since 1.0 * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo * @link http://www.georss.org/ GeoRSS * @return string|null */ public function get_longitude() { } /** * Get the `<atom:source>` for the item * * @since 1.1 * @return \SimplePie\Source|null */ public function get_source() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Item" instead */ class SimplePie_Item extends \SimplePie\Item { } } namespace SimplePie { /** * Used for feed auto-discovery * * * This class can be overloaded with {@see \SimplePie\SimplePie::set_locator_class()} * * @package SimplePie */ class Locator implements \SimplePie\RegistryAware { public $useragent; public $timeout; public $file; public $local = []; public $elsewhere = []; public $cached_entities = []; public $http_base; public $base; public $base_location = 0; public $checked_feeds = 0; public $max_checked_feeds = 10; public $force_fsockopen = false; public $curl_options = []; public $dom; protected $registry; public function __construct(\SimplePie\File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10, $force_fsockopen = false, $curl_options = []) { } public function set_registry(\SimplePie\Registry $registry) { } public function find($type = \SimplePie\SimplePie::LOCATOR_ALL, &$working = null) { } public function is_feed($file, $check_html = false) { } public function get_base() { } public function autodiscovery() { } protected function search_elements_by_tag($name, &$done, $feeds) { } public function get_links() { } public function get_rel_link($rel) { } public function extension(&$array) { } public function body(&$array) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Locator" instead */ class SimplePie_Locator extends \SimplePie\Locator { } } namespace SimplePie { /** * Miscellaneous utilities * * @package SimplePie */ class Misc { public static function time_hms($seconds) { } public static function absolutize_url($relative, $base) { } /** * Get a HTML/XML element from a HTML string * * @deprecated since SimplePie 1.3, use DOMDocument instead (parsing HTML with regex is bad!) * @param string $realname Element name (including namespace prefix if applicable) * @param string $string HTML document * @return array */ public static function get_element($realname, $string) { } public static function element_implode($element) { } public static function error($message, $level, $file, $line) { } public static function fix_protocol($url, $http = 1) { } /** * @deprecated since SimplePie 1.8.0, use PHP native array_replace_recursive() instead. */ public static function array_merge_recursive($array1, $array2) { } public static function parse_url($url) { } public static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '') { } public static function normalize_url($url) { } public static function percent_encoding_normalization($match) { } /** * Converts a Windows-1252 encoded string to a UTF-8 encoded string * * @static * @param string $string Windows-1252 encoded string * @return string UTF-8 encoded string */ public static function windows_1252_to_utf8($string) { } /** * Change a string from one encoding to another * * @param string $data Raw data in $input encoding * @param string $input Encoding of $data * @param string $output Encoding you want * @return string|boolean False if we can't convert it */ public static function change_encoding($data, $input, $output) { } protected static function change_encoding_mbstring($data, $input, $output) { } protected static function change_encoding_iconv($data, $input, $output) { } /** * @param string $data * @param string $input * @param string $output * @return string|false */ protected static function change_encoding_uconverter($data, $input, $output) { } /** * Normalize an encoding name * * This is automatically generated by create.php * * To generate it, run `php create.php` on the command line, and copy the * output to replace this function. * * @param string $charset Character set to standardise * @return string Standardised name */ public static function encoding($charset) { } public static function get_curl_version() { } /** * Strip HTML comments * * @param string $data Data to strip comments from * @return string Comment stripped string */ public static function strip_comments($data) { } public static function parse_date($dt) { } /** * Decode HTML entities * * @deprecated since SimplePie 1.3, use DOMDocument instead * @param string $data Input data * @return string Output data */ public static function entities_decode($data) { } /** * Remove RFC822 comments * * @param string $data Data to strip comments from * @return string Comment stripped string */ public static function uncomment_rfc822($string) { } public static function parse_mime($mime) { } public static function atom_03_construct_type($attribs) { } public static function atom_10_construct_type($attribs) { } public static function atom_10_content_construct_type($attribs) { } public static function is_isegment_nz_nc($string) { } public static function space_separated_tokens($string) { } /** * Converts a unicode codepoint to a UTF-8 character * * @static * @param int $codepoint Unicode codepoint * @return string UTF-8 character */ public static function codepoint_to_utf8($codepoint) { } /** * Similar to parse_str() * * Returns an associative array of name/value pairs, where the value is an * array of values that have used the same name * * @static * @param string $str The input string. * @return array */ public static function parse_str($str) { } /** * Detect XML encoding, as per XML 1.0 Appendix F.1 * * @todo Add support for EBCDIC * @param string $data XML data * @param \SimplePie\Registry $registry Class registry * @return array Possible encodings */ public static function xml_encoding($data, $registry) { } public static function output_javascript() { } /** * Get the SimplePie build timestamp * * Uses the git index if it exists, otherwise uses the modification time * of the newest file. */ public static function get_build() { } /** * Get the default user agent string * * @return string */ public static function get_default_useragent() { } /** * Format debugging information */ public static function debug(&$sp) { } public static function silence_errors($num, $str) { } /** * Sanitize a URL by removing HTTP credentials. * @param string $url the URL to sanitize. * @return string the same URL without HTTP credentials. */ public static function url_remove_credentials($url) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Misc" instead */ class SimplePie_Misc extends \SimplePie\Misc { } } namespace SimplePie\Net { /** * Class to validate and to work with IPv6 addresses. * * @package SimplePie * @subpackage HTTP * @copyright 2003-2005 The PHP Group * @license http://www.opensource.org/licenses/bsd-license.php * @link http://pear.php.net/package/Net_IPv6 * @author Alexander Merz <alexander.merz@web.de> * @author elfrink at introweb dot nl * @author Josh Peck <jmp at joshpeck dot org> * @author Sam Sneddon <geoffers@gmail.com> */ class IPv6 { /** * Uncompresses an IPv6 address * * RFC 4291 allows you to compress concecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and expands the '::' to * the required number of zero pieces. * * Example: FF01::101 -> FF01:0:0:0:0:0:0:101 * ::1 -> 0:0:0:0:0:0:0:1 * * @author Alexander Merz <alexander.merz@web.de> * @author elfrink at introweb dot nl * @author Josh Peck <jmp at joshpeck dot org> * @copyright 2003-2005 The PHP Group * @license http://www.opensource.org/licenses/bsd-license.php * @param string $ip An IPv6 address * @return string The uncompressed IPv6 address */ public static function uncompress($ip) { } /** * Compresses an IPv6 address * * RFC 4291 allows you to compress concecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and compresses consecutive * zero pieces to '::'. * * Example: FF01:0:0:0:0:0:0:101 -> FF01::101 * 0:0:0:0:0:0:0:1 -> ::1 * * @see uncompress() * @param string $ip An IPv6 address * @return string The compressed IPv6 address */ public static function compress($ip) { } /** * Checks an IPv6 address * * Checks if the given IP is a valid IPv6 address * * @param string $ip An IPv6 address * @return bool true if $ip is a valid IPv6 address */ public static function check_ipv6($ip) { } /** * Checks if the given IP is a valid IPv6 address * * @codeCoverageIgnore * @deprecated Use {@see IPv6::check_ipv6()} instead * @see check_ipv6 * @param string $ip An IPv6 address * @return bool true if $ip is a valid IPv6 address */ public static function checkIPv6($ip) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Net\IPv6" instead */ class SimplePie_Net_IPv6 extends \SimplePie\Net\IPv6 { } } namespace SimplePie\Parse { /** * Date Parser * * @package SimplePie * @subpackage Parsing */ class Date { /** * Input data * * @access protected * @var string */ public $date; /** * List of days, calendar day name => ordinal day number in the week * * @access protected * @var array */ public $day = [ // English 'mon' => 1, 'monday' => 1, 'tue' => 2, 'tuesday' => 2, 'wed' => 3, 'wednesday' => 3, 'thu' => 4, 'thursday' => 4, 'fri' => 5, 'friday' => 5, 'sat' => 6, 'saturday' => 6, 'sun' => 7, 'sunday' => 7, // Dutch 'maandag' => 1, 'dinsdag' => 2, 'woensdag' => 3, 'donderdag' => 4, 'vrijdag' => 5, 'zaterdag' => 6, 'zondag' => 7, // French 'lundi' => 1, 'mardi' => 2, 'mercredi' => 3, 'jeudi' => 4, 'vendredi' => 5, 'samedi' => 6, 'dimanche' => 7, // German 'montag' => 1, 'mo' => 1, 'dienstag' => 2, 'di' => 2, 'mittwoch' => 3, 'mi' => 3, 'donnerstag' => 4, 'do' => 4, 'freitag' => 5, 'fr' => 5, 'samstag' => 6, 'sa' => 6, 'sonnabend' => 6, // AFAIK no short form for sonnabend 'so' => 7, 'sonntag' => 7, // Italian 'lunedì' => 1, 'martedì' => 2, 'mercoledì' => 3, 'giovedì' => 4, 'venerdì' => 5, 'sabato' => 6, 'domenica' => 7, // Spanish 'lunes' => 1, 'martes' => 2, 'miércoles' => 3, 'jueves' => 4, 'viernes' => 5, 'sábado' => 6, 'domingo' => 7, // Finnish 'maanantai' => 1, 'tiistai' => 2, 'keskiviikko' => 3, 'torstai' => 4, 'perjantai' => 5, 'lauantai' => 6, 'sunnuntai' => 7, // Hungarian 'hétfő' => 1, 'kedd' => 2, 'szerda' => 3, 'csütörtok' => 4, 'péntek' => 5, 'szombat' => 6, 'vasárnap' => 7, // Greek 'Δευ' => 1, 'Τρι' => 2, 'Τετ' => 3, 'Πεμ' => 4, 'Παρ' => 5, 'Σαβ' => 6, 'Κυρ' => 7, // Russian 'Пн.' => 1, 'Вт.' => 2, 'Ср.' => 3, 'Чт.' => 4, 'Пт.' => 5, 'Сб.' => 6, 'Вс.' => 7, ]; /** * List of months, calendar month name => calendar month number * * @access protected * @var array */ public $month = [ // English 'jan' => 1, 'january' => 1, 'feb' => 2, 'february' => 2, 'mar' => 3, 'march' => 3, 'apr' => 4, 'april' => 4, 'may' => 5, // No long form of May 'jun' => 6, 'june' => 6, 'jul' => 7, 'july' => 7, 'aug' => 8, 'august' => 8, 'sep' => 9, 'september' => 9, 'oct' => 10, 'october' => 10, 'nov' => 11, 'november' => 11, 'dec' => 12, 'december' => 12, // Dutch 'januari' => 1, 'februari' => 2, 'maart' => 3, 'april' => 4, 'mei' => 5, 'juni' => 6, 'juli' => 7, 'augustus' => 8, 'september' => 9, 'oktober' => 10, 'november' => 11, 'december' => 12, // French 'janvier' => 1, 'février' => 2, 'mars' => 3, 'avril' => 4, 'mai' => 5, 'juin' => 6, 'juillet' => 7, 'août' => 8, 'septembre' => 9, 'octobre' => 10, 'novembre' => 11, 'décembre' => 12, // German 'januar' => 1, 'jan' => 1, 'februar' => 2, 'feb' => 2, 'märz' => 3, 'mär' => 3, 'april' => 4, 'apr' => 4, 'mai' => 5, // no short form for may 'juni' => 6, 'jun' => 6, 'juli' => 7, 'jul' => 7, 'august' => 8, 'aug' => 8, 'september' => 9, 'sep' => 9, 'oktober' => 10, 'okt' => 10, 'november' => 11, 'nov' => 11, 'dezember' => 12, 'dez' => 12, // Italian 'gennaio' => 1, 'febbraio' => 2, 'marzo' => 3, 'aprile' => 4, 'maggio' => 5, 'giugno' => 6, 'luglio' => 7, 'agosto' => 8, 'settembre' => 9, 'ottobre' => 10, 'novembre' => 11, 'dicembre' => 12, // Spanish 'enero' => 1, 'febrero' => 2, 'marzo' => 3, 'abril' => 4, 'mayo' => 5, 'junio' => 6, 'julio' => 7, 'agosto' => 8, 'septiembre' => 9, 'setiembre' => 9, 'octubre' => 10, 'noviembre' => 11, 'diciembre' => 12, // Finnish 'tammikuu' => 1, 'helmikuu' => 2, 'maaliskuu' => 3, 'huhtikuu' => 4, 'toukokuu' => 5, 'kesäkuu' => 6, 'heinäkuu' => 7, 'elokuu' => 8, 'suuskuu' => 9, 'lokakuu' => 10, 'marras' => 11, 'joulukuu' => 12, // Hungarian 'január' => 1, 'február' => 2, 'március' => 3, 'április' => 4, 'május' => 5, 'június' => 6, 'július' => 7, 'augusztus' => 8, 'szeptember' => 9, 'október' => 10, 'november' => 11, 'december' => 12, // Greek 'Ιαν' => 1, 'Φεβ' => 2, 'Μάώ' => 3, 'Μαώ' => 3, 'Απρ' => 4, 'Μάι' => 5, 'Μαϊ' => 5, 'Μαι' => 5, 'Ιούν' => 6, 'Ιον' => 6, 'Ιούλ' => 7, 'Ιολ' => 7, 'Αύγ' => 8, 'Αυγ' => 8, 'Σεπ' => 9, 'Οκτ' => 10, 'Νοέ' => 11, 'Δεκ' => 12, // Russian 'Янв' => 1, 'января' => 1, 'Фев' => 2, 'февраля' => 2, 'Мар' => 3, 'марта' => 3, 'Апр' => 4, 'апреля' => 4, 'Май' => 5, 'мая' => 5, 'Июн' => 6, 'июня' => 6, 'Июл' => 7, 'июля' => 7, 'Авг' => 8, 'августа' => 8, 'Сен' => 9, 'сентября' => 9, 'Окт' => 10, 'октября' => 10, 'Ноя' => 11, 'ноября' => 11, 'Дек' => 12, 'декабря' => 12, ]; /** * List of timezones, abbreviation => offset from UTC * * @access protected * @var array */ public $timezone = ['ACDT' => 37800, 'ACIT' => 28800, 'ACST' => 34200, 'ACT' => -18000, 'ACWDT' => 35100, 'ACWST' => 31500, 'AEDT' => 39600, 'AEST' => 36000, 'AFT' => 16200, 'AKDT' => -28800, 'AKST' => -32400, 'AMDT' => 18000, 'AMT' => -14400, 'ANAST' => 46800, 'ANAT' => 43200, 'ART' => -10800, 'AZOST' => -3600, 'AZST' => 18000, 'AZT' => 14400, 'BIOT' => 21600, 'BIT' => -43200, 'BOT' => -14400, 'BRST' => -7200, 'BRT' => -10800, 'BST' => 3600, 'BTT' => 21600, 'CAST' => 18000, 'CAT' => 7200, 'CCT' => 23400, 'CDT' => -18000, 'CEDT' => 7200, 'CEST' => 7200, 'CET' => 3600, 'CGST' => -7200, 'CGT' => -10800, 'CHADT' => 49500, 'CHAST' => 45900, 'CIST' => -28800, 'CKT' => -36000, 'CLDT' => -10800, 'CLST' => -14400, 'COT' => -18000, 'CST' => -21600, 'CVT' => -3600, 'CXT' => 25200, 'DAVT' => 25200, 'DTAT' => 36000, 'EADT' => -18000, 'EAST' => -21600, 'EAT' => 10800, 'ECT' => -18000, 'EDT' => -14400, 'EEST' => 10800, 'EET' => 7200, 'EGT' => -3600, 'EKST' => 21600, 'EST' => -18000, 'FJT' => 43200, 'FKDT' => -10800, 'FKST' => -14400, 'FNT' => -7200, 'GALT' => -21600, 'GEDT' => 14400, 'GEST' => 10800, 'GFT' => -10800, 'GILT' => 43200, 'GIT' => -32400, 'GST' => 14400, 'GST' => -7200, 'GYT' => -14400, 'HAA' => -10800, 'HAC' => -18000, 'HADT' => -32400, 'HAE' => -14400, 'HAP' => -25200, 'HAR' => -21600, 'HAST' => -36000, 'HAT' => -9000, 'HAY' => -28800, 'HKST' => 28800, 'HMT' => 18000, 'HNA' => -14400, 'HNC' => -21600, 'HNE' => -18000, 'HNP' => -28800, 'HNR' => -25200, 'HNT' => -12600, 'HNY' => -32400, 'IRDT' => 16200, 'IRKST' => 32400, 'IRKT' => 28800, 'IRST' => 12600, 'JFDT' => -10800, 'JFST' => -14400, 'JST' => 32400, 'KGST' => 21600, 'KGT' => 18000, 'KOST' => 39600, 'KOVST' => 28800, 'KOVT' => 25200, 'KRAST' => 28800, 'KRAT' => 25200, 'KST' => 32400, 'LHDT' => 39600, 'LHST' => 37800, 'LINT' => 50400, 'LKT' => 21600, 'MAGST' => 43200, 'MAGT' => 39600, 'MAWT' => 21600, 'MDT' => -21600, 'MESZ' => 7200, 'MEZ' => 3600, 'MHT' => 43200, 'MIT' => -34200, 'MNST' => 32400, 'MSDT' => 14400, 'MSST' => 10800, 'MST' => -25200, 'MUT' => 14400, 'MVT' => 18000, 'MYT' => 28800, 'NCT' => 39600, 'NDT' => -9000, 'NFT' => 41400, 'NMIT' => 36000, 'NOVST' => 25200, 'NOVT' => 21600, 'NPT' => 20700, 'NRT' => 43200, 'NST' => -12600, 'NUT' => -39600, 'NZDT' => 46800, 'NZST' => 43200, 'OMSST' => 25200, 'OMST' => 21600, 'PDT' => -25200, 'PET' => -18000, 'PETST' => 46800, 'PETT' => 43200, 'PGT' => 36000, 'PHOT' => 46800, 'PHT' => 28800, 'PKT' => 18000, 'PMDT' => -7200, 'PMST' => -10800, 'PONT' => 39600, 'PST' => -28800, 'PWT' => 32400, 'PYST' => -10800, 'PYT' => -14400, 'RET' => 14400, 'ROTT' => -10800, 'SAMST' => 18000, 'SAMT' => 14400, 'SAST' => 7200, 'SBT' => 39600, 'SCDT' => 46800, 'SCST' => 43200, 'SCT' => 14400, 'SEST' => 3600, 'SGT' => 28800, 'SIT' => 28800, 'SRT' => -10800, 'SST' => -39600, 'SYST' => 10800, 'SYT' => 7200, 'TFT' => 18000, 'THAT' => -36000, 'TJT' => 18000, 'TKT' => -36000, 'TMT' => 18000, 'TOT' => 46800, 'TPT' => 32400, 'TRUT' => 36000, 'TVT' => 43200, 'TWT' => 28800, 'UYST' => -7200, 'UYT' => -10800, 'UZT' => 18000, 'VET' => -14400, 'VLAST' => 39600, 'VLAT' => 36000, 'VOST' => 21600, 'VUT' => 39600, 'WAST' => 7200, 'WAT' => 3600, 'WDT' => 32400, 'WEST' => 3600, 'WFT' => 43200, 'WIB' => 25200, 'WIT' => 32400, 'WITA' => 28800, 'WKST' => 18000, 'WST' => 28800, 'YAKST' => 36000, 'YAKT' => 32400, 'YAPT' => 36000, 'YEKST' => 21600, 'YEKT' => 18000]; /** * Cached PCRE for Date::$day * * @access protected * @var string */ public $day_pcre; /** * Cached PCRE for Date::$month * * @access protected * @var string */ public $month_pcre; /** * Array of user-added callback methods * * @access private * @var array */ public $built_in = []; /** * Array of user-added callback methods * * @access private * @var array */ public $user = []; /** * Create new Date object, and set self::day_pcre, * self::month_pcre, and self::built_in * * @access private */ public function __construct() { } /** * Get the object * * @access public */ public static function get() { } /** * Parse a date * * @final * @access public * @param string $date Date to parse * @return int Timestamp corresponding to date string, or false on failure */ public function parse($date) { } /** * Add a callback method to parse a date * * @final * @access public * @param callable $callback */ public function add_callback($callback) { } /** * Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as * well as allowing any of upper or lower case "T", horizontal tabs, or * spaces to be used as the time separator (including more than one)) * * @access protected * @return int Timestamp */ public function date_w3cdtf($date) { } /** * Remove RFC822 comments * * @access protected * @param string $data Data to strip comments from * @return string Comment stripped string */ public function remove_rfc2822_comments($string) { } /** * Parse RFC2822's date format * * @access protected * @return int Timestamp */ public function date_rfc2822($date) { } /** * Parse RFC850's date format * * @access protected * @return int Timestamp */ public function date_rfc850($date) { } /** * Parse C99's asctime()'s date format * * @access protected * @return int Timestamp */ public function date_asctime($date) { } /** * Parse dates using strtotime() * * @access protected * @return int Timestamp */ public function date_strtotime($date) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Parse\Date" instead */ class SimplePie_Parse_Date extends \SimplePie\Parse\Date { } } namespace SimplePie { /** * Parses XML into something sane * * * This class can be overloaded with {@see \SimplePie\SimplePie::set_parser_class()} * * @package SimplePie * @subpackage Parsing */ class Parser implements \SimplePie\RegistryAware { public $error_code; public $error_string; public $current_line; public $current_column; public $current_byte; public $separator = ' '; public $namespace = ['']; public $element = ['']; public $xml_base = ['']; public $xml_base_explicit = [false]; public $xml_lang = ['']; public $data = []; public $datas = [[]]; public $current_xhtml_construct = -1; public $encoding; protected $registry; public function set_registry(\SimplePie\Registry $registry) { } public function parse(&$data, $encoding, $url = '') { } public function get_error_code() { } public function get_error_string() { } public function get_current_line() { } public function get_current_column() { } public function get_current_byte() { } public function get_data() { } public function tag_open($parser, $tag, $attributes) { } public function cdata($parser, $cdata) { } public function tag_close($parser, $tag) { } public function split_ns($string) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Parser" instead */ class SimplePie_Parser extends \SimplePie\Parser { } } namespace SimplePie { /** * Handles `<media:rating>` or `<itunes:explicit>` tags as defined in Media RSS and iTunes RSS respectively * * Used by {@see \SimplePie\Enclosure::get_rating()} and {@see \SimplePie\Enclosure::get_ratings()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_rating_class()} * * @package SimplePie * @subpackage API */ class Rating { /** * Rating scheme * * @var string * @see get_scheme() */ public $scheme; /** * Rating value * * @var string * @see get_value() */ public $value; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($scheme = null, $value = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Get the organizational scheme for the rating * * @return string|null */ public function get_scheme() { } /** * Get the value of the rating * * @return string|null */ public function get_value() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Rating" instead */ class SimplePie_Rating extends \SimplePie\Rating { } } namespace SimplePie { /** * Handles creating objects and calling methods * * Access this via {@see \SimplePie\SimplePie::get_registry()} * * @package SimplePie */ class Registry { /** * Default class mapping * * Overriding classes *must* subclass these. * * @var array<class-string, class-string> */ protected $default = [\SimplePie\Cache::class => \SimplePie\Cache::class, \SimplePie\Locator::class => \SimplePie\Locator::class, \SimplePie\Parser::class => \SimplePie\Parser::class, \SimplePie\File::class => \SimplePie\File::class, \SimplePie\Sanitize::class => \SimplePie\Sanitize::class, \SimplePie\Item::class => \SimplePie\Item::class, \SimplePie\Author::class => \SimplePie\Author::class, \SimplePie\Category::class => \SimplePie\Category::class, \SimplePie\Enclosure::class => \SimplePie\Enclosure::class, \SimplePie\Caption::class => \SimplePie\Caption::class, \SimplePie\Copyright::class => \SimplePie\Copyright::class, \SimplePie\Credit::class => \SimplePie\Credit::class, \SimplePie\Rating::class => \SimplePie\Rating::class, \SimplePie\Restriction::class => \SimplePie\Restriction::class, \SimplePie\Content\Type\Sniffer::class => \SimplePie\Content\Type\Sniffer::class, \SimplePie\Source::class => \SimplePie\Source::class, \SimplePie\Misc::class => \SimplePie\Misc::class, \SimplePie\XML\Declaration\Parser::class => \SimplePie\XML\Declaration\Parser::class, \SimplePie\Parse\Date::class => \SimplePie\Parse\Date::class]; /** * Class mapping * * @see register() * @var array */ protected $classes = []; /** * Legacy classes * * @see register() * @var array<class-string> */ protected $legacy = []; /** * Constructor * * No-op */ public function __construct() { } /** * Register a class * * @param string $type See {@see $default} for names * @param class-string $class Class name, must subclass the corresponding default * @param bool $legacy Whether to enable legacy support for this class * @return bool Successfulness */ public function register($type, $class, $legacy = false) { } /** * Get the class registered for a type * * Where possible, use {@see create()} or {@see call()} instead * * @template T * @param class-string<T> $type * @return class-string<T>|null */ public function get_class($type) { } /** * Create a new instance of a given type * * @template T class-string $type * @param class-string<T> $type * @param array $parameters Parameters to pass to the constructor * @return T Instance of class */ public function &create($type, $parameters = []) { } /** * Call a static method for a type * * @param class-string $type * @param string $method * @param array $parameters * @return mixed */ public function &call($type, $method, $parameters = []) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Registry" instead */ class SimplePie_Registry extends \SimplePie\Registry { } } namespace SimplePie { /** * Handles `<media:restriction>` as defined in Media RSS * * Used by {@see \SimplePie\Enclosure::get_restriction()} and {@see \SimplePie\Enclosure::get_restrictions()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_restriction_class()} * * @package SimplePie * @subpackage API */ class Restriction { /** * Relationship ('allow'/'deny') * * @var string * @see get_relationship() */ public $relationship; /** * Type of restriction * * @var string * @see get_type() */ public $type; /** * Restricted values * * @var string * @see get_value() */ public $value; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($relationship = null, $type = null, $value = null) { } /** * String-ified version * * @return string */ public function __toString() { } /** * Get the relationship * * @return string|null Either 'allow' or 'deny' */ public function get_relationship() { } /** * Get the type * * @return string|null */ public function get_type() { } /** * Get the list of restricted things * * @return string|null */ public function get_value() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Restriction" instead */ class SimplePie_Restriction extends \SimplePie\Restriction { } } namespace SimplePie { /** * Used for data cleanup and post-processing * * * This class can be overloaded with {@see \SimplePie\SimplePie::set_sanitize_class()} * * @package SimplePie * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags */ class Sanitize implements \SimplePie\RegistryAware { public $base; public $remove_div = true; public $image_handler = ''; public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']; public $encode_instead_of_strip = false; public $strip_attributes = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']; public $rename_attributes = []; public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]; public $strip_comments = false; public $output_encoding = 'UTF-8'; public $enable_cache = true; public $cache_location = './cache'; public $cache_name_function = 'md5'; public $timeout = 10; public $useragent = ''; public $force_fsockopen = false; public $replace_url_attributes = null; public $registry; /** * List of domains for which to force HTTPS. * @see \SimplePie\Sanitize::set_https_domains() * Array is a tree split at DNS levels. Example: * array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true))) */ public $https_domains = []; public function __construct() { } public function remove_div($enable = true) { } public function set_image_handler($page = false) { } public function set_registry(\SimplePie\Registry $registry) { } public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\\Cache', ?\SimplePie\Cache\DataCache $cache = null) { } public function pass_file_data($file_class = 'SimplePie\\File', $timeout = 10, $useragent = '', $force_fsockopen = false) { } public function strip_htmltags($tags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']) { } public function encode_instead_of_strip($encode = false) { } public function rename_attributes($attribs = []) { } public function strip_attributes($attribs = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']) { } public function add_attributes($attribs = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]) { } public function strip_comments($strip = false) { } public function set_output_encoding($encoding = 'UTF-8') { } /** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * Defaults to |a|@href, |area|@href, |audio|@src, |blockquote|@cite, * |del|@cite, |form|@action, |img|@longdesc, |img|@src, |input|@src, * |ins|@cite, |q|@cite, |source|@src, |video|@src * * @since 1.0 * @param array|null $element_attribute Element/attribute key/value pairs, null for default */ public function set_url_replacements($element_attribute = null) { } /** * Set the list of domains for which to force HTTPS. * @see \SimplePie\Misc::https_url() * Example array('biz', 'example.com', 'example.org', 'www.example.net'); */ public function set_https_domains($domains) { } /** * Check if the domain is in the list of forced HTTPS. */ protected function is_https_domain($domain) { } /** * Force HTTPS for selected Web sites. */ public function https_url($url) { } public function sanitize($data, $type, $base = '') { } protected function preprocess($html, $type) { } public function replace_urls($document, $tag, $attributes) { } public function do_strip_htmltags($match) { } protected function strip_tag($tag, $document, $xpath, $type) { } protected function strip_attr($attrib, $xpath) { } protected function rename_attr($attrib, $xpath) { } protected function add_attr($tag, $valuePairs, $document) { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Sanitize" instead */ class SimplePie_Sanitize extends \SimplePie\Sanitize { } } namespace SimplePie { /** * Handles `<atom:source>` * * Used by {@see \SimplePie\Item::get_source()} * * This class can be overloaded with {@see \SimplePie::set_source_class()} * * @package SimplePie * @subpackage API */ class Source implements \SimplePie\RegistryAware { public $item; public $data = []; protected $registry; public function __construct($item, $data) { } public function set_registry(\SimplePie\Registry $registry) { } public function __toString() { } public function get_source_tags($namespace, $tag) { } public function get_base($element = []) { } public function sanitize($data, $type, $base = '') { } public function get_item() { } public function get_title() { } public function get_category($key = 0) { } public function get_categories() { } public function get_author($key = 0) { } public function get_authors() { } public function get_contributor($key = 0) { } public function get_contributors() { } public function get_link($key = 0, $rel = 'alternate') { } /** * Added for parity between the parent-level and the item/entry-level. */ public function get_permalink() { } public function get_links($rel = 'alternate') { } public function get_description() { } public function get_copyright() { } public function get_language() { } public function get_latitude() { } public function get_longitude() { } public function get_image_url() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Source" instead */ class SimplePie_Source extends \SimplePie\Source { } } namespace SimplePie\XML\Declaration { /** * Parses the XML Declaration * * @package SimplePie * @subpackage Parsing */ class Parser { /** * XML Version * * @access public * @var string */ public $version = '1.0'; /** * Encoding * * @access public * @var string */ public $encoding = 'UTF-8'; /** * Standalone * * @access public * @var bool */ public $standalone = false; /** * Current state of the state machine * * @access private * @var self::STATE_* */ public $state = self::STATE_BEFORE_VERSION_NAME; /** * Input data * * @access private * @var string */ public $data = ''; /** * Input data length (to avoid calling strlen() everytime this is needed) * * @access private * @var int */ public $data_length = 0; /** * Current position of the pointer * * @var int * @access private */ public $position = 0; /** * Create an instance of the class with the input data * * @access public * @param string $data Input data */ public function __construct($data) { } /** * Parse the input data * * @access public * @return bool true on success, false on failure */ public function parse() { } /** * Check whether there is data beyond the pointer * * @access private * @return bool true if there is further data, false if not */ public function has_data() { } /** * Advance past any whitespace * * @return int Number of whitespace characters passed */ public function skip_whitespace() { } /** * Read value */ public function get_value() { } public function before_version_name() { } public function version_name() { } public function version_equals() { } public function version_value() { } public function encoding_name() { } public function encoding_equals() { } public function encoding_value() { } public function standalone_name() { } public function standalone_equals() { } public function standalone_value() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\XML\Declaration\Parser" instead */ class SimplePie_XML_Declaration_Parser extends \SimplePie\XML\Declaration\Parser { } } namespace SimplePie { /** * Decode 'gzip' encoded HTTP data * * @package SimplePie * @subpackage HTTP * @link http://www.gzip.org/format.txt */ class Gzdecode { /** * Compressed data * * @access private * @var string * @see gzdecode::$data */ public $compressed_data; /** * Size of compressed data * * @access private * @var int */ public $compressed_size; /** * Minimum size of a valid gzip string * * @access private * @var int */ public $min_compressed_size = 18; /** * Current position of pointer * * @access private * @var int */ public $position = 0; /** * Flags (FLG) * * @access private * @var int */ public $flags; /** * Uncompressed data * * @access public * @see gzdecode::$compressed_data * @var string */ public $data; /** * Modified time * * @access public * @var int */ public $MTIME; /** * Extra Flags * * @access public * @var int */ public $XFL; /** * Operating System * * @access public * @var int */ public $OS; /** * Subfield ID 1 * * @access public * @see gzdecode::$extra_field * @see gzdecode::$SI2 * @var string */ public $SI1; /** * Subfield ID 2 * * @access public * @see gzdecode::$extra_field * @see gzdecode::$SI1 * @var string */ public $SI2; /** * Extra field content * * @access public * @see gzdecode::$SI1 * @see gzdecode::$SI2 * @var string */ public $extra_field; /** * Original filename * * @access public * @var string */ public $filename; /** * Human readable comment * * @access public * @var string */ public $comment; /** * Don't allow anything to be set * * @param string $name * @param mixed $value */ public function __set($name, $value) { } /** * Set the compressed string and related properties * * @param string $data */ public function __construct($data) { } /** * Decode the GZIP stream * * @return bool Successfulness */ public function parse() { } } } namespace { /** @deprecated since SimplePie 1.7.0, use "SimplePie\Gzdecode" instead */ class SimplePie_gzdecode extends \SimplePie\Gzdecode { } } namespace SimplePie\Cache { /** * Subset of PSR-16 Cache client for caching data arrays * * Only get(), set() and delete() methods are used, * but not has(), getMultiple(), setMultiple() or deleteMultiple(). * * The methods names must be different, but should be compatible to the * methods of \Psr\SimpleCache\CacheInterface. * * @package SimplePie * @subpackage Caching * @internal */ interface DataCache { /** * Fetches a value from the cache. * * Equivalent to \Psr\SimpleCache\CacheInterface::get() * <code> * public function get(string $key, mixed $default = null): mixed; * </code> * * @param string $key The unique key of this item in the cache. * @param mixed $default Default value to return if the key does not exist. * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null); /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. * * Equivalent to \Psr\SimpleCache\CacheInterface::set() * <code> * public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; * </code> * * @param string $key The key of the item to store. * @param array $value The value of the item to store, must be serializable. * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * * @return bool True on success and false on failure. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null) : bool; /** * Delete an item from the cache by its unique key. * * Equivalent to \Psr\SimpleCache\CacheInterface::delete() * <code> * public function delete(string $key): bool; * </code> * * @param string $key The unique cache key of the item to delete. * * @return bool True if the item was successfully removed. False if there was an error. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key) : bool; } /** * Adapter for deprecated \SimplePie\Cache\Base implementations * * @package SimplePie * @subpackage Caching * @internal */ final class BaseDataCache implements \SimplePie\Cache\DataCache { public function __construct(\SimplePie\Cache\Base $cache) { } /** * Fetches a value from the cache. * * Equivalent to \Psr\SimpleCache\CacheInterface::get() * <code> * public function get(string $key, mixed $default = null): mixed; * </code> * * @param string $key The unique key of this item in the cache. * @param mixed $default Default value to return if the key does not exist. * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null) { } /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. * * Equivalent to \Psr\SimpleCache\CacheInterface::set() * <code> * public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; * </code> * * @param string $key The key of the item to store. * @param array $value The value of the item to store, must be serializable. * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * * @return bool True on success and false on failure. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null) : bool { } /** * Delete an item from the cache by its unique key. * * Equivalent to \Psr\SimpleCache\CacheInterface::delete() * <code> * public function delete(string $key): bool; * </code> * * @param string $key The unique cache key of the item to delete. * * @return bool True if the item was successfully removed. False if there was an error. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key) : bool { } } /** * Interface for creating a cache filename * * @package SimplePie * @subpackage Caching */ interface NameFilter { /** * Method to create cache filename with. * * The returning name MUST follow the rules for keys in PSR-16. * * @link https://www.php-fig.org/psr/psr-16/ * * The returning name MUST be a string of at least one character * that uniquely identifies a cached item, MUST only contain the * characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding * and MUST not longer then 64 characters. The following characters * are reserved for future extensions and MUST NOT be used: {}()/\@: * * A provided implementing library MAY support additional characters * and encodings or longer lengths, but MUST support at least that * minimum. * * @param string $name The name for the cache will be most likly an url with query string * * @return string the new cache name */ public function filter(string $name) : string; } /** * Creating a cache filename with callables * * @package SimplePie * @subpackage Caching */ final class CallableNameFilter implements \SimplePie\Cache\NameFilter { public function __construct(callable $callable) { } /** * Method to create cache filename with. * * The returning name MUST follow the rules for keys in PSR-16. * * @link https://www.php-fig.org/psr/psr-16/ * * The returning name MUST be a string of at least one character * that uniquely identifies a cached item, MUST only contain the * characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding * and MUST not longer then 64 characters. The following characters * are reserved for future extensions and MUST NOT be used: {}()/\@: * * A provided implementing library MAY support additional characters * and encodings or longer lengths, but MUST support at least that * minimum. * * @param string $name The name for the cache will be most likly an url with query string * * @return string the new cache name */ public function filter(string $name) : string { } } /** * Caches data into a PSR-16 cache implementation * * @package SimplePie * @subpackage Caching * @internal */ final class Psr16 implements \SimplePie\Cache\DataCache { /** * PSR-16 cache implementation * * @param CacheInterface $cache */ public function __construct(\Psr\SimpleCache\CacheInterface $cache) { } /** * Fetches a value from the cache. * * Equivalent to \Psr\SimpleCache\CacheInterface::get() * <code> * public function get(string $key, mixed $default = null): mixed; * </code> * * @param string $key The unique key of this item in the cache. * @param mixed $default Default value to return if the key does not exist. * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null) { } /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. * * Equivalent to \Psr\SimpleCache\CacheInterface::set() * <code> * public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; * </code> * * @param string $key The key of the item to store. * @param array $value The value of the item to store, must be serializable. * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * * @return bool True on success and false on failure. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null) : bool { } /** * Delete an item from the cache by its unique key. * * Equivalent to \Psr\SimpleCache\CacheInterface::delete() * <code> * public function delete(string $key): bool; * </code> * * @param string $key The unique cache key of the item to delete. * * @return bool True if the item was successfully removed. False if there was an error. * * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key) : bool { } } } namespace { /** * General API for generating and formatting diffs - the differences between * two sequences of strings. * * The original PHP version of this code was written by Geoffrey T. Dairiki * <dairiki@dairiki.org>, and is used/adapted with his permission. * * Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org> * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see https://opensource.org/license/lgpl-2-1/. * * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> */ class Text_Diff { /** * Array of changes. * * @var array */ var $_edits; /** * Computes diffs between sequences of strings. * * @param string $engine Name of the diffing engine to use. 'auto' * will automatically select the best. * @param array $params Parameters to pass to the diffing engine. * Normally an array of two arrays, each * containing the lines from a file. */ function __construct($engine, $params) { } /** * PHP4 constructor. */ public function Text_Diff($engine, $params) { } /** * Returns the array of differences. */ function getDiff() { } /** * returns the number of new (added) lines in a given diff. * * @since Text_Diff 1.1.0 * * @return int The number of new lines */ function countAddedLines() { } /** * Returns the number of deleted (removed) lines in a given diff. * * @since Text_Diff 1.1.0 * * @return int The number of deleted lines */ function countDeletedLines() { } /** * Computes a reversed diff. * * Example: * <code> * $diff = new Text_Diff($lines1, $lines2); * $rev = $diff->reverse(); * </code> * * @return Text_Diff A Diff object representing the inverse of the * original diff. Note that we purposely don't return a * reference here, since this essentially is a clone() * method. */ function reverse() { } /** * Checks for an empty diff. * * @return bool True if two sequences were identical. */ function isEmpty() { } /** * Computes the length of the Longest Common Subsequence (LCS). * * This is mostly for diagnostic purposes. * * @return int The length of the LCS. */ function lcs() { } /** * Gets the original set of lines. * * This reconstructs the $from_lines parameter passed to the constructor. * * @return array The original sequence of strings. */ function getOriginal() { } /** * Gets the final set of lines. * * This reconstructs the $to_lines parameter passed to the constructor. * * @return array The sequence of strings. */ function getFinal() { } /** * Removes trailing newlines from a line of text. This is meant to be used * with array_walk(). * * @param string $line The line to trim. * @param int $key The index of the line in the array. Not used. */ static function trimNewlines(&$line, $key) { } /** * Determines the location of the system temporary directory. * * @access protected * * @return string A directory name which can be used for temp files. * Returns false if one could not be found. */ static function _getTempDir() { } /** * Checks a diff for validity. * * This is here only for debugging purposes. */ function _check($from_lines, $to_lines) { } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> */ class Text_MappedDiff extends \Text_Diff { /** * Computes a diff between sequences of strings. * * This can be used to compute things like case-insensitive diffs, or diffs * which ignore changes in white-space. * * @param array $from_lines An array of strings. * @param array $to_lines An array of strings. * @param array $mapped_from_lines This array should have the same size * number of elements as $from_lines. The * elements in $mapped_from_lines and * $mapped_to_lines are what is actually * compared when computing the diff. * @param array $mapped_to_lines This array should have the same number * of elements as $to_lines. */ function __construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { } /** * PHP4 constructor. */ public function Text_MappedDiff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ abstract class Text_Diff_Op { var $orig; var $final; abstract function &reverse(); function norig() { } function nfinal() { } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_copy extends \Text_Diff_Op { /** * PHP5 constructor. */ function __construct($orig, $final = \false) { } /** * PHP4 constructor. */ public function Text_Diff_Op_copy($orig, $final = \false) { } function &reverse() { } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_delete extends \Text_Diff_Op { /** * PHP5 constructor. */ function __construct($lines) { } /** * PHP4 constructor. */ public function Text_Diff_Op_delete($lines) { } function &reverse() { } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_add extends \Text_Diff_Op { /** * PHP5 constructor. */ function __construct($lines) { } /** * PHP4 constructor. */ public function Text_Diff_Op_add($lines) { } function &reverse() { } } /** * @package Text_Diff * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * * @access private */ class Text_Diff_Op_change extends \Text_Diff_Op { /** * PHP5 constructor. */ function __construct($orig, $final) { } /** * PHP4 constructor. */ public function Text_Diff_Op_change($orig, $final) { } function &reverse() { } } /** * Class used internally by Text_Diff to actually compute the diffs. * * This class is implemented using native PHP code. * * The algorithm used here is mostly lifted from the perl module * Algorithm::Diff (version 1.06) by Ned Konz, which is available at: * https://cpan.metacpan.org/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip * * More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html * * Some ideas (and a bit of code) are taken from analyze.c, of GNU * diffutils-2.7, which can be found at: * ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz * * Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from * Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this * code was written by him, and is used/adapted with his permission. * * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see https://opensource.org/license/lgpl-2-1/. * * @author Geoffrey T. Dairiki <dairiki@dairiki.org> * @package Text_Diff */ class Text_Diff_Engine_native { public $xchanged; public $ychanged; public $xv; public $yv; public $xind; public $yind; public $seq; public $in_seq; public $lcs; function diff($from_lines, $to_lines) { } /** * Divides the Largest Common Subsequence (LCS) of the sequences (XOFF, * XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized * segments. * * Returns (LCS, PTS). LCS is the length of the LCS. PTS is an array of * NCHUNKS+1 (X, Y) indexes giving the diving points between sub * sequences. The first sub-sequence is contained in (X0, X1), (Y0, Y1), * the second in (X1, X2), (Y1, Y2) and so on. Note that (X0, Y0) == * (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM). * * This function assumes that the first lines of the specified portions of * the two files do not match, and likewise that the last lines do not * match. The caller must trim matching lines from the beginning and end * of the portions it is going to specify. */ function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) { } function _lcsPos($ypos) { } /** * Finds LCS of two sequences. * * The results are recorded in the vectors $this->{x,y}changed[], by * storing a 1 in the element for each line that is an insertion or * deletion (ie. is not in the LCS). * * The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1. * * Note that XLIM, YLIM are exclusive bounds. All line numbers are * origin-0 and discarded lines are not counted. */ function _compareseq($xoff, $xlim, $yoff, $ylim) { } /** * Adjusts inserts/deletes of identical lines to join changes as much as * possible. * * We do something when a run of changed lines include a line at one end * and has an excluded, identical line at the other. We are free to * choose which identical line is included. `compareseq' usually chooses * the one at the beginning, but usually it is cleaner to consider the * following identical line to be the "change". * * This is extracted verbatim from analyze.c (GNU diffutils-2.7). */ function _shiftBoundaries($lines, &$changed, $other_changed) { } } /** * Class used internally by Diff to actually compute the diffs. * * This class uses the Unix `diff` program via shell_exec to compute the * differences between the two input arrays. * * Copyright 2007-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see https://opensource.org/license/lgpl-2-1/. * * @author Milian Wolff <mail@milianw.de> * @package Text_Diff * @since 0.3.0 */ class Text_Diff_Engine_shell { /** * Path to the diff executable * * @var string */ var $_diffCommand = 'diff'; /** * Returns the array of differences. * * @param array $from_lines lines of text from old file * @param array $to_lines lines of text from new file * * @return array all changes made (array with Text_Diff_Op_* objects) */ function diff($from_lines, $to_lines) { } /** * Get lines from either the old or new text * * @access private * * @param array $text_lines Either $from_lines or $to_lines (passed by reference). * @param int $line_no Current line number (passed by reference). * @param int $end Optional end line, when we want to chop more * than one line. * * @return array The chopped lines */ function _getLines(&$text_lines, &$line_no, $end = \false) { } } /** * Parses unified or context diffs output from eg. the diff utility. * * Example: * <code> * $patch = file_get_contents('example.patch'); * $diff = new Text_Diff('string', array($patch)); * $renderer = new Text_Diff_Renderer_inline(); * echo $renderer->render($diff); * </code> * * Copyright 2005 Örjan Persson <o@42mm.org> * Copyright 2005-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see https://opensource.org/license/lgpl-2-1/. * * @author Örjan Persson <o@42mm.org> * @package Text_Diff * @since 0.2.0 */ class Text_Diff_Engine_string { /** * Parses a unified or context diff. * * First param contains the whole diff and the second can be used to force * a specific diff type. If the second parameter is 'autodetect', the * diff will be examined to find out which type of diff this is. * * @param string $diff The diff content. * @param string $mode The diff mode of the content in $diff. One of * 'context', 'unified', or 'autodetect'. * * @return array List of all diff operations. * @phpstan-param 'context'|'unified'|'autodetect' $mode */ function diff($diff, $mode = 'autodetect') { } /** * Parses an array containing the unified diff. * * @param array $diff Array of lines. * * @return array List of all diff operations. */ function parseUnifiedDiff($diff) { } /** * Parses an array containing the context diff. * * @param array $diff Array of lines. * * @return array List of all diff operations. */ function parseContextDiff(&$diff) { } } /** * Class used internally by Diff to actually compute the diffs. * * This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff) * to compute the differences between the two input arrays. * * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see https://opensource.org/license/lgpl-2-1/. * * @author Jon Parise <jon@horde.org> * @package Text_Diff */ class Text_Diff_Engine_xdiff { /** */ function diff($from_lines, $to_lines) { } } /** * A class to render Diffs in different formats. * * This class renders the diff in classic diff format. It is intended that * this class be customized via inheritance, to obtain fancier outputs. * * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see https://opensource.org/license/lgpl-2-1/. * * @package Text_Diff */ class Text_Diff_Renderer { /** * Number of leading context "lines" to preserve. * * This should be left at zero for this class, but subclasses may want to * set this to other values. */ var $_leading_context_lines = 0; /** * Number of trailing context "lines" to preserve. * * This should be left at zero for this class, but subclasses may want to * set this to other values. */ var $_trailing_context_lines = 0; /** * Constructor. */ function __construct($params = array()) { } /** * PHP4 constructor. */ public function Text_Diff_Renderer($params = array()) { } /** * Get any renderer parameters. * * @return array All parameters of this renderer object. */ function getParams() { } /** * Renders a diff. * * @param Text_Diff $diff A Text_Diff object. * * @return string The formatted output. */ function render($diff) { } function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) { } function _startDiff() { } function _endDiff() { } function _blockHeader($xbeg, $xlen, $ybeg, $ylen) { } function _startBlock($header) { } function _endBlock() { } function _lines($lines, $prefix = ' ') { } function _context($lines) { } function _added($lines) { } function _deleted($lines) { } function _changed($orig, $final) { } } /** * "Inline" diff renderer. * * This class renders diffs in the Wiki-style "inline" format. * * @author Ciprian Popovici * @package Text_Diff */ class Text_Diff_Renderer_inline extends \Text_Diff_Renderer { /** * Number of leading context "lines" to preserve. * * @var integer */ var $_leading_context_lines = 10000; /** * Number of trailing context "lines" to preserve. * * @var integer */ var $_trailing_context_lines = 10000; /** * Prefix for inserted text. * * @var string */ var $_ins_prefix = '<ins>'; /** * Suffix for inserted text. * * @var string */ var $_ins_suffix = '</ins>'; /** * Prefix for deleted text. * * @var string */ var $_del_prefix = '<del>'; /** * Suffix for deleted text. * * @var string */ var $_del_suffix = '</del>'; /** * Header for each change block. * * @var string */ var $_block_header = ''; /** * Whether to split down to character-level. * * @var boolean */ var $_split_characters = \false; /** * What are we currently splitting on? Used to recurse to show word-level * or character-level changes. * * @var string */ var $_split_level = 'lines'; function _blockHeader($xbeg, $xlen, $ybeg, $ylen) { } function _startBlock($header) { } function _lines($lines, $prefix = ' ', $encode = \true) { } function _added($lines) { } function _deleted($lines, $words = \false) { } function _changed($orig, $final) { } function _splitOnWords($string, $newlineEscape = "\n") { } function _encode(&$string) { } } /** * Exception for errors from the Text_Diff package. * * {@internal This is a WP native addition to the external Text_Diff package.} * * @package WordPress * @subpackage Text_Diff */ class Text_Exception extends \Exception { } /** * Structure that store common Atom Feed Properties * * @package AtomLib */ class AtomFeed { /** * Stores Links * @var array * @access public */ var $links = array(); /** * Stores Categories * @var array * @access public */ var $categories = array(); /** * Stores Entries * * @var array * @access public */ var $entries = array(); } /** * Structure that store Atom Entry Properties * * @package AtomLib */ class AtomEntry { /** * Stores Links * @var array * @access public */ var $links = array(); /** * Stores Categories * @var array * @access public */ var $categories = array(); } /** * AtomLib Atom Parser API * * @package AtomLib */ class AtomParser { var $NS = 'http://www.w3.org/2005/Atom'; var $ATOM_CONTENT_ELEMENTS = array('content', 'summary', 'title', 'subtitle', 'rights'); var $ATOM_SIMPLE_ELEMENTS = array('id', 'updated', 'published', 'draft'); var $debug = \false; var $depth = 0; var $indent = 2; var $in_content; var $ns_contexts = array(); var $ns_decls = array(); var $content_ns_decls = array(); var $content_ns_contexts = array(); var $is_xhtml = \false; var $is_html = \false; var $is_text = \true; var $skipped_div = \false; var $FILE = "php://input"; var $feed; var $current; var $map_attrs_func; var $map_xmlns_func; var $error; var $content; /** * PHP5 constructor. */ function __construct() { } /** * PHP4 constructor. */ public function AtomParser() { } /** * Map attributes to key="val" * * @param string $k Key * @param string $v Value * @return string */ public static function map_attrs($k, $v) { } /** * Map XML namespace to string. * * @param indexish $p XML Namespace element index * @param array $n Two-element array pair. [ 0 => {namespace}, 1 => {url} ] * @return string 'xmlns="{url}"' or 'xmlns:{namespace}="{url}"' */ public static function map_xmlns($p, $n) { } function _p($msg) { } function error_handler($log_level, $log_text, $error_file, $error_line) { } function parse() { } function start_element($parser, $name, $attrs) { } function end_element($parser, $name) { } function start_ns($parser, $prefix, $uri) { } function end_ns($parser, $prefix) { } function cdata($parser, $data) { } function _default($parser, $data) { } function ns_to_prefix($qname, $attr = \false) { } function is_declared_content_ns($new_mapping) { } function xml_escape($content) { } } /** * Helper functions used to render the navigation block. * * @since 6.5.0 */ class WP_Navigation_Block_Renderer { /** * Renders the navigation block. * * @since 6.5.0 * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. * @return string Returns the navigation block markup. */ public static function render($attributes, $content, $block) { } } } namespace Avifinfo { class Tile { public $tile_item_id; public $parent_item_id; } class Prop { public $property_index; public $item_id; } class Dim_Prop { public $property_index; public $width; public $height; } class Chan_Prop { public $property_index; public $bit_depth; public $num_channels; } class Features { public $has_primary_item = false; public $has_alpha = false; public $primary_item_id; public $primary_item_features = array( // Deduced from the data below. 'width' => UNDEFINED, // In number of pixels. 'height' => UNDEFINED, // Ignores mirror and rotation. 'bit_depth' => UNDEFINED, // Likely 8, 10 or 12 bits per channel per pixel. 'num_channels' => UNDEFINED, ); public $tiles = array(); public $props = array(); public $dim_props = array(); public $chan_props = array(); /** * Finds the width, height, bit depth and number of channels of the primary item. * * @return Status FOUND on success or NOT_FOUND on failure. */ public function get_primary_item_features() { } } class Box { public $size; public $type; public $version; public $flags; public $content_size; /** * Reads the box header. * * @param stream $handle The resource the header will be parsed from. * @param int $num_parsed_boxes The total number of parsed boxes. Prevents timeouts. * @param int $num_remaining_bytes The number of bytes that should be available from the resource. * @return Status FOUND on success or an error on failure. */ public function parse($handle, &$num_parsed_boxes, $num_remaining_bytes = MAX_SIZE) { } } class Parser { public $features; function __construct($handle) { } /** * Parses a file stream. * * The file type is checked through the "ftyp" box. * * @return bool True if the input stream is an AVIF bitstream or false. */ public function parse_ftyp() { } /** * Parses a file stream. * * Features are extracted from the "meta" box. * * @return bool True if the main features of the primary item were parsed or false. */ public function parse_file() { } } } namespace { /** * Portable PHP password hashing framework. * * @package phpass * @version 0.5 / WordPress * @link https://www.openwall.com/phpass/ * @since 2.5.0 */ class PasswordHash { var $itoa64; var $iteration_count_log2; var $portable_hashes; var $random_state; function __construct($iteration_count_log2, $portable_hashes) { } function PasswordHash($iteration_count_log2, $portable_hashes) { } function get_random_bytes($count) { } function encode64($input, $count) { } function gensalt_private($input) { } function crypt_private($password, $setting) { } function gensalt_blowfish($input) { } function HashPassword($password) { } function CheckPassword($password, $stored_hash) { } } /** * mail_fetch/setup.php * * Copyright (c) 1999-2011 CDI (cdi@thewebmasters.net) All Rights Reserved * Modified by Philippe Mingo 2001-2009 mingo@rotedic.com * An RFC 1939 compliant wrapper class for the POP3 protocol. * * Licensed under the GNU GPL. For full terms see the file COPYING. * * POP3 class * * @copyright 1999-2011 The SquirrelMail Project Team * @license https://opensource.org/licenses/gpl-license.php GNU Public License * @package plugins * @subpackage mail_fetch */ class POP3 { var $ERROR = ''; var $TIMEOUT = 60; var $COUNT = -1; var $BUFFER = 512; var $FP = ''; var $MAILSERVER = ''; var $DEBUG = \FALSE; var $BANNER = ''; var $ALLOWAPOP = \FALSE; /** * PHP5 constructor. */ function __construct($server = '', $timeout = '') { } /** * PHP4 constructor. */ public function POP3($server = '', $timeout = '') { } function update_timer() { } function connect($server, $port = 110) { } function user($user = "") { } function pass($pass = "") { } function apop($login, $pass) { } function login($login = "", $pass = "") { } function top($msgNum, $numLines = "0") { } function pop_list($msgNum = "") { } function get($msgNum) { } function last($type = "count") { } function reset() { } function send_cmd($cmd = "") { } function quit() { } function popstat() { } function uidl($msgNum = "") { } function delete($msgNum = "") { } function is_ok($cmd = "") { } function strip_clf($text = "") { } function parse_banner($server_text) { } } /** * Requests for PHP * * Inspired by Requests for Python. * * Based on concepts from SimplePie_File, RequestCore and WP_Http. * * @package Requests * * @deprecated 6.2.0 Use `WpOrg\Requests\Requests` instead for the actual functionality and * use `WpOrg\Requests\Autoload` for the autoloading. */ class Requests extends \WpOrg\Requests\Requests { /** * Deprecated autoloader for Requests. * * @deprecated 6.2.0 Use the `WpOrg\Requests\Autoload::load()` method instead. * * @codeCoverageIgnore * * @param string $class Class name to load */ public static function autoloader($class) { } /** * Register the built-in autoloader * * @deprecated 6.2.0 Include the `WpOrg\Requests\Autoload` class and * call `WpOrg\Requests\Autoload::register()` instead. * * @codeCoverageIgnore */ public static function register_autoloader() { } } /** * Core class used to create an HTML dropdown list of Categories. * * @since 2.1.0 * * @see Walker */ class Walker_CategoryDropdown extends \Walker { /** * What the class handles. * * @since 2.1.0 * @var string * * @see Walker::$tree_type */ public $tree_type = 'category'; /** * Database fields to use. * * @since 2.1.0 * @todo Decouple this * @var string[] * * @see Walker::$db_fields */ public $db_fields = array('parent' => 'parent', 'id' => 'term_id'); /** * Starts the element output. * * @since 2.1.0 * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * * @param string $output Used to append additional content (passed by reference). * @param WP_Term $data_object Category data object. * @param int $depth Depth of category. Used for padding. * @param array $args Uses 'selected', 'show_count', and 'value_field' keys, if they exist. * See wp_dropdown_categories(). * @param int $current_object_id Optional. ID of the current category. Default 0. * @phpstan-param array{ * show_option_all?: string, * show_option_none?: string, * option_none_value?: string, * orderby?: string, * pad_counts?: bool, * show_count?: bool|int, * echo?: bool|int, * hierarchical?: bool|int, * depth?: int, * tab_index?: int, * name?: string, * id?: string, * class?: string, * selected?: int|string, * value_field?: string, * taxonomy?: string|array, * hide_if_empty?: bool, * required?: bool, * walker?: Walker, * aria_describedby?: string, * } $args See wp_dropdown_categories() */ public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { } } /** * Core class used to create an HTML list of categories. * * @since 2.1.0 * * @see Walker */ class Walker_Category extends \Walker { /** * What the class handles. * * @since 2.1.0 * @var string * * @see Walker::$tree_type */ public $tree_type = 'category'; /** * Database fields to use. * * @since 2.1.0 * @var string[] * * @see Walker::$db_fields * @todo Decouple this */ public $db_fields = array('parent' => 'parent', 'id' => 'term_id'); /** * Starts the list before the elements are added. * * @since 2.1.0 * * @see Walker::start_lvl() * * @param string $output Used to append additional content. Passed by reference. * @param int $depth Optional. Depth of category. Used for tab indentation. Default 0. * @param array $args Optional. An array of arguments. Will only append content if style argument * value is 'list'. See wp_list_categories(). Default empty array. * @phpstan-param array{ * current_category?: int|int[], * depth?: int, * echo?: bool|int, * exclude?: int[]|string, * exclude_tree?: int[]|string, * feed?: string, * feed_image?: string, * feed_type?: string, * hide_title_if_empty?: bool, * separator?: string, * show_count?: bool|int, * show_option_all?: string, * show_option_none?: string, * style?: string, * taxonomy?: string, * title_li?: string, * use_desc_for_title?: bool|int, * walker?: Walker, * } $args See wp_list_categories() * @phpstan-return void */ public function start_lvl(&$output, $depth = 0, $args = array()) { } /** * Ends the list of after the elements are added. * * @since 2.1.0 * * @see Walker::end_lvl() * * @param string $output Used to append additional content. Passed by reference. * @param int $depth Optional. Depth of category. Used for tab indentation. Default 0. * @param array $args Optional. An array of arguments. Will only append content if style argument * value is 'list'. See wp_list_categories(). Default empty array. * @phpstan-param array{ * current_category?: int|int[], * depth?: int, * echo?: bool|int, * exclude?: int[]|string, * exclude_tree?: int[]|string, * feed?: string, * feed_image?: string, * feed_type?: string, * hide_title_if_empty?: bool, * separator?: string, * show_count?: bool|int, * show_option_all?: string, * show_option_none?: string, * style?: string, * taxonomy?: string, * title_li?: string, * use_desc_for_title?: bool|int, * walker?: Walker, * } $args See wp_list_categories() * @phpstan-return void */ public function end_lvl(&$output, $depth = 0, $args = array()) { } /** * Starts the element output. * * @since 2.1.0 * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * * @param string $output Used to append additional content (passed by reference). * @param WP_Term $data_object Category data object. * @param int $depth Optional. Depth of category in reference to parents. Default 0. * @param array $args Optional. An array of arguments. See wp_list_categories(). * Default empty array. * @param int $current_object_id Optional. ID of the current category. Default 0. * @phpstan-param array{ * current_category?: int|int[], * depth?: int, * echo?: bool|int, * exclude?: int[]|string, * exclude_tree?: int[]|string, * feed?: string, * feed_image?: string, * feed_type?: string, * hide_title_if_empty?: bool, * separator?: string, * show_count?: bool|int, * show_option_all?: string, * show_option_none?: string, * style?: string, * taxonomy?: string, * title_li?: string, * use_desc_for_title?: bool|int, * walker?: Walker, * } $args See wp_list_categories() * @phpstan-return void */ public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { } /** * Ends the element output, if needed. * * @since 2.1.0 * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * * @param string $output Used to append additional content (passed by reference). * @param object $data_object Category data object. Not used. * @param int $depth Optional. Depth of category. Not used. * @param array $args Optional. An array of arguments. Only uses 'list' for whether should * append to output. See wp_list_categories(). Default empty array. * @phpstan-param array{ * current_category?: int|int[], * depth?: int, * echo?: bool|int, * exclude?: int[]|string, * exclude_tree?: int[]|string, * feed?: string, * feed_image?: string, * feed_type?: string, * hide_title_if_empty?: bool, * separator?: string, * show_count?: bool|int, * show_option_all?: string, * show_option_none?: string, * style?: string, * taxonomy?: string, * title_li?: string, * use_desc_for_title?: bool|int, * walker?: Walker, * } $args See wp_list_categories() * @phpstan-return void */ public function end_el(&$output, $data_object, $depth = 0, $args = array()) { } } /** * Core walker class used to create an HTML list of comments. * * @since 2.7.0 * * @see Walker */ class Walker_Comment extends \Walker { /** * What the class handles. * * @since 2.7.0 * @var string * * @see Walker::$tree_type */ public $tree_type = 'comment'; /** * Database fields to use. * * @since 2.7.0 * @var string[] * * @see Walker::$db_fields * @todo Decouple this */ public $db_fields = array('parent' => 'comment_parent', 'id' => 'comment_ID'); /** * Starts the list before the elements are added. * * @since 2.7.0 * * @see Walker::start_lvl() * @global int $comment_depth * * @param string $output Used to append additional content (passed by reference). * @param int $depth Optional. Depth of the current comment. Default 0. * @param array $args Optional. Uses 'style' argument for type of HTML list. Default empty array. */ public function start_lvl(&$output, $depth = 0, $args = array()) { } /** * Ends the list of items after the elements are added. * * @since 2.7.0 * * @see Walker::end_lvl() * @global int $comment_depth * * @param string $output Used to append additional content (passed by reference). * @param int $depth Optional. Depth of the current comment. Default 0. * @param array $args Optional. Will only append content if style argument value is 'ol' or 'ul'. * Default empty array. */ public function end_lvl(&$output, $depth = 0, $args = array()) { } /** * Traverses elements to create list from elements. * * This function is designed to enhance Walker::display_element() to * display children of higher nesting levels than selected inline on * the highest depth level displayed. This prevents them being orphaned * at the end of the comment list. * * Example: max_depth = 2, with 5 levels of nested content. * 1 * 1.1 * 1.1.1 * 1.1.1.1 * 1.1.1.1.1 * 1.1.2 * 1.1.2.1 * 2 * 2.2 * * @since 2.7.0 * * @see Walker::display_element() * @see wp_list_comments() * * @param WP_Comment $element Comment data object. * @param array $children_elements List of elements to continue traversing. Passed by reference. * @param int $max_depth Max depth to traverse. * @param int $depth Depth of the current element. * @param array $args An array of arguments. * @param string $output Used to append additional content. Passed by reference. * @phpstan-return void */ public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) { } /** * Starts the element output. * * @since 2.7.0 * @since 5.9.0 Renamed `$comment` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * @see wp_list_comments() * @global int $comment_depth * @global WP_Comment $comment Global comment object. * * @param string $output Used to append additional content. Passed by reference. * @param WP_Comment $data_object Comment data object. * @param int $depth Optional. Depth of the current comment in reference to parents. Default 0. * @param array $args Optional. An array of arguments. Default empty array. * @param int $current_object_id Optional. ID of the current comment. Default 0. * @phpstan-return void */ public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { } /** * Ends the element output, if needed. * * @since 2.7.0 * @since 5.9.0 Renamed `$comment` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * @see wp_list_comments() * * @param string $output Used to append additional content. Passed by reference. * @param WP_Comment $data_object Comment data object. * @param int $depth Optional. Depth of the current comment. Default 0. * @param array $args Optional. An array of arguments. Default empty array. * @phpstan-return void */ public function end_el(&$output, $data_object, $depth = 0, $args = array()) { } /** * Outputs a pingback comment. * * @since 3.6.0 * * @see wp_list_comments() * * @param WP_Comment $comment The comment object. * @param int $depth Depth of the current comment. * @param array $args An array of arguments. */ protected function ping($comment, $depth, $args) { } /** * Filters the comment text. * * Removes links from the pending comment's text if the commenter did not consent * to the comment cookies. * * @since 5.4.2 * * @param string $comment_text Text of the current comment. * @param WP_Comment|null $comment The comment object. Null if not found. * @return string Filtered text of the current comment. */ public function filter_comment_text($comment_text, $comment) { } /** * Outputs a single comment. * * @since 3.6.0 * * @see wp_list_comments() * * @param WP_Comment $comment Comment to display. * @param int $depth Depth of the current comment. * @param array $args An array of arguments. */ protected function comment($comment, $depth, $args) { } /** * Outputs a comment in the HTML5 format. * * @since 3.6.0 * * @see wp_list_comments() * * @param WP_Comment $comment Comment to display. * @param int $depth Depth of the current comment. * @param array $args An array of arguments. */ protected function html5_comment($comment, $depth, $args) { } } /** * Core class used to create an HTML drop-down list of pages. * * @since 2.1.0 * * @see Walker */ class Walker_PageDropdown extends \Walker { /** * What the class handles. * * @since 2.1.0 * @var string * * @see Walker::$tree_type */ public $tree_type = 'page'; /** * Database fields to use. * * @since 2.1.0 * @var string[] * * @see Walker::$db_fields * @todo Decouple this */ public $db_fields = array('parent' => 'post_parent', 'id' => 'ID'); /** * Starts the element output. * * @since 2.1.0 * @since 5.9.0 Renamed `$page` to `$data_object` and `$id` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * * @param string $output Used to append additional content. Passed by reference. * @param WP_Post $data_object Page data object. * @param int $depth Optional. Depth of page in reference to parent pages. * Used for padding. Default 0. * @param array $args Optional. Uses 'selected' argument for selected page to * set selected HTML attribute for option element. Uses * 'value_field' argument to fill "value" attribute. * See wp_dropdown_pages(). Default empty array. * @param int $current_object_id Optional. ID of the current page. Default 0. * @phpstan-param array{ * depth?: int, * child_of?: int, * selected?: int|string, * echo?: bool|int, * name?: string, * id?: string, * class?: string, * show_option_none?: string, * show_option_no_change?: string, * option_none_value?: string, * value_field?: string, * } $args See wp_dropdown_pages() */ public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { } } /** * Core walker class used to create an HTML list of pages. * * @since 2.1.0 * * @see Walker */ class Walker_Page extends \Walker { /** * What the class handles. * * @since 2.1.0 * @var string * * @see Walker::$tree_type */ public $tree_type = 'page'; /** * Database fields to use. * * @since 2.1.0 * @var string[] * * @see Walker::$db_fields * @todo Decouple this. */ public $db_fields = array('parent' => 'post_parent', 'id' => 'ID'); /** * Outputs the beginning of the current level in the tree before elements are output. * * @since 2.1.0 * * @see Walker::start_lvl() * * @param string $output Used to append additional content (passed by reference). * @param int $depth Optional. Depth of page. Used for padding. Default 0. * @param array $args Optional. Arguments for outputting the next level. * Default empty array. */ public function start_lvl(&$output, $depth = 0, $args = array()) { } /** * Outputs the end of the current level in the tree after elements are output. * * @since 2.1.0 * * @see Walker::end_lvl() * * @param string $output Used to append additional content (passed by reference). * @param int $depth Optional. Depth of page. Used for padding. Default 0. * @param array $args Optional. Arguments for outputting the end of the current level. * Default empty array. */ public function end_lvl(&$output, $depth = 0, $args = array()) { } /** * Outputs the beginning of the current element in the tree. * * @see Walker::start_el() * @since 2.1.0 * @since 5.9.0 Renamed `$page` to `$data_object` and `$current_page` to `$current_object_id` * to match parent class for PHP 8 named parameter support. * * @param string $output Used to append additional content. Passed by reference. * @param WP_Post $data_object Page data object. * @param int $depth Optional. Depth of page. Used for padding. Default 0. * @param array $args Optional. Array of arguments. Default empty array. * @param int $current_object_id Optional. ID of the current page. Default 0. */ public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { } /** * Outputs the end of the current element in the tree. * * @since 2.1.0 * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * * @param string $output Used to append additional content. Passed by reference. * @param WP_Post $data_object Page data object. Not used. * @param int $depth Optional. Depth of page. Default 0 (unused). * @param array $args Optional. Array of arguments. Default empty array. */ public function end_el(&$output, $data_object, $depth = 0, $args = array()) { } } /** * Core class used to implement the Toolbar API. * * @since 3.1.0 */ #[\AllowDynamicProperties] class WP_Admin_Bar { public $user; /** * Deprecated menu property. * * @since 3.1.0 * @deprecated 3.3.0 Modify admin bar nodes with WP_Admin_Bar::get_node(), * WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(). * @var array */ public $menu = array(); /** * Initializes the admin bar. * * @since 3.1.0 */ public function initialize() { } /** * Adds a node (menu item) to the admin bar menu. * * @since 3.3.0 * * @param array $node The attributes that define the node. */ public function add_menu($node) { } /** * Removes a node from the admin bar. * * @since 3.1.0 * * @param string $id The menu slug to remove. */ public function remove_menu($id) { } /** * Adds a node to the menu. * * @since 3.1.0 * @since 4.5.0 Added the ability to pass 'lang' and 'dir' meta data. * @since 6.5.0 Added the ability to pass 'menu_title' for an ARIA menu name. * * @param array $args { * Arguments for adding a node. * * @type string $id ID of the item. * @type string $title Title of the node. * @type string $parent Optional. ID of the parent node. * @type string $href Optional. Link for the item. * @type bool $group Optional. Whether or not the node is a group. Default false. * @type array $meta Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir', * 'onclick', 'target', 'title', 'tabindex', 'menu_title'. Default empty. * } * @phpstan-param array{ * id?: string, * title?: string, * parent?: string, * href?: string, * group?: bool, * meta?: array, * } $args * @phpstan-return void */ public function add_node($args) { } /** * @since 3.3.0 * * @param array $args */ protected final function _set_node($args) { } /** * Gets a node. * * @since 3.3.0 * * @param string $id * @return object|void Node. */ public final function get_node($id) { } /** * @since 3.3.0 * * @param string $id * @return object|void */ protected final function _get_node($id) { } /** * @since 3.3.0 * * @return array|void */ public final function get_nodes() { } /** * @since 3.3.0 * * @return array|void */ protected final function _get_nodes() { } /** * Adds a group to a toolbar menu node. * * Groups can be used to organize toolbar items into distinct sections of a toolbar menu. * * @since 3.3.0 * * @param array $args { * Array of arguments for adding a group. * * @type string $id ID of the item. * @type string $parent Optional. ID of the parent node. Default 'root'. * @type array $meta Meta data for the group including the following keys: * 'class', 'onclick', 'target', and 'title'. * } * @phpstan-param array{ * id?: string, * parent?: string, * meta?: array, * } $args */ public final function add_group($args) { } /** * Remove a node. * * @since 3.1.0 * * @param string $id The ID of the item. */ public function remove_node($id) { } /** * @since 3.3.0 * * @param string $id */ protected final function _unset_node($id) { } /** * @since 3.1.0 */ public function render() { } /** * @since 3.3.0 * * @return object|void */ protected final function _bind() { } /** * @since 3.3.0 * * @param object $root */ protected final function _render($root) { } /** * @since 3.3.0 * * @param object $node * @phpstan-return void */ protected final function _render_container($node) { } /** * @since 3.3.0 * @since 6.5.0 Added `$menu_title` parameter to allow an ARIA menu name. * * @param object $node * @param string|bool $menu_title The accessible name of this ARIA menu or false if not provided. * @phpstan-return void */ protected final function _render_group($node, $menu_title = \false) { } /** * @since 3.3.0 * * @param object $node * @phpstan-return void */ protected final function _render_item($node) { } /** * Renders toolbar items recursively. * * @since 3.1.0 * @deprecated 3.3.0 Use WP_Admin_Bar::_render_item() or WP_Admin_bar::render() instead. * @see WP_Admin_Bar::_render_item() * @see WP_Admin_Bar::render() * * @param string $id Unused. * @param object $node */ public function recursive_render($id, $node) { } /** * Adds menus to the admin bar. * * @since 3.1.0 */ public function add_menus() { } } /** * Send XML response back to Ajax request. * * @package WordPress * @since 2.1.0 */ #[\AllowDynamicProperties] class WP_Ajax_Response { /** * Store XML responses to send. * * @since 2.1.0 * @var array */ public $responses = array(); /** * Constructor - Passes args to WP_Ajax_Response::add(). * * @since 2.1.0 * * @see WP_Ajax_Response::add() * * @param string|array $args Optional. Will be passed to add() method. */ public function __construct($args = '') { } /** * Appends data to an XML response based on given arguments. * * With `$args` defaults, extra data output would be: * * <response action='{$action}_$id'> * <$what id='$id' position='$position'> * <response_data><![CDATA[$data]]></response_data> * </$what> * </response> * * @since 2.1.0 * * @param string|array $args { * Optional. An array or string of XML response arguments. * * @type string $what XML-RPC response type. Used as a child element of `<response>`. * Default 'object' (`<object>`). * @type string|false $action Value to use for the `action` attribute in `<response>`. Will be * appended with `_$id` on output. If false, `$action` will default to * the value of `$_POST['action']`. Default false. * @type int|WP_Error $id The response ID, used as the response type `id` attribute. Also * accepts a `WP_Error` object if the ID does not exist. Default 0. * @type int|false $old_id The previous response ID. Used as the value for the response type * `old_id` attribute. False hides the attribute. Default false. * @type string $position Value of the response type `position` attribute. Accepts 1 (bottom), * -1 (top), HTML ID (after), or -HTML ID (before). Default 1 (bottom). * @type string|WP_Error $data The response content/message. Also accepts a WP_Error object if the * ID does not exist. Default empty. * @type array $supplemental An array of extra strings that will be output within a `<supplemental>` * element as CDATA. Default empty array. * } * @return string XML response. * @phpstan-param array{ * what?: string, * action?: string|false, * id?: int|WP_Error, * old_id?: int|false, * position?: string, * data?: string|WP_Error, * supplemental?: array, * } $args */ public function add($args = '') { } /** * Display XML formatted responses. * * Sets the content type header to text/xml. * * @since 2.1.0 */ public function send() { } } /** * Class for displaying, modifying, and sanitizing application passwords. * * @package WordPress */ #[\AllowDynamicProperties] class WP_Application_Passwords { /** * The application passwords user meta key. * * @since 5.6.0 * * @var string */ const USERMETA_KEY_APPLICATION_PASSWORDS = '_application_passwords'; /** * The option name used to store whether application passwords are in use. * * @since 5.6.0 * * @var string */ const OPTION_KEY_IN_USE = 'using_application_passwords'; /** * The generated application password length. * * @since 5.6.0 * * @var int */ const PW_LENGTH = 24; /** * Checks if application passwords are being used by the site. * * This returns true if at least one application password has ever been created. * * @since 5.6.0 * * @return bool */ public static function is_in_use() { } /** * Creates a new application password. * * @since 5.6.0 * @since 5.7.0 Returns WP_Error if application name already exists. * * @param int $user_id User ID. * @param array $args { * Arguments used to create the application password. * * @type string $name The name of the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * } * @return array|WP_Error { * Application password details, or a WP_Error instance if an error occurs. * * @type string $0 The generated application password in plain text. * @type array $1 { * The details about the created password. * * @type string $uuid The unique identifier for the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $name The name of the application password. * @type string $password A one-way hash of the password. * @type int $created Unix timestamp of when the password was created. * @type null $last_used Null. * @type null $last_ip Null. * } * } * @phpstan-param array{ * name?: string, * app_id?: string, * } $args * @phpstan-return \WP_Error|array{ * 0: string, * 1: array{ * uuid: string, * app_id: string, * name: string, * password: string, * created: int, * last_used: null, * last_ip: null, * }, * } */ public static function create_new_application_password($user_id, $args = array()) { } /** * Gets a user's application passwords. * * @since 5.6.0 * * @param int $user_id User ID. * @return array { * The list of application passwords. * * @type array ...$0 { * @type string $uuid The unique identifier for the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $name The name of the application password. * @type string $password A one-way hash of the password. * @type int $created Unix timestamp of when the password was created. * @type int|null $last_used The Unix timestamp of the GMT date the application password was last used. * @type string|null $last_ip The IP address the application password was last used by. * } * } * @phpstan-return array<int|string, array{ * uuid: string, * app_id: string, * name: string, * password: string, * created: int, * last_used: int|null, * last_ip: string|null, * }> */ public static function get_user_application_passwords($user_id) { } /** * Gets a user's application password with the given UUID. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @return array|null { * The application password if found, null otherwise. * * @type string $uuid The unique identifier for the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $name The name of the application password. * @type string $password A one-way hash of the password. * @type int $created Unix timestamp of when the password was created. * @type int|null $last_used The Unix timestamp of the GMT date the application password was last used. * @type string|null $last_ip The IP address the application password was last used by. * } * @phpstan-return null|array{ * uuid: string, * app_id: string, * name: string, * password: string, * created: int, * last_used: int|null, * last_ip: string|null, * } */ public static function get_user_application_password($user_id, $uuid) { } /** * Checks if an application password with the given name exists for this user. * * @since 5.7.0 * * @param int $user_id User ID. * @param string $name Application name. * @return bool Whether the provided application name exists. */ public static function application_name_exists_for_user($user_id, $name) { } /** * Updates an application password. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @param array $update { * Information about the application password to update. * * @type string $uuid The unique identifier for the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $name The name of the application password. * @type string $password A one-way hash of the password. * @type int $created Unix timestamp of when the password was created. * @type int|null $last_used The Unix timestamp of the GMT date the application password was last used. * @type string|null $last_ip The IP address the application password was last used by. * } * @return true|WP_Error True if successful, otherwise a WP_Error instance is returned on error. * @phpstan-param array{ * uuid?: string, * app_id?: string, * name?: string, * password?: string, * created?: int, * last_used?: int|null, * last_ip?: string|null, * } $update */ public static function update_application_password($user_id, $uuid, $update = array()) { } /** * Records that an application password has been used. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @return true|WP_Error True if the usage was recorded, a WP_Error if an error occurs. */ public static function record_application_password_usage($user_id, $uuid) { } /** * Deletes an application password. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @return true|WP_Error Whether the password was successfully found and deleted, a WP_Error otherwise. */ public static function delete_application_password($user_id, $uuid) { } /** * Deletes all application passwords for the given user. * * @since 5.6.0 * * @param int $user_id User ID. * @return int|WP_Error The number of passwords that were deleted or a WP_Error on failure. */ public static function delete_all_application_passwords($user_id) { } /** * Sets a user's application passwords. * * @since 5.6.0 * * @param int $user_id User ID. * @param array $passwords { * The list of application passwords. * * @type array ...$0 { * @type string $uuid The unique identifier for the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $name The name of the application password. * @type string $password A one-way hash of the password. * @type int $created Unix timestamp of when the password was created. * @type int|null $last_used The Unix timestamp of the GMT date the application password was last used. * @type string|null $last_ip The IP address the application password was last used by. * } * } * @return int|bool User meta ID if the key didn't exist (ie. this is the first time that an application password * has been saved for the user), true on successful update, false on failure or if the value passed * is the same as the one that is already in the database. * @phpstan-param array<int|string, array{ * uuid: string, * app_id: string, * name: string, * password: string, * created: int, * last_used: int|null, * last_ip: string|null, * }> $passwords */ protected static function set_user_application_passwords($user_id, $passwords) { } /** * Sanitizes and then splits a password into smaller chunks. * * @since 5.6.0 * * @param string $raw_password The raw application password. * @return string The chunked password. */ public static function chunk_password($raw_password) { } } /** * Core class used for interacting with block bindings sources. * * @since 6.5.0 */ final class WP_Block_Bindings_Registry { /** * Registers a new block bindings source. * * This is a low-level method. For most use cases, it is recommended to use * the `register_block_bindings_source()` function instead. * * @see register_block_bindings_source() * * Sources are used to override block's original attributes with a value * coming from the source. Once a source is registered, it can be used by a * block by setting its `metadata.bindings` attribute to a value that refers * to the source. * * @since 6.5.0 * * @param string $source_name The name of the source. It must be a string containing a namespace prefix, i.e. * `my-plugin/my-custom-source`. It must only contain lowercase alphanumeric * characters, the forward slash `/` and dashes. * @param array $source_properties { * The array of arguments that are used to register a source. * * @type string $label The label of the source. * @type callable $get_value_callback A callback executed when the source is processed during block rendering. * The callback should have the following signature: * * `function( $source_args, $block_instance, $attribute_name ): mixed` * - @param array $source_args Array containing source arguments * used to look up the override value, * i.e. {"key": "foo"}. * - @param WP_Block $block_instance The block instance. * - @param string $attribute_name The name of the target attribute. * The callback has a mixed return type; it may return a string to override * the block's original value, null, false to remove an attribute, etc. * @type string[] $uses_context Optional. Array of values to add to block `uses_context` needed by the source. * } * @return WP_Block_Bindings_Source|false Source when the registration was successful, or `false` on failure. * @phpstan-param array{ * label?: string, * get_value_callback?: callable, * uses_context?: string[], * } $source_properties */ public function register(string $source_name, array $source_properties) { } /** * Unregisters a block bindings source. * * @since 6.5.0 * * @param string $source_name Block bindings source name including namespace. * @return WP_Block_Bindings_Source|false The unregistered block bindings source on success and `false` otherwise. */ public function unregister(string $source_name) { } /** * Retrieves the list of all registered block bindings sources. * * @since 6.5.0 * * @return WP_Block_Bindings_Source[] The array of registered sources. */ public function get_all_registered() { } /** * Retrieves a registered block bindings source. * * @since 6.5.0 * * @param string $source_name The name of the source. * @return WP_Block_Bindings_Source|null The registered block bindings source, or `null` if it is not registered. */ public function get_registered(string $source_name) { } /** * Checks if a block bindings source is registered. * * @since 6.5.0 * * @param string $source_name The name of the source. * @return bool `true` if the block bindings source is registered, `false` otherwise. */ public function is_registered($source_name) { } /** * Wakeup magic method. * * @since 6.5.0 * @phpstan-return void */ public function __wakeup() { } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 6.5.0 * * @return WP_Block_Bindings_Registry The main instance. */ public static function get_instance() { } } /** * Class representing block bindings source. * * This class is designed for internal use by the Block Bindings registry. * * @since 6.5.0 * @access private * * @see WP_Block_Bindings_Registry */ final class WP_Block_Bindings_Source { /** * The name of the source. * * @since 6.5.0 * @var string */ public $name; /** * The label of the source. * * @since 6.5.0 * @var string */ public $label; /** * The context added to the blocks needed by the source. * * @since 6.5.0 * @var string[]|null */ public $uses_context = \null; /** * Constructor. * * Do not use this constructor directly. Instead, use the * `WP_Block_Bindings_Registry::register` method or the `register_block_bindings_source` function. * * @since 6.5.0 * * @param string $name The name of the source. * @param array $source_properties The properties of the source. */ public function __construct(string $name, array $source_properties) { } /** * Calls the callback function specified in the `$get_value_callback` property * with the given arguments and returns the result. It can be modified with * `block_bindings_source_value` filter. * * @since 6.5.0 * @since 6.7.0 `block_bindings_source_value` filter was added. * * @param array $source_args Array containing source arguments used to look up the override value, i.e. {"key": "foo"}. * @param WP_Block $block_instance The block instance. * @param string $attribute_name The name of the target attribute. * @return mixed The value of the source. */ public function get_value(array $source_args, $block_instance, string $attribute_name) { } /** * Wakeup magic method. * * @since 6.5.0 */ public function __wakeup() { } } /** * Contains information about a block editor being rendered. * * @since 5.8.0 */ #[\AllowDynamicProperties] final class WP_Block_Editor_Context { /** * String that identifies the block editor being rendered. Can be one of: * * - `'core/edit-post'` - The post editor at `/wp-admin/edit.php`. * - `'core/edit-widgets'` - The widgets editor at `/wp-admin/widgets.php`. * - `'core/customize-widgets'` - The widgets editor at `/wp-admin/customize.php`. * - `'core/edit-site'` - The site editor at `/wp-admin/site-editor.php`. * * Defaults to 'core/edit-post'. * * @since 6.0.0 * * @var string */ public $name = 'core/edit-post'; /** * The post being edited by the block editor. Optional. * * @since 5.8.0 * * @var WP_Post|null */ public $post = \null; /** * Constructor. * * Populates optional properties for a given block editor context. * * @since 5.8.0 * * @param array $settings The list of optional settings to expose in a given context. */ public function __construct(array $settings = array()) { } } /** * Class representing a list of block instances. * * @since 5.5.0 * @phpstan-implements ArrayAccess<int, WP_Block> */ #[\AllowDynamicProperties] class WP_Block_List implements \Iterator, \ArrayAccess, \Countable { /** * Original array of parsed block data, or block instances. * * @since 5.5.0 * @var array[]|WP_Block[] * @access protected */ protected $blocks; /** * All available context of the current hierarchy. * * @since 5.5.0 * @var array * @access protected */ protected $available_context; /** * Block type registry to use in constructing block instances. * * @since 5.5.0 * @var WP_Block_Type_Registry * @access protected */ protected $registry; /** * Constructor. * * Populates object properties from the provided block instance argument. * * @since 5.5.0 * * @param array[]|WP_Block[] $blocks Array of parsed block data, or block instances. * @param array $available_context Optional array of ancestry context values. * @param WP_Block_Type_Registry $registry Optional block type registry. */ public function __construct($blocks, $available_context = array(), $registry = \null) { } /** * Returns true if a block exists by the specified block offset, or false * otherwise. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetexists.php * * @param string $offset Offset of block to check for. * @return bool Whether block exists. * @phpstan-param int $offset */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Returns the value by the specified block offset. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetget.php * * @param string $offset Offset of block value to retrieve. * @return mixed|null Block value if exists, or null. * @phpstan-param int $offset * @phpstan-return WP_Block|null */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } /** * Assign a block value by the specified block offset. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetset.php * * @param string $offset Offset of block value to set. * @param mixed $value Block value. * @phpstan-param int|null $offset * @phpstan-return void */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } /** * Unset a block. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetunset.php * * @param string $offset Offset of block value to unset. * @phpstan-param int $offset * @phpstan-return void */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { } /** * Rewinds back to the first element of the Iterator. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.rewind.php */ #[\ReturnTypeWillChange] public function rewind() { } /** * Returns the current element of the block list. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.current.php * * @return mixed Current element. */ #[\ReturnTypeWillChange] public function current() { } /** * Returns the key of the current element of the block list. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.key.php * * @return mixed Key of the current element. */ #[\ReturnTypeWillChange] public function key() { } /** * Moves the current position of the block list to the next element. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.next.php */ #[\ReturnTypeWillChange] public function next() { } /** * Checks if current position is valid. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.valid.php */ #[\ReturnTypeWillChange] public function valid() { } /** * Returns the count of blocks in the list. * * @since 5.5.0 * * @link https://www.php.net/manual/en/countable.count.php * * @return int Block count. */ #[\ReturnTypeWillChange] public function count() { } } /** * Class used for managing block metadata collections. * * The WP_Block_Metadata_Registry allows plugins to register metadata for large * collections of blocks (e.g., 50-100+) using a single PHP file. This approach * reduces the need to read and decode multiple `block.json` files, enhancing * performance through opcode caching. * * @since 6.7.0 */ class WP_Block_Metadata_Registry { /** * Registers a block metadata collection. * * This method allows registering a collection of block metadata from a single * manifest file, improving performance for large sets of blocks. * * The manifest file should be a PHP file that returns an associative array, where * the keys are the block identifiers (without their namespace) and the values are * the corresponding block metadata arrays. The block identifiers must match the * parent directory name for the respective `block.json` file. * * Example manifest file structure: * ``` * return array( * 'example-block' => array( * 'title' => 'Example Block', * 'category' => 'widgets', * 'icon' => 'smiley', * // ... other block metadata * ), * 'another-block' => array( * 'title' => 'Another Block', * 'category' => 'formatting', * 'icon' => 'star-filled', * // ... other block metadata * ), * // ... more block metadata entries * ); * ``` * * @since 6.7.0 * * @param string $path The absolute base path for the collection ( e.g., WP_PLUGIN_DIR . '/my-plugin/blocks/' ). * @param string $manifest The absolute path to the manifest file containing the metadata collection. * @return bool True if the collection was registered successfully, false otherwise. */ public static function register_collection($path, $manifest) { } /** * Retrieves block metadata for a given block within a specific collection. * * This method uses the registered collections to efficiently lookup * block metadata without reading individual `block.json` files. * * @since 6.7.0 * * @param string $file_or_folder The path to the file or folder containing the block. * @return array|null The block metadata for the block, or null if not found. */ public static function get_metadata($file_or_folder) { } /** * Checks if metadata exists for a given block name in a specific collection. * * @since 6.7.0 * * @param string $file_or_folder The path to the file or folder containing the block metadata. * @return bool True if metadata exists for the block, false otherwise. */ public static function has_metadata($file_or_folder) { } } /** * Class WP_Block_Parser_Block * * Holds the block structure in memory * * @since 5.0.0 */ class WP_Block_Parser_Block { /** * Name of block * * @example "core/paragraph" * * @since 5.0.0 * @var string */ public $blockName; /** * Optional set of attributes from block comment delimiters * * @example null * @example array( 'columns' => 3 ) * * @since 5.0.0 * @var array|null */ public $attrs; /** * List of inner blocks (of this same class) * * @since 5.0.0 * @var WP_Block_Parser_Block[] */ public $innerBlocks; /** * Resultant HTML from inside block comment delimiters * after removing inner blocks * * @example "...Just <!-- wp:test /--> testing..." -> "Just testing..." * * @since 5.0.0 * @var string */ public $innerHTML; /** * List of string fragments and null markers where inner blocks were found * * @example array( * 'innerHTML' => 'BeforeInnerAfter', * 'innerBlocks' => array( block, block ), * 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ), * ) * * @since 4.2.0 * @var array */ public $innerContent; /** * Constructor. * * Will populate object properties from the provided arguments. * * @since 5.0.0 * * @param string $name Name of block. * @param array $attrs Optional set of attributes from block comment delimiters. * @param array $inner_blocks List of inner blocks (of this same class). * @param string $inner_html Resultant HTML from inside block comment delimiters after removing inner blocks. * @param array $inner_content List of string fragments and null markers where inner blocks were found. */ public function __construct($name, $attrs, $inner_blocks, $inner_html, $inner_content) { } } /** * Class WP_Block_Parser_Frame * * Holds partial blocks in memory while parsing * * @internal * @since 5.0.0 */ class WP_Block_Parser_Frame { /** * Full or partial block * * @since 5.0.0 * @var WP_Block_Parser_Block */ public $block; /** * Byte offset into document for start of parse token * * @since 5.0.0 * @var int */ public $token_start; /** * Byte length of entire parse token string * * @since 5.0.0 * @var int */ public $token_length; /** * Byte offset into document for after parse token ends * (used during reconstruction of stack into parse production) * * @since 5.0.0 * @var int */ public $prev_offset; /** * Byte offset into document where leading HTML before token starts * * @since 5.0.0 * @var int */ public $leading_html_start; /** * Constructor * * Will populate object properties from the provided arguments. * * @since 5.0.0 * * @param WP_Block_Parser_Block $block Full or partial block. * @param int $token_start Byte offset into document for start of parse token. * @param int $token_length Byte length of entire parse token string. * @param int|null $prev_offset Optional. Byte offset into document for after parse token ends. Default null. * @param int|null $leading_html_start Optional. Byte offset into document where leading HTML before token starts. * Default null. */ public function __construct($block, $token_start, $token_length, $prev_offset = \null, $leading_html_start = \null) { } } /** * Class WP_Block_Parser * * Parses a document and constructs a list of parsed block objects * * @since 5.0.0 * @since 4.0.0 returns arrays not objects, all attributes are arrays */ class WP_Block_Parser { /** * Input document being parsed * * @example "Pre-text\n<!-- wp:paragraph -->This is inside a block!<!-- /wp:paragraph -->" * * @since 5.0.0 * @var string */ public $document; /** * Tracks parsing progress through document * * @since 5.0.0 * @var int */ public $offset; /** * List of parsed blocks * * @since 5.0.0 * @var WP_Block_Parser_Block[] */ public $output; /** * Stack of partially-parsed structures in memory during parse * * @since 5.0.0 * @var WP_Block_Parser_Frame[] */ public $stack; /** * Parses a document and returns a list of block structures * * When encountering an invalid parse will return a best-effort * parse. In contrast to the specification parser this does not * return an error on invalid inputs. * * @since 5.0.0 * * @param string $document Input document being parsed. * @return array[] */ public function parse($document) { } /** * Processes the next token from the input document * and returns whether to proceed eating more tokens * * This is the "next step" function that essentially * takes a token as its input and decides what to do * with that token before descending deeper into a * nested block tree or continuing along the document * or breaking out of a level of nesting. * * @internal * @since 5.0.0 * @return bool */ public function proceed() { } /** * Scans the document from where we last left off * and finds the next valid token to parse if it exists * * Returns the type of the find: kind of find, block information, attributes * * @internal * @since 5.0.0 * @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments * @return array */ public function next_token() { } /** * Returns a new block object for freeform HTML * * @internal * @since 3.9.0 * * @param string $inner_html HTML content of block. * @return WP_Block_Parser_Block freeform block object. */ public function freeform($inner_html) { } /** * Pushes a length of text from the input document * to the output list as a freeform block. * * @internal * @since 5.0.0 * @param null $length how many bytes of document text to output. * @phpstan-return void */ public function add_freeform($length = \null) { } /** * Given a block structure from memory pushes * a new block to the output list. * * @internal * @since 5.0.0 * @param WP_Block_Parser_Block $block The block to add to the output. * @param int $token_start Byte offset into the document where the first token for the block starts. * @param int $token_length Byte length of entire block from start of opening token to end of closing token. * @param int|null $last_offset Last byte offset into document if continuing form earlier output. */ public function add_inner_block(\WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = \null) { } /** * Pushes the top block from the parsing stack to the output list. * * @internal * @since 5.0.0 * @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML. */ public function add_block_from_stack($end_offset = \null) { } } /** * Class used for interacting with block pattern categories. */ #[\AllowDynamicProperties] final class WP_Block_Pattern_Categories_Registry { /** * Registers a pattern category. * * @since 5.5.0 * * @param string $category_name Pattern category name including namespace. * @param array $category_properties { * List of properties for the block pattern category. * * @type string $label Required. A human-readable label for the pattern category. * } * @return bool True if the pattern was registered with success and false otherwise. * @phpstan-param array{ * label?: string, * } $category_properties */ public function register($category_name, $category_properties) { } /** * Unregisters a pattern category. * * @since 5.5.0 * * @param string $category_name Pattern category name including namespace. * @return bool True if the pattern was unregistered with success and false otherwise. */ public function unregister($category_name) { } /** * Retrieves an array containing the properties of a registered pattern category. * * @since 5.5.0 * * @param string $category_name Pattern category name including namespace. * @return array Registered pattern properties. */ public function get_registered($category_name) { } /** * Retrieves all registered pattern categories. * * @since 5.5.0 * * @param bool $outside_init_only Return only categories registered outside the `init` action. * @return array[] Array of arrays containing the registered pattern categories properties. */ public function get_all_registered($outside_init_only = \false) { } /** * Checks if a pattern category is registered. * * @since 5.5.0 * * @param string $category_name Pattern category name including namespace. * @return bool True if the pattern category is registered, false otherwise. */ public function is_registered($category_name) { } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.5.0 * * @return WP_Block_Pattern_Categories_Registry The main instance. */ public static function get_instance() { } } /** * Class used for interacting with block patterns. * * @since 5.5.0 */ #[\AllowDynamicProperties] final class WP_Block_Patterns_Registry { /** * Registers a block pattern. * * @since 5.5.0 * @since 5.8.0 Added support for the `blockTypes` property. * @since 6.1.0 Added support for the `postTypes` property. * @since 6.2.0 Added support for the `templateTypes` property. * @since 6.5.0 Added support for the `filePath` property. * * @param string $pattern_name Block pattern name including namespace. * @param array $pattern_properties { * List of properties for the block pattern. * * @type string $title Required. A human-readable title for the pattern. * @type string $content Optional. Block HTML markup for the pattern. * If not provided, the content will be retrieved from the `filePath` if set. * If both `content` and `filePath` are not set, the pattern will not be registered. * @type string $description Optional. Visually hidden text used to describe the pattern * in the inserter. A description is optional, but is strongly * encouraged when the title does not fully describe what the * pattern does. The description will help users discover the * pattern while searching. * @type int $viewportWidth Optional. The intended width of the pattern to allow for a scaled * preview within the pattern inserter. * @type bool $inserter Optional. Determines whether the pattern is visible in inserter. * To hide a pattern so that it can only be inserted programmatically, * set this to false. Default true. * @type string[] $categories Optional. A list of registered pattern categories used to group * block patterns. Block patterns can be shown on multiple categories. * A category must be registered separately in order to be used here. * @type string[] $keywords Optional. A list of aliases or keywords that help users discover * the pattern while searching. * @type string[] $blockTypes Optional. A list of block names including namespace that could use * the block pattern in certain contexts (placeholder, transforms). * The block pattern is available in the block editor inserter * regardless of this list of block names. * Certain blocks support further specificity besides the block name * (e.g. for `core/template-part` you can specify areas * like `core/template-part/header` or `core/template-part/footer`). * @type string[] $postTypes Optional. An array of post types that the pattern is restricted * to be used with. The pattern will only be available when editing one * of the post types passed on the array. For all the other post types * not part of the array the pattern is not available at all. * @type string[] $templateTypes Optional. An array of template types where the pattern fits. * @type string $filePath Optional. The full path to the file containing the block pattern content. * } * @return bool True if the pattern was registered with success and false otherwise. * @phpstan-param array{ * title?: string, * content?: string, * description?: string, * viewportWidth?: int, * inserter?: bool, * categories?: string[], * keywords?: string[], * blockTypes?: string[], * postTypes?: string[], * templateTypes?: string[], * filePath?: string, * } $pattern_properties */ public function register($pattern_name, $pattern_properties) { } /** * Unregisters a block pattern. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @return bool True if the pattern was unregistered with success and false otherwise. */ public function unregister($pattern_name) { } /** * Retrieves an array containing the properties of a registered block pattern. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @return array Registered pattern properties. */ public function get_registered($pattern_name) { } /** * Retrieves all registered block patterns. * * @since 5.5.0 * * @param bool $outside_init_only Return only patterns registered outside the `init` action. * @return array[] Array of arrays containing the registered block patterns properties, * and per style. */ public function get_all_registered($outside_init_only = \false) { } /** * Checks if a block pattern is registered. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @return bool True if the pattern is registered, false otherwise. */ public function is_registered($pattern_name) { } public function __wakeup() { } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.5.0 * * @return WP_Block_Patterns_Registry The main instance. */ public static function get_instance() { } } /** * Class used for interacting with block styles. * * @since 5.3.0 */ #[\AllowDynamicProperties] final class WP_Block_Styles_Registry { /** * Registers a block style for the given block type. * * If the block styles are present in a standalone stylesheet, register it and pass * its handle as the `style_handle` argument. If the block styles should be inline, * use the `inline_style` argument. Usually, one of them would be used to pass CSS * styles. However, you could also skip them and provide CSS styles in any stylesheet * or with an inline tag. * * @since 5.3.0 * @since 6.6.0 Added ability to register style across multiple block types along with theme.json-like style data. * * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/ * * @param string|string[] $block_name Block type name including namespace or array of namespaced block type names. * @param array $style_properties { * Array containing the properties of the style. * * @type string $name The identifier of the style used to compute a CSS class. * @type string $label A human-readable label for the style. * @type string $inline_style Inline CSS code that registers the CSS class required * for the style. * @type string $style_handle The handle to an already registered style that should be * enqueued in places where block styles are needed. * @type bool $is_default Whether this is the default style for the block type. * @type array $style_data Theme.json-like object to generate CSS from. * } * @return bool True if the block style was registered with success and false otherwise. * @phpstan-param array{ * name?: string, * label?: string, * inline_style?: string, * style_handle?: string, * is_default?: bool, * style_data?: array, * } $style_properties */ public function register($block_name, $style_properties) { } /** * Unregisters a block style of the given block type. * * @since 5.3.0 * * @param string $block_name Block type name including namespace. * @param string $block_style_name Block style name. * @return bool True if the block style was unregistered with success and false otherwise. */ public function unregister($block_name, $block_style_name) { } /** * Retrieves the properties of a registered block style for the given block type. * * @since 5.3.0 * * @param string $block_name Block type name including namespace. * @param string $block_style_name Block style name. * @return array Registered block style properties. */ public function get_registered($block_name, $block_style_name) { } /** * Retrieves all registered block styles. * * @since 5.3.0 * * @return array[] Array of arrays containing the registered block styles properties grouped by block type. */ public function get_all_registered() { } /** * Retrieves registered block styles for a specific block type. * * @since 5.3.0 * * @param string $block_name Block type name including namespace. * @return array[] Array whose keys are block style names and whose values are block style properties. */ public function get_registered_styles_for_block($block_name) { } /** * Checks if a block style is registered for the given block type. * * @since 5.3.0 * * @param string $block_name Block type name including namespace. * @param string $block_style_name Block style name. * @return bool True if the block style is registered, false otherwise. */ public function is_registered($block_name, $block_style_name) { } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.3.0 * * @return WP_Block_Styles_Registry The main instance. */ public static function get_instance() { } } /** * Class encapsulating and implementing Block Supports. * * @since 5.6.0 * * @access private */ #[\AllowDynamicProperties] class WP_Block_Supports { /** * Tracks the current block to be rendered. * * @since 5.6.0 * @var array */ public static $block_to_render = \null; /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.6.0 * * @return WP_Block_Supports The main instance. */ public static function get_instance() { } /** * Initializes the block supports. It registers the block supports block attributes. * * @since 5.6.0 */ public static function init() { } /** * Registers a block support. * * @since 5.6.0 * * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/ * * @param string $block_support_name Block support name. * @param array $block_support_config Array containing the properties of the block support. */ public function register($block_support_name, $block_support_config) { } /** * Generates an array of HTML attributes, such as classes, by applying to * the given block all of the features that the block supports. * * @since 5.6.0 * * @return string[] Array of HTML attribute values keyed by their name. */ public function apply_block_supports() { } } /** * Class representing a block template. * * @since 5.8.0 */ #[\AllowDynamicProperties] class WP_Block_Template { /** * Type: wp_template. * * @since 5.8.0 * @var string */ public $type; /** * Theme. * * @since 5.8.0 * @var string */ public $theme; /** * Template slug. * * @since 5.8.0 * @var string */ public $slug; /** * ID. * * @since 5.8.0 * @var string */ public $id; /** * Title. * * @since 5.8.0 * @var string */ public $title = ''; /** * Content. * * @since 5.8.0 * @var string */ public $content = ''; /** * Description. * * @since 5.8.0 * @var string */ public $description = ''; /** * Source of the content. `theme` and `custom` is used for now. * * @since 5.8.0 * @var string */ public $source = 'theme'; /** * Origin of the content when the content has been customized. * When customized, origin takes on the value of source and source becomes * 'custom'. * * @since 5.9.0 * @var string|null */ public $origin; /** * Post ID. * * @since 5.8.0 * @var int|null */ public $wp_id; /** * Template Status. * * @since 5.8.0 * @var string */ public $status; /** * Whether a template is, or is based upon, an existing template file. * * @since 5.8.0 * @var bool */ public $has_theme_file; /** * Whether a template is a custom template. * * @since 5.9.0 * * @var bool */ public $is_custom = \true; /** * Author. * * A value of 0 means no author. * * @since 5.9.0 * @var int|null */ public $author; /** * Plugin. * * @since 6.7.0 * @var string|null */ public $plugin; /** * Post types. * * @since 5.9.0 * @var string[]|null */ public $post_types; /** * Area. * * @since 5.9.0 * @var string|null */ public $area; /** * Modified. * * @since 6.3.0 * @var string|null */ public $modified; } /** * Core class used for interacting with templates. * * @since 6.7.0 */ final class WP_Block_Templates_Registry { /** * Registers a template. * * @since 6.7.0 * * @param string $template_name Template name including namespace. * @param array $args Optional. Array of template arguments. * @return WP_Block_Template|WP_Error The registered template on success, or WP_Error on failure. */ public function register($template_name, $args = array()) { } /** * Retrieves all registered templates. * * @since 6.7.0 * * @return WP_Block_Template[] Associative array of `$template_name => $template` pairs. */ public function get_all_registered() { } /** * Retrieves a registered template by its name. * * @since 6.7.0 * * @param string $template_name Template name including namespace. * @return WP_Block_Template|null The registered template, or null if it is not registered. */ public function get_registered($template_name) { } /** * Retrieves a registered template by its slug. * * @since 6.7.0 * * @param string $template_slug Slug of the template. * @return WP_Block_Template|null The registered template, or null if it is not registered. */ public function get_by_slug($template_slug) { } /** * Retrieves registered templates matching a query. * * @since 6.7.0 * * @param array $query { * Arguments to retrieve templates. Optional, empty by default. * * @type string[] $slug__in List of slugs to include. * @type string[] $slug__not_in List of slugs to skip. * @type string $post_type Post type to get the templates for. * } * @return WP_Block_Template[] Associative array of `$template_name => $template` pairs. * @phpstan-param array{ * slug__in?: string[], * slug__not_in?: string[], * post_type?: string, * } $query */ public function get_by_query($query = array()) { } /** * Checks if a template is registered. * * @since 6.7.0 * * @param string $template_name Template name. * @return bool True if the template is registered, false otherwise. */ public function is_registered($template_name) { } /** * Unregisters a template. * * @since 6.7.0 * * @param string $template_name Template name including namespace. * @return WP_Block_Template|WP_Error The unregistered template on success, or WP_Error on failure. */ public function unregister($template_name) { } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 6.7.0 * * @return WP_Block_Templates_Registry The main instance. */ public static function get_instance() { } } /** * Core class used for interacting with block types. * * @since 5.0.0 */ #[\AllowDynamicProperties] final class WP_Block_Type_Registry { /** * Registers a block type. * * @since 5.0.0 * * @see WP_Block_Type::__construct() * * @param string|WP_Block_Type $name Block type name including namespace, or alternatively * a complete WP_Block_Type instance. In case a WP_Block_Type * is provided, the $args parameter will be ignored. * @param array $args Optional. Array of block type arguments. Accepts any public property * of `WP_Block_Type`. See WP_Block_Type::__construct() for information * on accepted arguments. Default empty array. * @return WP_Block_Type|false The registered block type on success, or false on failure. * @phpstan-param array{ * api_version?: string, * title?: string, * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], * textdomain?: string|null, * styles?: array[], * variations?: array[], * selectors?: array, * supports?: array|null, * example?: array|null, * render_callback?: callable|null, * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], * view_style_handles?: string[], * } $args See WP_Block_Type::__construct() */ public function register($name, $args = array()) { } /** * Unregisters a block type. * * @since 5.0.0 * * @param string|WP_Block_Type $name Block type name including namespace, or alternatively * a complete WP_Block_Type instance. * @return WP_Block_Type|false The unregistered block type on success, or false on failure. */ public function unregister($name) { } /** * Retrieves a registered block type. * * @since 5.0.0 * * @param string $name Block type name including namespace. * @return WP_Block_Type|null The registered block type, or null if it is not registered. */ public function get_registered($name) { } /** * Retrieves all registered block types. * * @since 5.0.0 * * @return WP_Block_Type[] Associative array of `$block_type_name => $block_type` pairs. */ public function get_all_registered() { } /** * Checks if a block type is registered. * * @since 5.0.0 * * @param string $name Block type name including namespace. * @return bool True if the block type is registered, false otherwise. */ public function is_registered($name) { } public function __wakeup() { } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.0.0 * * @return WP_Block_Type_Registry The main instance. */ public static function get_instance() { } } /** * Core class representing a block type. * * @since 5.0.0 * * @see register_block_type() */ #[\AllowDynamicProperties] class WP_Block_Type { /** * Block API version. * * @since 5.6.0 * @var int */ public $api_version = 1; /** * Block type key. * * @since 5.0.0 * @var string */ public $name; /** * Human-readable block type label. * * @since 5.5.0 * @var string */ public $title = ''; /** * Block type category classification, used in search interfaces * to arrange block types by category. * * @since 5.5.0 * @var string|null */ public $category = \null; /** * Setting parent lets a block require that it is only available * when nested within the specified blocks. * * @since 5.5.0 * @var string[]|null */ public $parent = \null; /** * Setting ancestor makes a block available only inside the specified * block types at any position of the ancestor's block subtree. * * @since 6.0.0 * @var string[]|null */ public $ancestor = \null; /** * Limits which block types can be inserted as children of this block type. * * @since 6.5.0 * @var string[]|null */ public $allowed_blocks = \null; /** * Block type icon. * * @since 5.5.0 * @var string|null */ public $icon = \null; /** * A detailed block type description. * * @since 5.5.0 * @var string */ public $description = ''; /** * Additional keywords to produce block type as result * in search interfaces. * * @since 5.5.0 * @var string[] */ public $keywords = array(); /** * The translation textdomain. * * @since 5.5.0 * @var string|null */ public $textdomain = \null; /** * Alternative block styles. * * @since 5.5.0 * @var array */ public $styles = array(); /** * Block variations callback. * * @since 6.5.0 * @var callable|null */ public $variation_callback = \null; /** * Custom CSS selectors for theme.json style generation. * * @since 6.3.0 * @var array */ public $selectors = array(); /** * Supported features. * * @since 5.5.0 * @var array|null */ public $supports = \null; /** * Structured data for the block preview. * * @since 5.5.0 * @var array|null */ public $example = \null; /** * Block type render callback. * * @since 5.0.0 * @var callable */ public $render_callback = \null; /** * Block type attributes property schemas. * * @since 5.0.0 * @var array|null */ public $attributes = \null; /** * Context provided by blocks of this type. * * @since 5.5.0 * @var string[]|null */ public $provides_context = \null; /** * Block hooks for this block type. * * A block hook is specified by a block type and a relative position. * The hooked block will be automatically inserted in the given position * next to the "anchor" block whenever the latter is encountered. * * @since 6.4.0 * @var string[] */ public $block_hooks = array(); /** * Block type editor only script handles. * * @since 6.1.0 * @var string[] */ public $editor_script_handles = array(); /** * Block type front end and editor script handles. * * @since 6.1.0 * @var string[] */ public $script_handles = array(); /** * Block type front end only script handles. * * @since 6.1.0 * @var string[] */ public $view_script_handles = array(); /** * Block type front end only script module IDs. * * @since 6.5.0 * @var string[] */ public $view_script_module_ids = array(); /** * Block type editor only style handles. * * @since 6.1.0 * @var string[] */ public $editor_style_handles = array(); /** * Block type front end and editor style handles. * * @since 6.1.0 * @var string[] */ public $style_handles = array(); /** * Block type front end only style handles. * * @since 6.5.0 * @var string[] */ public $view_style_handles = array(); /** * Attributes supported by every block. * * @since 6.0.0 Added `lock`. * @since 6.5.0 Added `metadata`. * @var array */ const GLOBAL_ATTRIBUTES = array('lock' => array('type' => 'object'), 'metadata' => array('type' => 'object')); /** * Constructor. * * Will populate object properties from the provided arguments. * * @since 5.0.0 * @since 5.5.0 Added the `title`, `category`, `parent`, `icon`, `description`, * `keywords`, `textdomain`, `styles`, `supports`, `example`, * `uses_context`, and `provides_context` properties. * @since 5.6.0 Added the `api_version` property. * @since 5.8.0 Added the `variations` property. * @since 5.9.0 Added the `view_script` property. * @since 6.0.0 Added the `ancestor` property. * @since 6.1.0 Added the `editor_script_handles`, `script_handles`, `view_script_handles`, * `editor_style_handles`, and `style_handles` properties. * Deprecated the `editor_script`, `script`, `view_script`, `editor_style`, and `style` properties. * @since 6.3.0 Added the `selectors` property. * @since 6.4.0 Added the `block_hooks` property. * @since 6.5.0 Added the `allowed_blocks`, `variation_callback`, and `view_style_handles` properties. * * @see register_block_type() * * @param string $block_type Block type name including namespace. * @param array|string $args { * Optional. Array or string of arguments for registering a block type. Any arguments may be defined, * however the ones described below are supported by default. Default empty array. * * @type string $api_version Block API version. * @type string $title Human-readable block type label. * @type string|null $category Block type category classification, used in * search interfaces to arrange block types by category. * @type string[]|null $parent Setting parent lets a block require that it is only * available when nested within the specified blocks. * @type string[]|null $ancestor Setting ancestor makes a block available only inside the specified * block types at any position of the ancestor's block subtree. * @type string[]|null $allowed_blocks Limits which block types can be inserted as children of this block type. * @type string|null $icon Block type icon. * @type string $description A detailed block type description. * @type string[] $keywords Additional keywords to produce block type as * result in search interfaces. * @type string|null $textdomain The translation textdomain. * @type array[] $styles Alternative block styles. * @type array[] $variations Block variations. * @type array $selectors Custom CSS selectors for theme.json style generation. * @type array|null $supports Supported features. * @type array|null $example Structured data for the block preview. * @type callable|null $render_callback Block type render callback. * @type callable|null $variation_callback Block type variations callback. * @type array|null $attributes Block type attributes property schemas. * @type string[] $uses_context Context values inherited by blocks of this type. * @type string[]|null $provides_context Context provided by blocks of this type. * @type string[] $block_hooks Block hooks. * @type string[] $editor_script_handles Block type editor only script handles. * @type string[] $script_handles Block type front end and editor script handles. * @type string[] $view_script_handles Block type front end only script handles. * @type string[] $editor_style_handles Block type editor only style handles. * @type string[] $style_handles Block type front end and editor style handles. * @type string[] $view_style_handles Block type front end only style handles. * } * @phpstan-param array{ * api_version?: string, * title?: string, * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], * textdomain?: string|null, * styles?: array[], * variations?: array[], * selectors?: array, * supports?: array|null, * example?: array|null, * render_callback?: callable|null, * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], * view_style_handles?: string[], * } $args */ public function __construct($block_type, $args = array()) { } /** * Proxies getting values for deprecated properties for script and style handles for backward compatibility. * Gets the value for the corresponding new property if the first item in the array provided. * * @since 6.1.0 * * @param string $name Deprecated property name. * * @return string|string[]|null|void The value read from the new property if the first item in the array provided, * null when value not found, or void when unknown property name provided. */ public function __get($name) { } /** * Proxies checking for deprecated properties for script and style handles for backward compatibility. * Checks whether the corresponding new property has the first item in the array provided. * * @since 6.1.0 * * @param string $name Deprecated property name. * * @return bool Returns true when for the new property the first item in the array exists, * or false otherwise. */ public function __isset($name) { } /** * Proxies setting values for deprecated properties for script and style handles for backward compatibility. * Sets the value for the corresponding new property as the first item in the array. * It also allows setting custom properties for backward compatibility. * * @since 6.1.0 * * @param string $name Property name. * @param mixed $value Property value. * @phpstan-return void */ public function __set($name, $value) { } /** * Renders the block type output for given attributes. * * @since 5.0.0 * * @param array $attributes Optional. Block attributes. Default empty array. * @param string $content Optional. Block content. Default empty string. * @return string Rendered block type output. */ public function render($attributes = array(), $content = '') { } /** * Returns true if the block type is dynamic, or false otherwise. A dynamic * block is one which defers its rendering to occur on-demand at runtime. * * @since 5.0.0 * * @return bool Whether block type is dynamic. */ public function is_dynamic() { } /** * Validates attributes against the current block schema, populating * defaulted and missing values. * * @since 5.0.0 * * @param array $attributes Original block attributes. * @return array Prepared block attributes. */ public function prepare_attributes_for_render($attributes) { } /** * Sets block type properties. * * @since 5.0.0 * * @param array|string $args Array or string of arguments for registering a block type. * See WP_Block_Type::__construct() for information on accepted arguments. * @phpstan-param array{ * api_version?: string, * title?: string, * category?: string|null, * parent?: string[]|null, * ancestor?: string[]|null, * allowed_blocks?: string[]|null, * icon?: string|null, * description?: string, * keywords?: string[], * textdomain?: string|null, * styles?: array[], * variations?: array[], * selectors?: array, * supports?: array|null, * example?: array|null, * render_callback?: callable|null, * variation_callback?: callable|null, * attributes?: array|null, * uses_context?: string[], * provides_context?: string[]|null, * block_hooks?: string[], * editor_script_handles?: string[], * script_handles?: string[], * view_script_handles?: string[], * editor_style_handles?: string[], * style_handles?: string[], * view_style_handles?: string[], * } $args See WP_Block_Type::__construct() */ public function set_props($args) { } /** * Get all available block attributes including possible layout attribute from Columns block. * * @since 5.0.0 * * @return array Array of attributes. */ public function get_attributes() { } /** * Get block variations. * * @since 6.5.0 * * @return array[] */ public function get_variations() { } /** * Get block uses context. * * @since 6.5.0 * * @return string[] */ public function get_uses_context() { } } /** * Class representing a parsed instance of a block. * * @since 5.5.0 * @property array $attributes */ #[\AllowDynamicProperties] class WP_Block { /** * Original parsed array representation of block. * * @since 5.5.0 * @var array */ public $parsed_block; /** * Name of block. * * @example "core/paragraph" * * @since 5.5.0 * @var string */ public $name; /** * Block type associated with the instance. * * @since 5.5.0 * @var WP_Block_Type */ public $block_type; /** * Block context values. * * @since 5.5.0 * @var array */ public $context = array(); /** * All available context of the current hierarchy. * * @since 5.5.0 * @var array * @access protected */ protected $available_context; /** * Block type registry. * * @since 5.9.0 * @var WP_Block_Type_Registry * @access protected */ protected $registry; /** * List of inner blocks (of this same class) * * @since 5.5.0 * @var WP_Block_List */ public $inner_blocks = array(); /** * Resultant HTML from inside block comment delimiters after removing inner * blocks. * * @example "...Just <!-- wp:test /--> testing..." -> "Just testing..." * * @since 5.5.0 * @var string */ public $inner_html = ''; /** * List of string fragments and null markers where inner blocks were found * * @example array( * 'inner_html' => 'BeforeInnerAfter', * 'inner_blocks' => array( block, block ), * 'inner_content' => array( 'Before', null, 'Inner', null, 'After' ), * ) * * @since 5.5.0 * @var array */ public $inner_content = array(); /** * Constructor. * * Populates object properties from the provided block instance argument. * * The given array of context values will not necessarily be available on * the instance itself, but is treated as the full set of values provided by * the block's ancestry. This is assigned to the private `available_context` * property. Only values which are configured to consumed by the block via * its registered type will be assigned to the block's `context` property. * * @since 5.5.0 * * @param array $block { * An associative array of a single parsed block object. See WP_Block_Parser_Block. * * @type string $blockName Name of block. * @type array $attrs Attributes from block comment delimiters. * @type array $innerBlocks List of inner blocks. An array of arrays that * have the same structure as this one. * @type string $innerHTML HTML from inside block comment delimiters. * @type array $innerContent List of string fragments and null markers where inner blocks were found. * } * @param array $available_context Optional array of ancestry context values. * @param WP_Block_Type_Registry $registry Optional block type registry. * @phpstan-param array{ * blockName?: string, * attrs?: array, * innerBlocks?: array, * innerHTML?: string, * innerContent?: array, * } $block */ public function __construct($block, $available_context = array(), $registry = \null) { } /** * Returns a value from an inaccessible property. * * This is used to lazily initialize the `attributes` property of a block, * such that it is only prepared with default attributes at the time that * the property is accessed. For all other inaccessible properties, a `null` * value is returned. * * @since 5.5.0 * * @param string $name Property name. * @return array|null Prepared attributes, or null. */ public function __get($name) { } /** * Generates the render output for the block. * * @since 5.5.0 * @since 6.5.0 Added block bindings processing. * * @global WP_Post $post Global post object. * * @param array $options { * Optional options object. * * @type bool $dynamic Defaults to 'true'. Optionally set to false to avoid using the block's render_callback. * } * @return string Rendered block output. * @phpstan-param array{ * dynamic?: bool, * } $options */ public function render($options = array()) { } } /** * Converts a Classic Menu to Block Menu blocks. * * @since 6.3.0 * @access public */ class WP_Classic_To_Block_Menu_Converter { /** * Converts a Classic Menu to blocks. * * @since 6.3.0 * * @param WP_Term $menu The Menu term object of the menu to convert. * @return string|WP_Error The serialized and normalized parsed blocks on success, * an empty string when there are no menus to convert, * or WP_Error on invalid menu. */ public static function convert($menu) { } } /** * Core class used for querying comments. * * @since 3.1.0 * * @see WP_Comment_Query::__construct() for accepted arguments. */ #[\AllowDynamicProperties] class WP_Comment_Query { /** * SQL for database query. * * @since 4.0.1 * @var string */ public $request; /** * Metadata query container * * @since 3.5.0 * @var WP_Meta_Query A meta query instance. */ public $meta_query = \false; /** * Metadata query clauses. * * @since 4.4.0 * @var array */ protected $meta_query_clauses; /** * SQL query clauses. * * @since 4.4.0 * @var array */ protected $sql_clauses = array('select' => '', 'from' => '', 'where' => array(), 'groupby' => '', 'orderby' => '', 'limits' => ''); /** * SQL WHERE clause. * * Stored after the {@see 'comments_clauses'} filter is run on the compiled WHERE sub-clauses. * * @since 4.4.2 * @var string */ protected $filtered_where_clause; /** * Date query container * * @since 3.7.0 * @var WP_Date_Query A date query instance. */ public $date_query = \false; /** * Query vars set by the user. * * @since 3.1.0 * @var array */ public $query_vars; /** * Default values for query vars. * * @since 4.2.0 * @var array */ public $query_var_defaults; /** * List of comments located by the query. * * @since 4.0.0 * @var int[]|WP_Comment[] */ public $comments; /** * The amount of found comments for the current query. * * @since 4.4.0 * @var int */ public $found_comments = 0; /** * The number of pages. * * @since 4.4.0 * @var int */ public $max_num_pages = 0; /** * Make private/protected methods readable for backward compatibility. * * @since 4.0.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed|false Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } /** * Constructor. * * Sets up the comment query, based on the query vars passed. * * @since 4.2.0 * @since 4.4.0 `$parent__in` and `$parent__not_in` were added. * @since 4.4.0 Order by `comment__in` was added. `$update_comment_meta_cache`, `$no_found_rows`, * `$hierarchical`, and `$update_comment_post_cache` were added. * @since 4.5.0 Introduced the `$author_url` argument. * @since 4.6.0 Introduced the `$cache_domain` argument. * @since 4.9.0 Introduced the `$paged` argument. * @since 5.1.0 Introduced the `$meta_compare_key` argument. * @since 5.3.0 Introduced the `$meta_type_key` argument. * * @param string|array $query { * Optional. Array or query string of comment query parameters. Default empty. * * @type string $author_email Comment author email address. Default empty. * @type string $author_url Comment author URL. Default empty. * @type int[] $author__in Array of author IDs to include comments for. Default empty. * @type int[] $author__not_in Array of author IDs to exclude comments for. Default empty. * @type int[] $comment__in Array of comment IDs to include. Default empty. * @type int[] $comment__not_in Array of comment IDs to exclude. Default empty. * @type bool $count Whether to return a comment count (true) or array of * comment objects (false). Default false. * @type array $date_query Date query clauses to limit comments by. See WP_Date_Query. * Default null. * @type string $fields Comment fields to return. Accepts 'ids' for comment IDs * only or empty for all fields. Default empty. * @type array $include_unapproved Array of IDs or email addresses of users whose unapproved * comments will be returned by the query regardless of * `$status`. Default empty. * @type int $karma Karma score to retrieve matching comments for. * Default empty. * @type string|string[] $meta_key Meta key or keys to filter by. * @type string|string[] $meta_value Meta value or values to filter by. * @type string $meta_compare MySQL operator used for comparing the meta value. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_compare_key MySQL operator used for comparing the meta key. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type array $meta_query An associative array of WP_Meta_Query arguments. * See WP_Meta_Query::__construct() for accepted values. * @type int $number Maximum number of comments to retrieve. * Default empty (no limit). * @type int $paged When used with `$number`, defines the page of results to return. * When used with `$offset`, `$offset` takes precedence. Default 1. * @type int $offset Number of comments to offset the query. Used to build * LIMIT clause. Default 0. * @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. * Default: true. * @type string|array $orderby Comment status or array of statuses. To use 'meta_value' * or 'meta_value_num', `$meta_key` must also be defined. * To sort by a specific `$meta_query` clause, use that * clause's array key. Accepts: * - 'comment_agent' * - 'comment_approved' * - 'comment_author' * - 'comment_author_email' * - 'comment_author_IP' * - 'comment_author_url' * - 'comment_content' * - 'comment_date' * - 'comment_date_gmt' * - 'comment_ID' * - 'comment_karma' * - 'comment_parent' * - 'comment_post_ID' * - 'comment_type' * - 'user_id' * - 'comment__in' * - 'meta_value' * - 'meta_value_num' * - The value of `$meta_key` * - The array keys of `$meta_query` * - false, an empty array, or 'none' to disable `ORDER BY` clause. * Default: 'comment_date_gmt'. * @type string $order How to order retrieved comments. Accepts 'ASC', 'DESC'. * Default: 'DESC'. * @type int $parent Parent ID of comment to retrieve children of. * Default empty. * @type int[] $parent__in Array of parent IDs of comments to retrieve children for. * Default empty. * @type int[] $parent__not_in Array of parent IDs of comments *not* to retrieve * children for. Default empty. * @type int[] $post_author__in Array of author IDs to retrieve comments for. * Default empty. * @type int[] $post_author__not_in Array of author IDs *not* to retrieve comments for. * Default empty. * @type int $post_id Limit results to those affiliated with a given post ID. * Default 0. * @type int[] $post__in Array of post IDs to include affiliated comments for. * Default empty. * @type int[] $post__not_in Array of post IDs to exclude affiliated comments for. * Default empty. * @type int $post_author Post author ID to limit results by. Default empty. * @type string|string[] $post_status Post status or array of post statuses to retrieve * affiliated comments for. Pass 'any' to match any value. * Default empty. * @type string|string[] $post_type Post type or array of post types to retrieve affiliated * comments for. Pass 'any' to match any value. Default empty. * @type string $post_name Post name to retrieve affiliated comments for. * Default empty. * @type int $post_parent Post parent ID to retrieve affiliated comments for. * Default empty. * @type string $search Search term(s) to retrieve matching comments for. * Default empty. * @type string|array $status Comment statuses to limit results by. Accepts an array * or space/comma-separated list of 'hold' (`comment_status=0`), * 'approve' (`comment_status=1`), 'all', or a custom * comment status. Default 'all'. * @type string|string[] $type Include comments of a given type, or array of types. * Accepts 'comment', 'pings' (includes 'pingback' and * 'trackback'), or any custom type string. Default empty. * @type string[] $type__in Include comments from a given array of comment types. * Default empty. * @type string[] $type__not_in Exclude comments from a given array of comment types. * Default empty. * @type int $user_id Include comments for a specific user ID. Default empty. * @type bool|string $hierarchical Whether to include comment descendants in the results. * - 'threaded' returns a tree, with each comment's children * stored in a `children` property on the `WP_Comment` object. * - 'flat' returns a flat array of found comments plus * their children. * - Boolean `false` leaves out descendants. * The parameter is ignored (forced to `false`) when * `$fields` is 'ids' or 'counts'. Accepts 'threaded', * 'flat', or false. Default: false. * @type string $cache_domain Unique cache key to be produced when this query is stored in * an object cache. Default is 'core'. * @type bool $update_comment_meta_cache Whether to prime the metadata cache for found comments. * Default true. * @type bool $update_comment_post_cache Whether to prime the cache for comment posts. * Default false. * } * @phpstan-param array{ * author_email?: string, * author_url?: string, * author__in?: int[], * author__not_in?: int[], * comment__in?: int[], * comment__not_in?: int[], * count?: bool, * date_query?: array, * fields?: string, * include_unapproved?: array, * karma?: int, * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * number?: int, * paged?: int, * offset?: int, * no_found_rows?: bool, * orderby?: string|array, * order?: string, * parent?: int, * parent__in?: int[], * parent__not_in?: int[], * post_author__in?: int[], * post_author__not_in?: int[], * post_id?: int, * post__in?: int[], * post__not_in?: int[], * post_author?: int, * post_status?: string|string[], * post_type?: string|string[], * post_name?: string, * post_parent?: int, * search?: string, * status?: string|array, * type?: string|string[], * type__in?: string[], * type__not_in?: string[], * user_id?: int, * hierarchical?: bool|string, * cache_domain?: string, * update_comment_meta_cache?: bool, * update_comment_post_cache?: bool, * } $query */ public function __construct($query = '') { } /** * Parse arguments passed to the comment query with default query parameters. * * @since 4.2.0 Extracted from WP_Comment_Query::query(). * * @param string|array $query WP_Comment_Query arguments. See WP_Comment_Query::__construct() for accepted arguments. * @phpstan-param array{ * author_email?: string, * author_url?: string, * author__in?: int[], * author__not_in?: int[], * comment__in?: int[], * comment__not_in?: int[], * count?: bool, * date_query?: array, * fields?: string, * include_unapproved?: array, * karma?: int, * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * number?: int, * paged?: int, * offset?: int, * no_found_rows?: bool, * orderby?: string|array, * order?: string, * parent?: int, * parent__in?: int[], * parent__not_in?: int[], * post_author__in?: int[], * post_author__not_in?: int[], * post_id?: int, * post__in?: int[], * post__not_in?: int[], * post_author?: int, * post_status?: string|string[], * post_type?: string|string[], * post_name?: string, * post_parent?: int, * search?: string, * status?: string|array, * type?: string|string[], * type__in?: string[], * type__not_in?: string[], * user_id?: int, * hierarchical?: bool|string, * cache_domain?: string, * update_comment_meta_cache?: bool, * update_comment_post_cache?: bool, * } $query See WP_Comment_Query::__construct() */ public function parse_query($query = '') { } /** * Sets up the WordPress query for retrieving comments. * * @since 3.1.0 * @since 4.1.0 Introduced 'comment__in', 'comment__not_in', 'post_author__in', * 'post_author__not_in', 'author__in', 'author__not_in', 'post__in', * 'post__not_in', 'include_unapproved', 'type__in', and 'type__not_in' * arguments to $query_vars. * @since 4.2.0 Moved parsing to WP_Comment_Query::parse_query(). * * @param string|array $query Array or URL query string of parameters. * @return array|int List of comments, or number of comments when 'count' is passed as a query var. */ public function query($query) { } /** * Get a list of comments matching the query vars. * * @since 4.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int|int[]|WP_Comment[] List of comments or number of found comments if `$count` argument is true. */ public function get_comments() { } /** * Used internally to get a list of comment IDs matching the query vars. * * @since 4.4.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int|array A single count of comment IDs if a count query. An array of comment IDs if a full query. */ protected function get_comment_ids() { } /** * Fetch descendants for located comments. * * Instead of calling `get_children()` separately on each child comment, we do a single set of queries to fetch * the descendant trees for all matched top-level comments. * * @since 4.4.0 * * @param WP_Comment[] $comments Array of top-level comments whose descendants should be filled in. * @return array */ protected function fill_descendants($comments) { } /** * Used internally to generate an SQL string for searching across multiple columns. * * @since 3.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $search Search string. * @param string[] $columns Array of columns to search. * @return string Search SQL. */ protected function get_search_sql($search, $columns) { } /** * Parse and sanitize 'orderby' keys passed to the comment query. * * @since 4.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $orderby Alias for the field to order by. * @return string|false Value to used in the ORDER clause. False otherwise. */ protected function parse_orderby($orderby) { } /** * Parse an 'order' query variable and cast it to ASC or DESC as necessary. * * @since 4.2.0 * * @param string $order The 'order' query variable. * @return string The sanitized 'order' query variable. */ protected function parse_order($order) { } } /** * Core class used to organize comments as instantiated objects with defined members. * * @since 4.4.0 */ #[\AllowDynamicProperties] final class WP_Comment { /** * Comment ID. * * A numeric string, for compatibility reasons. * * @since 4.4.0 * @var string */ public $comment_ID; /** * ID of the post the comment is associated with. * * A numeric string, for compatibility reasons. * * @since 4.4.0 * @var string */ public $comment_post_ID = 0; /** * Comment author name. * * @since 4.4.0 * @var string */ public $comment_author = ''; /** * Comment author email address. * * @since 4.4.0 * @var string */ public $comment_author_email = ''; /** * Comment author URL. * * @since 4.4.0 * @var string */ public $comment_author_url = ''; /** * Comment author IP address (IPv4 format). * * @since 4.4.0 * @var string */ public $comment_author_IP = ''; /** * Comment date in YYYY-MM-DD HH:MM:SS format. * * @since 4.4.0 * @var string */ public $comment_date = '0000-00-00 00:00:00'; /** * Comment GMT date in YYYY-MM-DD HH::MM:SS format. * * @since 4.4.0 * @var string */ public $comment_date_gmt = '0000-00-00 00:00:00'; /** * Comment content. * * @since 4.4.0 * @var string */ public $comment_content; /** * Comment karma count. * * A numeric string, for compatibility reasons. * * @since 4.4.0 * @var string */ public $comment_karma = 0; /** * Comment approval status. * * @since 4.4.0 * @var string */ public $comment_approved = '1'; /** * Comment author HTTP user agent. * * @since 4.4.0 * @var string */ public $comment_agent = ''; /** * Comment type. * * @since 4.4.0 * @since 5.5.0 Default value changed to `comment`. * @var string */ public $comment_type = 'comment'; /** * Parent comment ID. * * A numeric string, for compatibility reasons. * * @since 4.4.0 * @var string */ public $comment_parent = 0; /** * Comment author ID. * * A numeric string, for compatibility reasons. * * @since 4.4.0 * @var string */ public $user_id = 0; /** * Retrieves a WP_Comment instance. * * @since 4.4.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $id Comment ID. * @return WP_Comment|false Comment object, otherwise false. */ public static function get_instance($id) { } /** * Constructor. * * Populates properties with object vars. * * @since 4.4.0 * * @param WP_Comment $comment Comment object. */ public function __construct($comment) { } /** * Converts object to array. * * @since 4.4.0 * * @return array Object as array. */ public function to_array() { } /** * Gets the children of a comment. * * @since 4.4.0 * * @param array $args { * Array of arguments used to pass to get_comments() and determine format. * * @type string $format Return value format. 'tree' for a hierarchical tree, 'flat' for a flattened array. * Default 'tree'. * @type string $status Comment status to limit results by. Accepts 'hold' (`comment_status=0`), * 'approve' (`comment_status=1`), 'all', or a custom comment status. * Default 'all'. * @type string $hierarchical Whether to include comment descendants in the results. * 'threaded' returns a tree, with each comment's children * stored in a `children` property on the `WP_Comment` object. * 'flat' returns a flat array of found comments plus their children. * Pass `false` to leave out descendants. * The parameter is ignored (forced to `false`) when `$fields` is 'ids' or 'counts'. * Accepts 'threaded', 'flat', or false. Default: 'threaded'. * @type string|array $orderby Comment status or array of statuses. To use 'meta_value' * or 'meta_value_num', `$meta_key` must also be defined. * To sort by a specific `$meta_query` clause, use that * clause's array key. Accepts 'comment_agent', * 'comment_approved', 'comment_author', * 'comment_author_email', 'comment_author_IP', * 'comment_author_url', 'comment_content', 'comment_date', * 'comment_date_gmt', 'comment_ID', 'comment_karma', * 'comment_parent', 'comment_post_ID', 'comment_type', * 'user_id', 'comment__in', 'meta_value', 'meta_value_num', * the value of $meta_key, and the array keys of * `$meta_query`. Also accepts false, an empty array, or * 'none' to disable `ORDER BY` clause. * } * @return WP_Comment[] Array of `WP_Comment` objects. * @phpstan-param array{ * format?: string, * status?: string, * hierarchical?: string, * orderby?: string|array, * } $args */ public function get_children($args = array()) { } /** * Adds a child to the comment. * * Used by `WP_Comment_Query` when bulk-filling descendants. * * @since 4.4.0 * * @param WP_Comment $child Child comment. */ public function add_child(\WP_Comment $child) { } /** * Gets a child comment by ID. * * @since 4.4.0 * * @param int $child_id ID of the child. * @return WP_Comment|false Returns the comment object if found, otherwise false. */ public function get_child($child_id) { } /** * Sets the 'populated_children' flag. * * This flag is important for ensuring that calling `get_children()` on a childless comment will not trigger * unneeded database queries. * * @since 4.4.0 * * @param bool $set Whether the comment's children have already been populated. */ public function populated_children($set) { } /** * Determines whether a non-public property is set. * * If `$name` matches a post field, the comment post will be loaded and the post's value checked. * * @since 4.4.0 * * @param string $name Property name. * @return bool */ public function __isset($name) { } /** * Magic getter. * * If `$name` matches a post field, the comment post will be loaded and the post's value returned. * * @since 4.4.0 * * @param string $name Property name. * @return mixed */ public function __get($name) { } } /** * Customize Control class. * * @since 3.4.0 */ #[\AllowDynamicProperties] class WP_Customize_Control { /** * Incremented with each new class instantiation, then stored in $instance_number. * * Used when sorting two instances whose priorities are equal. * * @since 4.1.0 * @var int */ protected static $instance_count = 0; /** * Order in which this instance was created in relation to other instances. * * @since 4.1.0 * @var int */ public $instance_number; /** * Customizer manager. * * @since 3.4.0 * @var WP_Customize_Manager */ public $manager; /** * Control ID. * * @since 3.4.0 * @var string */ public $id; /** * All settings tied to the control. * * @since 3.4.0 * @var array */ public $settings; /** * The primary setting for the control (if there is one). * * @since 3.4.0 * @var string|WP_Customize_Setting|null */ public $setting = 'default'; /** * Capability required to use this control. * * Normally this is empty and the capability is derived from the capabilities * of the associated `$settings`. * * @since 4.5.0 * @var string */ public $capability; /** * Order priority to load the control in Customizer. * * @since 3.4.0 * @var int */ public $priority = 10; /** * Section the control belongs to. * * @since 3.4.0 * @var string */ public $section = ''; /** * Label for the control. * * @since 3.4.0 * @var string */ public $label = ''; /** * Description for the control. * * @since 4.0.0 * @var string */ public $description = ''; /** * List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. * * @since 3.4.0 * @var array */ public $choices = array(); /** * List of custom input attributes for control output, where attribute names are the keys and values are the values. * * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. * * @since 4.0.0 * @var array */ public $input_attrs = array(); /** * Show UI for adding new content, currently only used for the dropdown-pages control. * * @since 4.7.0 * @var bool */ public $allow_addition = \false; /** * @deprecated It is better to just call the json() method * @since 3.4.0 * @var array */ public $json = array(); /** * Control's Type. * * @since 3.4.0 * @var string */ public $type = 'text'; /** * Callback. * * @since 4.0.0 * * @see WP_Customize_Control::active() * * @var callable Callback is called with one argument, the instance of * WP_Customize_Control, and returns bool to indicate whether * the control is active (such as it relates to the URL * currently being previewed). */ public $active_callback = ''; /** * Constructor. * * Supplied `$args` override class property defaults. * * If `$args['settings']` is not defined, use the `$id` as the setting ID. * * @since 3.4.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args { * Optional. Array of properties for the new Control object. Default empty array. * * @type int $instance_number Order in which this instance was created in relation * to other instances. * @type WP_Customize_Manager $manager Customizer bootstrap instance. * @type string $id Control ID. * @type array $settings All settings tied to the control. If undefined, `$id` will * be used. * @type string $setting The primary setting for the control (if there is one). * Default 'default'. * @type string $capability Capability required to use this control. Normally this is empty * and the capability is derived from `$settings`. * @type int $priority Order priority to load the control. Default 10. * @type string $section Section the control belongs to. Default empty. * @type string $label Label for the control. Default empty. * @type string $description Description for the control. Default empty. * @type array $choices List of choices for 'radio' or 'select' type controls, where * values are the keys, and labels are the values. * Default empty array. * @type array $input_attrs List of custom input attributes for control output, where * attribute names are the keys and values are the values. Not * used for 'checkbox', 'radio', 'select', 'textarea', or * 'dropdown-pages' control types. Default empty array. * @type bool $allow_addition Show UI for adding new content, currently only used for the * dropdown-pages control. Default false. * @type array $json Deprecated. Use WP_Customize_Control::json() instead. * @type string $type Control type. Core controls include 'text', 'checkbox', * 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional * input types such as 'email', 'url', 'number', 'hidden', and * 'date' are supported implicitly. Default 'text'. * @type callable $active_callback Active callback. * } * @phpstan-param array{ * instance_number?: int, * manager?: WP_Customize_Manager, * id?: string, * settings?: array, * setting?: string, * capability?: string, * priority?: int, * section?: string, * label?: string, * description?: string, * choices?: array, * input_attrs?: array, * allow_addition?: bool, * json?: array, * type?: string, * active_callback?: callable, * } $args */ public function __construct($manager, $id, $args = array()) { } /** * Enqueue control related scripts/styles. * * @since 3.4.0 */ public function enqueue() { } /** * Check whether control is active to current Customizer preview. * * @since 4.0.0 * * @return bool Whether the control is active to the current preview. */ public final function active() { } /** * Default callback used when invoking WP_Customize_Control::active(). * * Subclasses can override this with their specific logic, or they may * provide an 'active_callback' argument to the constructor. * * @since 4.0.0 * * @return true Always true. */ public function active_callback() { } /** * Fetch a setting's value. * Grabs the main setting by default. * * @since 3.4.0 * * @param string $setting_key * @return mixed The requested setting's value, if the setting exists. */ public final function value($setting_key = 'default') { } /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 3.4.0 */ public function to_json() { } /** * Get the data to export to the client via JSON. * * @since 4.1.0 * * @return array Array of parameters passed to the JavaScript. */ public function json() { } /** * Checks if the user can use this control. * * Returns false if the user cannot manipulate one of the associated settings, * or if one of the associated settings does not exist. Also returns false if * the associated section does not exist or if its capability check returns * false. * * @since 3.4.0 * * @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true. */ public final function check_capabilities() { } /** * Get the control's content for insertion into the Customizer pane. * * @since 4.1.0 * * @return string Contents of the control. */ public final function get_content() { } /** * Check capabilities and render the control. * * @since 3.4.0 * @uses WP_Customize_Control::render() * @phpstan-return void */ public final function maybe_render() { } /** * Renders the control wrapper and calls $this->render_content() for the internals. * * @since 3.4.0 */ protected function render() { } /** * Get the data link attribute for a setting. * * @since 3.4.0 * @since 4.9.0 Return a `data-customize-setting-key-link` attribute if a setting is not registered for the supplied setting key. * * @param string $setting_key * @return string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered setting, * and a `data-customize-setting-key-link` attribute if the setting is not yet registered. */ public function get_link($setting_key = 'default') { } /** * Render the data link attribute for the control's input element. * * @since 3.4.0 * @uses WP_Customize_Control::get_link() * * @param string $setting_key */ public function link($setting_key = 'default') { } /** * Render the custom attributes for the control's input element. * * @since 4.0.0 */ public function input_attrs() { } /** * Render the control's content. * * Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`. * * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`. * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly. * * Control content can alternately be rendered in JS. See WP_Customize_Control::print_template(). * * @since 3.4.0 * @phpstan-return void */ protected function render_content() { } /** * Render the control's JS template. * * This function is only run for control types that have been registered with * WP_Customize_Manager::register_control_type(). * * In the future, this will also print the template for the control's container * element and be override-able. * * @since 4.1.0 */ public final function print_template() { } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 4.1.0 */ protected function content_template() { } } /** * Customize Manager class. * * Bootstraps the Customize experience on the server-side. * * Sets up the theme-switching process if a theme other than the active one is * being previewed and customized. * * Serves as a factory for Customize Controls and Settings, and * instantiates default Customize Controls and Settings. * * @since 3.4.0 */ #[\AllowDynamicProperties] final class WP_Customize_Manager { /** * Methods and properties dealing with managing widgets in the Customizer. * * @since 3.9.0 * @var WP_Customize_Widgets */ public $widgets; /** * Methods and properties dealing with managing nav menus in the Customizer. * * @since 4.3.0 * @var WP_Customize_Nav_Menus */ public $nav_menus; /** * Methods and properties dealing with selective refresh in the Customizer preview. * * @since 4.5.0 * @var WP_Customize_Selective_Refresh */ public $selective_refresh; /** * Constructor. * * @since 3.4.0 * @since 4.7.0 Added `$args` parameter. * * @param array $args { * Args. * * @type null|string|false $changeset_uuid Changeset UUID, the `post_name` for the customize_changeset post containing the customized state. * Defaults to `null` resulting in a UUID to be immediately generated. If `false` is provided, then * then the changeset UUID will be determined during `after_setup_theme`: when the * `customize_changeset_branching` filter returns false, then the default UUID will be that * of the most recent `customize_changeset` post that has a status other than 'auto-draft', * 'publish', or 'trash'. Otherwise, if changeset branching is enabled, then a random UUID will be used. * @type string $theme Theme to be previewed (for theme switch). Defaults to customize_theme or theme query params. * @type string $messenger_channel Messenger channel. Defaults to customize_messenger_channel query param. * @type bool $settings_previewed If settings should be previewed. Defaults to true. * @type bool $branching If changeset branching is allowed; otherwise, changesets are linear. Defaults to true. * @type bool $autosaved If data from a changeset's autosaved revision should be loaded if it exists. Defaults to false. * } * @phpstan-param array{ * changeset_uuid?: null|string|false, * theme?: string, * messenger_channel?: string, * settings_previewed?: bool, * branching?: bool, * autosaved?: bool, * } $args */ public function __construct($args = array()) { } /** * Returns true if it's an Ajax request. * * @since 3.4.0 * @since 4.2.0 Added `$action` param. * * @param string|null $action Whether the supplied Ajax action is being run. * @return bool True if it's an Ajax request, false otherwise. */ public function doing_ajax($action = \null) { } /** * Returns the Ajax wp_die() handler if it's a customized request. * * @since 3.4.0 * @deprecated 4.7.0 * * @return callable Die handler. */ public function wp_die_handler() { } /** * Starts preview and customize theme. * * Check if customize query variable exist. Init filters to filter the active theme. * * @since 3.4.0 * * @global string $pagenow The filename of the current screen. * @phpstan-return void */ public function setup_theme() { } /** * Establishes the loaded changeset. * * This method runs right at after_setup_theme and applies the 'customize_changeset_branching' filter to determine * whether concurrent changesets are allowed. Then if the Customizer is not initialized with a `changeset_uuid` param, * this method will determine which UUID should be used. If changeset branching is disabled, then the most saved * changeset will be loaded by default. Otherwise, if there are no existing saved changesets or if changeset branching is * enabled, then a new UUID will be generated. * * @since 4.9.0 * * @global string $pagenow The filename of the current screen. */ public function establish_loaded_changeset() { } /** * Callback to validate a theme once it is loaded * * @since 3.4.0 */ public function after_setup_theme() { } /** * If the theme to be previewed isn't the active theme, add filter callbacks * to swap it out at runtime. * * @since 3.4.0 * @phpstan-return void */ public function start_previewing_theme() { } /** * Stops previewing the selected theme. * * Removes filters to change the active theme. * * @since 3.4.0 * @phpstan-return void */ public function stop_previewing_theme() { } /** * Gets whether settings are or will be previewed. * * @since 4.9.0 * * @see WP_Customize_Setting::preview() * * @return bool */ public function settings_previewed() { } /** * Gets whether data from a changeset's autosaved revision should be loaded if it exists. * * @since 4.9.0 * * @see WP_Customize_Manager::changeset_data() * * @return bool Is using autosaved changeset revision. */ public function autosaved() { } /** * Whether the changeset branching is allowed. * * @since 4.9.0 * * @see WP_Customize_Manager::establish_loaded_changeset() * * @return bool Is changeset branching. */ public function branching() { } /** * Gets the changeset UUID. * * @since 4.7.0 * * @see WP_Customize_Manager::establish_loaded_changeset() * * @return string UUID. */ public function changeset_uuid() { } /** * Gets the theme being customized. * * @since 3.4.0 * * @return WP_Theme */ public function theme() { } /** * Gets the registered settings. * * @since 3.4.0 * * @return array */ public function settings() { } /** * Gets the registered controls. * * @since 3.4.0 * * @return array */ public function controls() { } /** * Gets the registered containers. * * @since 4.0.0 * * @return array */ public function containers() { } /** * Gets the registered sections. * * @since 3.4.0 * * @return array */ public function sections() { } /** * Gets the registered panels. * * @since 4.0.0 * * @return array Panels. */ public function panels() { } /** * Checks if the current theme is active. * * @since 3.4.0 * * @return bool */ public function is_theme_active() { } /** * Registers styles/scripts and initialize the preview of each setting * * @since 3.4.0 */ public function wp_loaded() { } /** * Prevents Ajax requests from following redirects when previewing a theme * by issuing a 200 response instead of a 30x. * * Instead, the JS will sniff out the location header. * * @since 3.4.0 * @deprecated 4.7.0 * * @param int $status Status. * @return int */ public function wp_redirect_status($status) { } /** * Finds the changeset post ID for a given changeset UUID. * * @since 4.7.0 * * @param string $uuid Changeset UUID. * @return int|null Returns post ID on success and null on failure. */ public function find_changeset_post_id($uuid) { } /** * Gets the changeset post ID for the loaded changeset. * * @since 4.7.0 * * @return int|null Post ID on success or null if there is no post yet saved. */ public function changeset_post_id() { } /** * Gets changeset data. * * @since 4.7.0 * @since 4.9.0 This will return the changeset's data with a user's autosave revision merged on top, if one exists and $autosaved is true. * * @return array Changeset data. */ public function changeset_data() { } /** * Imports theme starter content into the customized state. * * @since 4.7.0 * * @param array $starter_content Starter content. Defaults to `get_theme_starter_content()`. * @phpstan-return void */ public function import_theme_starter_content($starter_content = array()) { } /** * Saves starter content changeset. * * @since 4.7.0 * @phpstan-return void */ public function _save_starter_content_changeset() { } /** * Gets dirty pre-sanitized setting values in the current customized state. * * The returned array consists of a merge of three sources: * 1. If the theme is not currently active, then the base array is any stashed * theme mods that were modified previously but never published. * 2. The values from the current changeset, if it exists. * 3. If the user can customize, the values parsed from the incoming * `$_POST['customized']` JSON data. * 4. Any programmatically-set post values via `WP_Customize_Manager::set_post_value()`. * * The name "unsanitized_post_values" is a carry-over from when the customized * state was exclusively sourced from `$_POST['customized']`. Nevertheless, * the value returned will come from the current changeset post and from the * incoming post data. * * @since 4.1.1 * @since 4.7.0 Added `$args` parameter and merging with changeset values and stashed theme mods. * * @param array $args { * Args. * * @type bool $exclude_changeset Whether the changeset values should also be excluded. Defaults to false. * @type bool $exclude_post_data Whether the post input values should also be excluded. Defaults to false when lacking the customize capability. * } * @return array * @phpstan-param array{ * exclude_changeset?: bool, * exclude_post_data?: bool, * } $args */ public function unsanitized_post_values($args = array()) { } /** * Returns the sanitized value for a given setting from the current customized state. * * The name "post_value" is a carry-over from when the customized state was exclusively * sourced from `$_POST['customized']`. Nevertheless, the value returned will come * from the current changeset post and from the incoming post data. * * @since 3.4.0 * @since 4.1.1 Introduced the `$default_value` parameter. * @since 4.6.0 `$default_value` is now returned early when the setting post value is invalid. * * @see WP_REST_Server::dispatch() * @see WP_REST_Request::sanitize_params() * @see WP_REST_Request::has_valid_params() * * @param WP_Customize_Setting $setting A WP_Customize_Setting derived object. * @param mixed $default_value Value returned if `$setting` has no post value (added in 4.2.0) * or the post value is invalid (added in 4.6.0). * @return string|mixed Sanitized value or the `$default_value` provided. */ public function post_value($setting, $default_value = \null) { } /** * Overrides a setting's value in the current customized state. * * The name "post_value" is a carry-over from when the customized state was * exclusively sourced from `$_POST['customized']`. * * @since 4.2.0 * * @param string $setting_id ID for the WP_Customize_Setting instance. * @param mixed $value Post value. */ public function set_post_value($setting_id, $value) { } /** * Prints JavaScript settings. * * @since 3.4.0 * @phpstan-return void */ public function customize_preview_init() { } /** * Filters the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer. * * @since 4.7.0 * * @param array $headers Headers. * @return array Headers. */ public function filter_iframe_security_headers($headers) { } /** * Adds customize state query params to a given URL if preview is allowed. * * @since 4.7.0 * * @see wp_redirect() * @see WP_Customize_Manager::get_allowed_url() * * @param string $url URL. * @return string URL. */ public function add_state_query_params($url) { } /** * Prevents sending a 404 status when returning the response for the customize * preview, since it causes the jQuery Ajax to fail. Send 200 instead. * * @since 4.0.0 * @deprecated 4.7.0 */ public function customize_preview_override_404_status() { } /** * Prints base element for preview frame. * * @since 3.4.0 * @deprecated 4.7.0 */ public function customize_preview_base() { } /** * Prints a workaround to handle HTML5 tags in IE < 9. * * @since 3.4.0 * @deprecated 4.7.0 Customizer no longer supports IE8, so all supported browsers recognize HTML5. */ public function customize_preview_html5() { } /** * Prints CSS for loading indicators for the Customizer preview. * * @since 4.2.0 */ public function customize_preview_loading_style() { } /** * Removes customize_messenger_channel query parameter from the preview window when it is not in an iframe. * * This ensures that the admin bar will be shown. It also ensures that link navigation will * work as expected since the parent frame is not being sent the URL to navigate to. * * @since 4.7.0 * @phpstan-return void */ public function remove_frameless_preview_messenger_channel() { } /** * Prints JavaScript settings for preview frame. * * @since 3.4.0 */ public function customize_preview_settings() { } /** * Prints a signature so we can ensure the Customizer was properly executed. * * @since 3.4.0 * @deprecated 4.7.0 */ public function customize_preview_signature() { } /** * Removes the signature in case we experience a case where the Customizer was not properly executed. * * @since 3.4.0 * @deprecated 4.7.0 * * @param callable|null $callback Optional. Value passed through for {@see 'wp_die_handler'} filter. * Default null. * @return callable|null Value passed through for {@see 'wp_die_handler'} filter. */ public function remove_preview_signature($callback = \null) { } /** * Determines whether it is a theme preview or not. * * @since 3.4.0 * * @return bool True if it's a preview, false if not. */ public function is_preview() { } /** * Retrieves the template name of the previewed theme. * * @since 3.4.0 * * @return string Template name. */ public function get_template() { } /** * Retrieves the stylesheet name of the previewed theme. * * @since 3.4.0 * * @return string Stylesheet name. */ public function get_stylesheet() { } /** * Retrieves the template root of the previewed theme. * * @since 3.4.0 * * @return string Theme root. */ public function get_template_root() { } /** * Retrieves the stylesheet root of the previewed theme. * * @since 3.4.0 * * @return string Theme root. */ public function get_stylesheet_root() { } /** * Filters the active theme and return the name of the previewed theme. * * @since 3.4.0 * * @param mixed $current_theme {@internal Parameter is not used} * @return string Theme name. */ public function current_theme($current_theme) { } /** * Validates setting values. * * Validation is skipped for unregistered settings or for values that are * already null since they will be skipped anyway. Sanitization is applied * to values that pass validation, and values that become null or `WP_Error` * after sanitizing are marked invalid. * * @since 4.6.0 * * @see WP_REST_Request::has_valid_params() * @see WP_Customize_Setting::validate() * * @param array $setting_values Mapping of setting IDs to values to validate and sanitize. * @param array $options { * Options. * * @type bool $validate_existence Whether a setting's existence will be checked. * @type bool $validate_capability Whether the setting capability will be checked. * } * @return array Mapping of setting IDs to return value of validate method calls, either `true` or `WP_Error`. * @phpstan-param array{ * validate_existence?: bool, * validate_capability?: bool, * } $options */ public function validate_setting_values($setting_values, $options = array()) { } /** * Prepares setting validity for exporting to the client (JS). * * Converts `WP_Error` instance into array suitable for passing into the * `wp.customize.Notification` JS model. * * @since 4.6.0 * * @param true|WP_Error $validity Setting validity. * @return true|array If `$validity` was a WP_Error, the error codes will be array-mapped * to their respective `message` and `data` to pass into the * `wp.customize.Notification` JS model. */ public function prepare_setting_validity_for_js($validity) { } /** * Handles customize_save WP Ajax request to save/update a changeset. * * @since 3.4.0 * @since 4.7.0 The semantics of this method have changed to update a changeset, optionally to also change the status and other attributes. */ public function save() { } /** * Saves the post for the loaded changeset. * * @since 4.7.0 * * @param array $args { * Args for changeset post. * * @type array $data Optional additional changeset data. Values will be merged on top of any existing post values. * @type string $status Post status. Optional. If supplied, the save will be transactional and a post revision will be allowed. * @type string $title Post title. Optional. * @type string $date_gmt Date in GMT. Optional. * @type int $user_id ID for user who is saving the changeset. Optional, defaults to the current user ID. * @type bool $starter_content Whether the data is starter content. If false (default), then $starter_content will be cleared for any $data being saved. * @type bool $autosave Whether this is a request to create an autosave revision. * } * * @return array|WP_Error Returns array on success and WP_Error with array data on error. * @phpstan-param array{ * data?: array, * status?: string, * title?: string, * date_gmt?: string, * user_id?: int, * starter_content?: bool, * autosave?: bool, * } $args */ public function save_changeset_post($args = array()) { } /** * Preserves the initial JSON post_content passed to save into the post. * * This is needed to prevent KSES and other {@see 'content_save_pre'} filters * from corrupting JSON data. * * Note that WP_Customize_Manager::validate_setting_values() have already * run on the setting values being serialized as JSON into the post content * so it is pre-sanitized. * * Also, the sanitization logic is re-run through the respective * WP_Customize_Setting::sanitize() method when being read out of the * changeset, via WP_Customize_Manager::post_value(), and this sanitized * value will also be sent into WP_Customize_Setting::update() for * persisting to the DB. * * Multiple users can collaborate on a single changeset, where one user may * have the unfiltered_html capability but another may not. A user with * unfiltered_html may add a script tag to some field which needs to be kept * intact even when another user updates the changeset to modify another field * when they do not have unfiltered_html. * * @since 5.4.1 * * @param array $data An array of slashed and processed post data. * @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data. * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as originally passed to wp_insert_post(). * @return array Filtered post data. */ public function preserve_insert_changeset_post_content($data, $postarr, $unsanitized_postarr) { } /** * Trashes or deletes a changeset post. * * The following re-formulates the logic from `wp_trash_post()` as done in * `wp_publish_post()`. The reason for bypassing `wp_trash_post()` is that it * will mutate the the `post_content` and the `post_name` when they should be * untouched. * * @since 4.9.0 * * @see wp_trash_post() * @global wpdb $wpdb WordPress database abstraction object. * * @param int|WP_Post $post The changeset post. * @return mixed A WP_Post object for the trashed post or an empty value on failure. */ public function trash_changeset_post($post) { } /** * Handles request to trash a changeset. * * @since 4.9.0 * @phpstan-return void */ public function handle_changeset_trash_request() { } /** * Re-maps 'edit_post' meta cap for a customize_changeset post to be the same as 'customize' maps. * * There is essentially a "meta meta" cap in play here, where 'edit_post' meta cap maps to * the 'customize' meta cap which then maps to 'edit_theme_options'. This is currently * required in core for `wp_create_post_autosave()` because it will call * `_wp_translate_postdata()` which in turn will check if a user can 'edit_post', but the * the caps for the customize_changeset post type are all mapping to the meta capability. * This should be able to be removed once #40922 is addressed in core. * * @since 4.9.0 * * @link https://core.trac.wordpress.org/ticket/40922 * @see WP_Customize_Manager::save_changeset_post() * @see _wp_translate_postdata() * * @param string[] $caps Array of the user's capabilities. * @param string $cap Capability name. * @param int $user_id The user ID. * @param array $args Adds the context to the cap. Typically the object ID. * @return array Capabilities. */ public function grant_edit_post_capability_for_changeset($caps, $cap, $user_id, $args) { } /** * Marks the changeset post as being currently edited by the current user. * * @since 4.9.0 * * @param int $changeset_post_id Changeset post ID. * @param bool $take_over Whether to take over the changeset. Default false. */ public function set_changeset_lock($changeset_post_id, $take_over = \false) { } /** * Refreshes changeset lock with the current time if current user edited the changeset before. * * @since 4.9.0 * * @param int $changeset_post_id Changeset post ID. * @phpstan-return void */ public function refresh_changeset_lock($changeset_post_id) { } /** * Filters heartbeat settings for the Customizer. * * @since 4.9.0 * * @global string $pagenow The filename of the current screen. * * @param array $settings Current settings to filter. * @return array Heartbeat settings. */ public function add_customize_screen_to_heartbeat_settings($settings) { } /** * Checks locked changeset with heartbeat API. * * @since 4.9.0 * * @param array $response The Heartbeat response. * @param array $data The $_POST data sent. * @param string $screen_id The screen id. * @return array The Heartbeat response. */ public function check_changeset_lock_with_heartbeat($response, $data, $screen_id) { } /** * Removes changeset lock when take over request is sent via Ajax. * * @since 4.9.0 * @phpstan-return never */ public function handle_override_changeset_lock_request() { } /** * Filters whether a changeset has changed to create a new revision. * * Note that this will not be called while a changeset post remains in auto-draft status. * * @since 4.7.0 * * @param bool $post_has_changed Whether the post has changed. * @param WP_Post $latest_revision The latest revision post object. * @param WP_Post $post The post object. * @return bool Whether a revision should be made. */ public function _filter_revision_post_has_changed($post_has_changed, $latest_revision, $post) { } /** * Publishes the values of a changeset. * * This will publish the values contained in a changeset, even changesets that do not * correspond to current manager instance. This is called by * `_wp_customize_publish_changeset()` when a customize_changeset post is * transitioned to the `publish` status. As such, this method should not be * called directly and instead `wp_publish_post()` should be used. * * Please note that if the settings in the changeset are for a non-activated * theme, the theme must first be switched to (via `switch_theme()`) before * invoking this method. * * @since 4.7.0 * * @see _wp_customize_publish_changeset() * @global wpdb $wpdb WordPress database abstraction object. * * @param int $changeset_post_id ID for customize_changeset post. Defaults to the changeset for the current manager instance. * @return true|WP_Error True or error info. */ public function _publish_changeset_values($changeset_post_id) { } /** * Refreshes nonces for the current preview. * * @since 4.2.0 * @phpstan-return never */ public function refresh_nonces() { } /** * Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock. * * @since 4.9.0 * @phpstan-return never */ public function handle_dismiss_autosave_or_lock_request() { } /** * Adds a customize setting. * * @since 3.4.0 * @since 4.5.0 Return added WP_Customize_Setting instance. * * @see WP_Customize_Setting::__construct() * @link https://developer.wordpress.org/themes/customize-api * * @param WP_Customize_Setting|string $id Customize Setting object, or ID. * @param array $args Optional. Array of properties for the new Setting object. * See WP_Customize_Setting::__construct() for information * on accepted arguments. Default empty array. * @return WP_Customize_Setting The instance of the setting that was added. * @phpstan-param array{ * type?: string, * capability?: string, * theme_supports?: string|string[], * default?: string, * transport?: string, * validate_callback?: callable, * sanitize_callback?: callable, * sanitize_js_callback?: callable, * dirty?: bool, * } $args See WP_Customize_Setting::__construct() */ public function add_setting($id, $args = array()) { } /** * Registers any dynamically-created settings, such as those from $_POST['customized'] * that have no corresponding setting created. * * This is a mechanism to "wake up" settings that have been dynamically created * on the front end and have been sent to WordPress in `$_POST['customized']`. When WP * loads, the dynamically-created settings then will get created and previewed * even though they are not directly created statically with code. * * @since 4.2.0 * * @param array $setting_ids The setting IDs to add. * @return array The WP_Customize_Setting objects added. */ public function add_dynamic_settings($setting_ids) { } /** * Retrieves a customize setting. * * @since 3.4.0 * * @param string $id Customize Setting ID. * @return WP_Customize_Setting|void The setting, if set. */ public function get_setting($id) { } /** * Removes a customize setting. * * Note that removing the setting doesn't destroy the WP_Customize_Setting instance or remove its filters. * * @since 3.4.0 * * @param string $id Customize Setting ID. */ public function remove_setting($id) { } /** * Adds a customize panel. * * @since 4.0.0 * @since 4.5.0 Return added WP_Customize_Panel instance. * * @see WP_Customize_Panel::__construct() * * @param WP_Customize_Panel|string $id Customize Panel object, or ID. * @param array $args Optional. Array of properties for the new Panel object. * See WP_Customize_Panel::__construct() for information * on accepted arguments. Default empty array. * @return WP_Customize_Panel The instance of the panel that was added. * @phpstan-param array{ * priority?: int, * capability?: string, * theme_supports?: mixed[], * title?: string, * description?: string, * type?: string, * active_callback?: callable, * } $args See WP_Customize_Panel::__construct() */ public function add_panel($id, $args = array()) { } /** * Retrieves a customize panel. * * @since 4.0.0 * * @param string $id Panel ID to get. * @return WP_Customize_Panel|void Requested panel instance, if set. */ public function get_panel($id) { } /** * Removes a customize panel. * * Note that removing the panel doesn't destroy the WP_Customize_Panel instance or remove its filters. * * @since 4.0.0 * * @param string $id Panel ID to remove. */ public function remove_panel($id) { } /** * Registers a customize panel type. * * Registered types are eligible to be rendered via JS and created dynamically. * * @since 4.3.0 * * @see WP_Customize_Panel * * @param string $panel Name of a custom panel which is a subclass of WP_Customize_Panel. */ public function register_panel_type($panel) { } /** * Renders JS templates for all registered panel types. * * @since 4.3.0 */ public function render_panel_templates() { } /** * Adds a customize section. * * @since 3.4.0 * @since 4.5.0 Return added WP_Customize_Section instance. * * @see WP_Customize_Section::__construct() * * @param WP_Customize_Section|string $id Customize Section object, or ID. * @param array $args Optional. Array of properties for the new Section object. * See WP_Customize_Section::__construct() for information * on accepted arguments. Default empty array. * @return WP_Customize_Section The instance of the section that was added. * @phpstan-param array{ * priority?: int, * panel?: string, * capability?: string, * theme_supports?: string|string[], * title?: string, * description?: string, * type?: string, * active_callback?: callable, * description_hidden?: bool, * } $args See WP_Customize_Section::__construct() */ public function add_section($id, $args = array()) { } /** * Retrieves a customize section. * * @since 3.4.0 * * @param string $id Section ID. * @return WP_Customize_Section|void The section, if set. */ public function get_section($id) { } /** * Removes a customize section. * * Note that removing the section doesn't destroy the WP_Customize_Section instance or remove its filters. * * @since 3.4.0 * * @param string $id Section ID. */ public function remove_section($id) { } /** * Registers a customize section type. * * Registered types are eligible to be rendered via JS and created dynamically. * * @since 4.3.0 * * @see WP_Customize_Section * * @param string $section Name of a custom section which is a subclass of WP_Customize_Section. */ public function register_section_type($section) { } /** * Renders JS templates for all registered section types. * * @since 4.3.0 */ public function render_section_templates() { } /** * Adds a customize control. * * @since 3.4.0 * @since 4.5.0 Return added WP_Customize_Control instance. * * @see WP_Customize_Control::__construct() * * @param WP_Customize_Control|string $id Customize Control object, or ID. * @param array $args Optional. Array of properties for the new Control object. * See WP_Customize_Control::__construct() for information * on accepted arguments. Default empty array. * @return WP_Customize_Control The instance of the control that was added. * @phpstan-param array{ * instance_number?: int, * manager?: WP_Customize_Manager, * id?: string, * settings?: array, * setting?: string, * capability?: string, * priority?: int, * section?: string, * label?: string, * description?: string, * choices?: array, * input_attrs?: array, * allow_addition?: bool, * json?: array, * type?: string, * active_callback?: callable, * } $args See WP_Customize_Control::__construct() */ public function add_control($id, $args = array()) { } /** * Retrieves a customize control. * * @since 3.4.0 * * @param string $id ID of the control. * @return WP_Customize_Control|void The control object, if set. */ public function get_control($id) { } /** * Removes a customize control. * * Note that removing the control doesn't destroy the WP_Customize_Control instance or remove its filters. * * @since 3.4.0 * * @param string $id ID of the control. */ public function remove_control($id) { } /** * Registers a customize control type. * * Registered types are eligible to be rendered via JS and created dynamically. * * @since 4.1.0 * * @param string $control Name of a custom control which is a subclass of * WP_Customize_Control. */ public function register_control_type($control) { } /** * Renders JS templates for all registered control types. * * @since 4.1.0 */ public function render_control_templates() { } /** * Prepares panels, sections, and controls. * * For each, check if required related components exist, * whether the user has the necessary capabilities, * and sort by priority. * * @since 3.4.0 */ public function prepare_controls() { } /** * Enqueues scripts for customize controls. * * @since 3.4.0 */ public function enqueue_control_scripts() { } /** * Determines whether the user agent is iOS. * * @since 4.4.0 * * @return bool Whether the user agent is iOS. */ public function is_ios() { } /** * Gets the template string for the Customizer pane document title. * * @since 4.4.0 * * @return string The template string for the document title. */ public function get_document_title_template() { } /** * Sets the initial URL to be previewed. * * URL is validated. * * @since 4.4.0 * * @param string $preview_url URL to be previewed. */ public function set_preview_url($preview_url) { } /** * Gets the initial URL to be previewed. * * @since 4.4.0 * * @return string URL being previewed. */ public function get_preview_url() { } /** * Determines whether the admin and the frontend are on different domains. * * @since 4.7.0 * * @return bool Whether cross-domain. */ public function is_cross_domain() { } /** * Gets URLs allowed to be previewed. * * If the front end and the admin are served from the same domain, load the * preview over ssl if the Customizer is being loaded over ssl. This avoids * insecure content warnings. This is not attempted if the admin and front end * are on different domains to avoid the case where the front end doesn't have * ssl certs. Domain mapping plugins can allow other urls in these conditions * using the customize_allowed_urls filter. * * @since 4.7.0 * * @return array Allowed URLs. */ public function get_allowed_urls() { } /** * Gets messenger channel. * * @since 4.7.0 * * @return string Messenger channel. */ public function get_messenger_channel() { } /** * Sets URL to link the user to when closing the Customizer. * * URL is validated. * * @since 4.4.0 * * @param string $return_url URL for return link. */ public function set_return_url($return_url) { } /** * Gets URL to link the user to when closing the Customizer. * * @since 4.4.0 * * @global array $_registered_pages * * @return string URL for link to close Customizer. */ public function get_return_url() { } /** * Sets the autofocused constructs. * * @since 4.4.0 * * @param array $autofocus { * Mapping of 'panel', 'section', 'control' to the ID which should be autofocused. * * @type string $control ID for control to be autofocused. * @type string $section ID for section to be autofocused. * @type string $panel ID for panel to be autofocused. * } * @phpstan-param array{ * control?: string, * section?: string, * panel?: string, * } $autofocus */ public function set_autofocus($autofocus) { } /** * Gets the autofocused constructs. * * @since 4.4.0 * * @return string[] { * Mapping of 'panel', 'section', 'control' to the ID which should be autofocused. * * @type string $control ID for control to be autofocused. * @type string $section ID for section to be autofocused. * @type string $panel ID for panel to be autofocused. * } * @phpstan-return array{ * control: string, * section: string, * panel: string, * } */ public function get_autofocus() { } /** * Gets nonces for the Customizer. * * @since 4.5.0 * * @return array Nonces. */ public function get_nonces() { } /** * Prints JavaScript settings for parent window. * * @since 4.4.0 */ public function customize_pane_settings() { } /** * Returns a list of devices to allow previewing. * * @since 4.5.0 * * @return array List of devices with labels and default setting. */ public function get_previewable_devices() { } /** * Registers some default controls. * * @since 3.4.0 */ public function register_controls() { } /** * Returns whether there are published pages. * * Used as active callback for static front page section and controls. * * @since 4.7.0 * * @return bool Whether there are published (or to be published) pages. */ public function has_published_pages() { } /** * Adds settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets * * @since 4.2.0 * * @see add_dynamic_settings() */ public function register_dynamic_settings() { } /** * Loads themes into the theme browsing/installation UI. * * @since 4.9.0 * @phpstan-return never */ public function handle_load_themes_request() { } /** * Callback for validating the header_textcolor value. * * Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash(). * Returns default text color if hex color is empty. * * @since 3.4.0 * * @param string $color * @return mixed */ public function _sanitize_header_textcolor($color) { } /** * Callback for validating a background setting value. * * @since 4.7.0 * * @param string $value Repeat value. * @param WP_Customize_Setting $setting Setting. * @return string|WP_Error Background value or validation error. */ public function _sanitize_background_setting($value, $setting) { } /** * Exports header video settings to facilitate selective refresh. * * @since 4.7.0 * * @param array $response Response. * @param WP_Customize_Selective_Refresh $selective_refresh Selective refresh component. * @param array $partials Array of partials. * @return array */ public function export_header_video_settings($response, $selective_refresh, $partials) { } /** * Callback for validating the header_video value. * * Ensures that the selected video is less than 8MB and provides an error message. * * @since 4.7.0 * * @param WP_Error $validity * @param mixed $value * @return mixed */ public function _validate_header_video($validity, $value) { } /** * Callback for validating the external_header_video value. * * Ensures that the provided URL is supported. * * @since 4.7.0 * * @param WP_Error $validity * @param mixed $value * @return mixed */ public function _validate_external_header_video($validity, $value) { } /** * Callback for sanitizing the external_header_video value. * * @since 4.7.1 * * @param string $value URL. * @return string Sanitized URL. */ public function _sanitize_external_header_video($value) { } /** * Callback for rendering the custom logo, used in the custom_logo partial. * * This method exists because the partial object and context data are passed * into a partial's render_callback so we cannot use get_custom_logo() as * the render_callback directly since it expects a blog ID as the first * argument. * * @see WP_Customize_Manager::register_controls() * * @since 4.5.0 * * @return string Custom logo. */ public function _render_custom_logo_partial() { } } /** * Customize Nav Menus class. * * Implements menu management in the Customizer. * * @since 4.3.0 * * @see WP_Customize_Manager */ #[\AllowDynamicProperties] final class WP_Customize_Nav_Menus { /** * WP_Customize_Manager instance. * * @since 4.3.0 * @var WP_Customize_Manager */ public $manager; /** * Constructor. * * @since 4.3.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @phpstan-return void */ public function __construct($manager) { } /** * Adds a nonce for customizing menus. * * @since 4.5.0 * * @param string[] $nonces Array of nonces. * @return string[] Modified array of nonces. */ public function filter_nonces($nonces) { } /** * Ajax handler for loading available menu items. * * @since 4.3.0 * @phpstan-return never */ public function ajax_load_available_items() { } /** * Performs the post_type and taxonomy queries for loading available menu items. * * @since 4.3.0 * * @param string $object_type Optional. Accepts any custom object type and has built-in support for * 'post_type' and 'taxonomy'. Default is 'post_type'. * @param string $object_name Optional. Accepts any registered taxonomy or post type name. Default is 'page'. * @param int $page Optional. The page number used to generate the query offset. Default is '0'. * @return array|WP_Error An array of menu items on success, a WP_Error object on failure. */ public function load_available_items_query($object_type = 'post_type', $object_name = 'page', $page = 0) { } /** * Ajax handler for searching available menu items. * * @since 4.3.0 */ public function ajax_search_available_items() { } /** * Performs post queries for available-item searching. * * Based on WP_Editor::wp_link_query(). * * @since 4.3.0 * * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments. * @return array Menu items. */ public function search_available_items_query($args = array()) { } /** * Enqueues scripts and styles for Customizer pane. * * @since 4.3.0 */ public function enqueue_scripts() { } /** * Filters a dynamic setting's constructor args. * * For a dynamic setting to be registered, this filter must be employed * to override the default false value with an array of args to pass to * the WP_Customize_Setting constructor. * * @since 4.3.0 * * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor. * @param string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`. * @return array|false */ public function filter_dynamic_setting_args($setting_args, $setting_id) { } /** * Allows non-statically created settings to be constructed with custom WP_Customize_Setting subclass. * * @since 4.3.0 * * @param string $setting_class WP_Customize_Setting or a subclass. * @param string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`. * @param array $setting_args WP_Customize_Setting or a subclass. * @return string */ public function filter_dynamic_setting_class($setting_class, $setting_id, $setting_args) { } /** * Adds the customizer settings and controls. * * @since 4.3.0 */ public function customize_register() { } /** * Gets the base10 intval. * * This is used as a setting's sanitize_callback; we can't use just plain * intval because the second argument is not what intval() expects. * * @since 4.3.0 * * @param mixed $value Number to convert. * @return int Integer. */ public function intval_base10($value) { } /** * Returns an array of all the available item types. * * @since 4.3.0 * @since 4.7.0 Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`. * * @return array The available menu item types. */ public function available_item_types() { } /** * Adds a new `auto-draft` post. * * @since 4.7.0 * * @param array $postarr { * Post array. Note that post_status is overridden to be `auto-draft`. * * @type string $post_title Post title. Required. * @type string $post_type Post type. Required. * @type string $post_name Post name. * @type string $post_content Post content. * } * @return WP_Post|WP_Error Inserted auto-draft post object or error. * @phpstan-param array{ * post_title?: string, * post_type?: string, * post_name?: string, * post_content?: string, * } $postarr */ public function insert_auto_draft_post($postarr) { } /** * Ajax handler for adding a new auto-draft post. * * @since 4.7.0 */ public function ajax_insert_auto_draft_post() { } /** * Prints the JavaScript templates used to render Menu Customizer components. * * Templates are imported into the JS use wp.template. * * @since 4.3.0 */ public function print_templates() { } /** * Prints the HTML template used to render the add-menu-item frame. * * @since 4.3.0 */ public function available_items_template() { } /** * Nav menu args used for each instance, keyed by the args HMAC. * * @since 4.3.0 * @var array */ public $preview_nav_menu_instance_args = array(); /** * Filters arguments for dynamic nav_menu selective refresh partials. * * @since 4.5.0 * * @param array|false $partial_args Partial args. * @param string $partial_id Partial ID. * @return array Partial args. */ public function customize_dynamic_partial_args($partial_args, $partial_id) { } /** * Adds hooks for the Customizer preview. * * @since 4.3.0 */ public function customize_preview_init() { } /** * Makes the auto-draft status protected so that it can be queried. * * @since 4.7.0 * * @global stdClass[] $wp_post_statuses List of post statuses. */ public function make_auto_draft_status_previewable() { } /** * Sanitizes post IDs for posts created for nav menu items to be published. * * @since 4.7.0 * * @param array $value Post IDs. * @return array Post IDs. */ public function sanitize_nav_menus_created_posts($value) { } /** * Publishes the auto-draft posts that were created for nav menu items. * * The post IDs will have been sanitized by already by * `WP_Customize_Nav_Menu_Items::sanitize_nav_menus_created_posts()` to * remove any post IDs for which the user cannot publish or for which the * post is not an auto-draft. * * @since 4.7.0 * * @param WP_Customize_Setting $setting Customizer setting object. */ public function save_nav_menus_created_posts($setting) { } /** * Keeps track of the arguments that are being passed to wp_nav_menu(). * * @since 4.3.0 * * @see wp_nav_menu() * @see WP_Customize_Widgets::filter_dynamic_sidebar_params() * * @param array $args An array containing wp_nav_menu() arguments. * @return array Arguments. */ public function filter_wp_nav_menu_args($args) { } /** * Prepares wp_nav_menu() calls for partial refresh. * * Injects attributes into container element. * * @since 4.3.0 * * @see wp_nav_menu() * * @param string $nav_menu_content The HTML content for the navigation menu. * @param object $args An object containing wp_nav_menu() arguments. * @return string Nav menu HTML with selective refresh attributes added if partial can be refreshed. */ public function filter_wp_nav_menu($nav_menu_content, $args) { } /** * Hashes (hmac) the nav menu arguments to ensure they are not tampered with when * submitted in the Ajax request. * * Note that the array is expected to be pre-sorted. * * @since 4.3.0 * * @param array $args The arguments to hash. * @return string Hashed nav menu arguments. */ public function hash_nav_menu_args($args) { } /** * Enqueues scripts for the Customizer preview. * * @since 4.3.0 */ public function customize_preview_enqueue_deps() { } /** * Exports data from PHP to JS. * * @since 4.3.0 */ public function export_preview_data() { } /** * Exports any wp_nav_menu() calls during the rendering of any partials. * * @since 4.5.0 * * @param array $response Response. * @return array Response. */ public function export_partial_rendered_nav_menu_instances($response) { } /** * Renders a specific menu via wp_nav_menu() using the supplied arguments. * * @since 4.3.0 * * @see wp_nav_menu() * * @param WP_Customize_Partial $partial Partial. * @param array $nav_menu_args Nav menu args supplied as container context. * @return string|false */ public function render_nav_menu_partial($partial, $nav_menu_args) { } } /** * Customize Panel class. * * A UI container for sections, managed by the WP_Customize_Manager. * * @since 4.0.0 * * @see WP_Customize_Manager */ #[\AllowDynamicProperties] class WP_Customize_Panel { /** * Incremented with each new class instantiation, then stored in $instance_number. * * Used when sorting two instances whose priorities are equal. * * @since 4.1.0 * @var int */ protected static $instance_count = 0; /** * Order in which this instance was created in relation to other instances. * * @since 4.1.0 * @var int */ public $instance_number; /** * WP_Customize_Manager instance. * * @since 4.0.0 * @var WP_Customize_Manager */ public $manager; /** * Unique identifier. * * @since 4.0.0 * @var string */ public $id; /** * Priority of the panel, defining the display order of panels and sections. * * @since 4.0.0 * @var int */ public $priority = 160; /** * Capability required for the panel. * * @since 4.0.0 * @var string */ public $capability = 'edit_theme_options'; /** * Theme features required to support the panel. * * @since 4.0.0 * @var mixed[] */ public $theme_supports = ''; /** * Title of the panel to show in UI. * * @since 4.0.0 * @var string */ public $title = ''; /** * Description to show in the UI. * * @since 4.0.0 * @var string */ public $description = ''; /** * Auto-expand a section in a panel when the panel is expanded when the panel only has the one section. * * @since 4.7.4 * @var bool */ public $auto_expand_sole_section = \false; /** * Customizer sections for this panel. * * @since 4.0.0 * @var array */ public $sections; /** * Type of this panel. * * @since 4.1.0 * @var string */ public $type = 'default'; /** * Active callback. * * @since 4.1.0 * * @see WP_Customize_Section::active() * * @var callable Callback is called with one argument, the instance of * WP_Customize_Section, and returns bool to indicate whether * the section is active (such as it relates to the URL currently * being previewed). */ public $active_callback = ''; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 4.0.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID for the panel. * @param array $args { * Optional. Array of properties for the new Panel object. Default empty array. * * @type int $priority Priority of the panel, defining the display order * of panels and sections. Default 160. * @type string $capability Capability required for the panel. * Default `edit_theme_options`. * @type mixed[] $theme_supports Theme features required to support the panel. * @type string $title Title of the panel to show in UI. * @type string $description Description to show in the UI. * @type string $type Type of the panel. * @type callable $active_callback Active callback. * } * @phpstan-param array{ * priority?: int, * capability?: string, * theme_supports?: mixed[], * title?: string, * description?: string, * type?: string, * active_callback?: callable, * } $args */ public function __construct($manager, $id, $args = array()) { } /** * Check whether panel is active to current Customizer preview. * * @since 4.1.0 * * @return bool Whether the panel is active to the current preview. */ public final function active() { } /** * Default callback used when invoking WP_Customize_Panel::active(). * * Subclasses can override this with their specific logic, or they may * provide an 'active_callback' argument to the constructor. * * @since 4.1.0 * * @return bool Always true. */ public function active_callback() { } /** * Gather the parameters passed to client JavaScript via JSON. * * @since 4.1.0 * * @return array The array to be exported to the client as JSON. */ public function json() { } /** * Checks required user capabilities and whether the theme has the * feature support required by the panel. * * @since 4.0.0 * @since 5.9.0 Method was marked non-final. * * @return bool False if theme doesn't support the panel or the user doesn't have the capability. */ public function check_capabilities() { } /** * Get the panel's content template for insertion into the Customizer pane. * * @since 4.1.0 * * @return string Content for the panel. */ public final function get_content() { } /** * Check capabilities and render the panel. * * @since 4.0.0 * @phpstan-return void */ public final function maybe_render() { } /** * Render the panel container, and then its contents (via `this->render_content()`) in a subclass. * * Panel containers are now rendered in JS by default, see WP_Customize_Panel::print_template(). * * @since 4.0.0 */ protected function render() { } /** * Render the panel UI in a subclass. * * Panel contents are now rendered in JS by default, see WP_Customize_Panel::print_template(). * * @since 4.1.0 */ protected function render_content() { } /** * Render the panel's JS templates. * * This function is only run for panel types that have been registered with * WP_Customize_Manager::register_panel_type(). * * @since 4.3.0 * * @see WP_Customize_Manager::register_panel_type() */ public function print_template() { } /** * An Underscore (JS) template for rendering this panel's container. * * Class variables for this panel class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Panel::json(). * * @see WP_Customize_Panel::print_template() * * @since 4.3.0 */ protected function render_template() { } /** * An Underscore (JS) template for this panel's content (but not its container). * * Class variables for this panel class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Panel::json(). * * @see WP_Customize_Panel::print_template() * * @since 4.3.0 */ protected function content_template() { } } /** * Customize Section class. * * A UI container for controls, managed by the WP_Customize_Manager class. * * @since 3.4.0 * * @see WP_Customize_Manager */ #[\AllowDynamicProperties] class WP_Customize_Section { /** * Incremented with each new class instantiation, then stored in $instance_number. * * Used when sorting two instances whose priorities are equal. * * @since 4.1.0 * @var int */ protected static $instance_count = 0; /** * Order in which this instance was created in relation to other instances. * * @since 4.1.0 * @var int */ public $instance_number; /** * WP_Customize_Manager instance. * * @since 3.4.0 * @var WP_Customize_Manager */ public $manager; /** * Unique identifier. * * @since 3.4.0 * @var string */ public $id; /** * Priority of the section which informs load order of sections. * * @since 3.4.0 * @var int */ public $priority = 160; /** * Panel in which to show the section, making it a sub-section. * * @since 4.0.0 * @var string */ public $panel = ''; /** * Capability required for the section. * * @since 3.4.0 * @var string */ public $capability = 'edit_theme_options'; /** * Theme features required to support the section. * * @since 3.4.0 * @var string|string[] */ public $theme_supports = ''; /** * Title of the section to show in UI. * * @since 3.4.0 * @var string */ public $title = ''; /** * Description to show in the UI. * * @since 3.4.0 * @var string */ public $description = ''; /** * Customizer controls for this section. * * @since 3.4.0 * @var array */ public $controls; /** * Type of this section. * * @since 4.1.0 * @var string */ public $type = 'default'; /** * Active callback. * * @since 4.1.0 * * @see WP_Customize_Section::active() * * @var callable Callback is called with one argument, the instance of * WP_Customize_Section, and returns bool to indicate whether * the section is active (such as it relates to the URL currently * being previewed). */ public $active_callback = ''; /** * Show the description or hide it behind the help icon. * * @since 4.7.0 * * @var bool Indicates whether the Section's description should be * hidden behind a help icon ("?") in the Section header, * similar to how help icons are displayed on Panels. */ public $description_hidden = \false; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 3.4.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID of the section. * @param array $args { * Optional. Array of properties for the new Section object. Default empty array. * * @type int $priority Priority of the section, defining the display order * of panels and sections. Default 160. * @type string $panel The panel this section belongs to (if any). * Default empty. * @type string $capability Capability required for the section. * Default 'edit_theme_options' * @type string|string[] $theme_supports Theme features required to support the section. * @type string $title Title of the section to show in UI. * @type string $description Description to show in the UI. * @type string $type Type of the section. * @type callable $active_callback Active callback. * @type bool $description_hidden Hide the description behind a help icon, * instead of inline above the first control. * Default false. * } * @phpstan-param array{ * priority?: int, * panel?: string, * capability?: string, * theme_supports?: string|string[], * title?: string, * description?: string, * type?: string, * active_callback?: callable, * description_hidden?: bool, * } $args */ public function __construct($manager, $id, $args = array()) { } /** * Check whether section is active to current Customizer preview. * * @since 4.1.0 * * @return bool Whether the section is active to the current preview. */ public final function active() { } /** * Default callback used when invoking WP_Customize_Section::active(). * * Subclasses can override this with their specific logic, or they may provide * an 'active_callback' argument to the constructor. * * @since 4.1.0 * * @return true Always true. */ public function active_callback() { } /** * Gather the parameters passed to client JavaScript via JSON. * * @since 4.1.0 * * @return array The array to be exported to the client as JSON. */ public function json() { } /** * Checks required user capabilities and whether the theme has the * feature support required by the section. * * @since 3.4.0 * * @return bool False if theme doesn't support the section or user doesn't have the capability. */ public final function check_capabilities() { } /** * Get the section's content for insertion into the Customizer pane. * * @since 4.1.0 * * @return string Contents of the section. */ public final function get_content() { } /** * Check capabilities and render the section. * * @since 3.4.0 * @phpstan-return void */ public final function maybe_render() { } /** * Render the section UI in a subclass. * * Sections are now rendered in JS by default, see WP_Customize_Section::print_template(). * * @since 3.4.0 */ protected function render() { } /** * Render the section's JS template. * * This function is only run for section types that have been registered with * WP_Customize_Manager::register_section_type(). * * @since 4.3.0 * * @see WP_Customize_Manager::render_template() */ public function print_template() { } /** * An Underscore (JS) template for rendering this section. * * Class variables for this section class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Section::json(). * * @since 4.3.0 * * @see WP_Customize_Section::print_template() */ protected function render_template() { } } /** * Customize Setting class. * * Handles saving and sanitizing of settings. * * @since 3.4.0 * * @see WP_Customize_Manager * @link https://developer.wordpress.org/themes/customize-api */ #[\AllowDynamicProperties] class WP_Customize_Setting { /** * Customizer bootstrap instance. * * @since 3.4.0 * @var WP_Customize_Manager */ public $manager; /** * Unique string identifier for the setting. * * @since 3.4.0 * @var string */ public $id; /** * Type of customize settings. * * @since 3.4.0 * @var string */ public $type = 'theme_mod'; /** * Capability required to edit this setting. * * @since 3.4.0 * @var string|array */ public $capability = 'edit_theme_options'; /** * Theme features required to support the setting. * * @since 3.4.0 * @var string|string[] */ public $theme_supports = ''; /** * The default value for the setting. * * @since 3.4.0 * @var string */ public $default = ''; /** * Options for rendering the live preview of changes in Customizer. * * Set this value to 'postMessage' to enable a custom JavaScript handler to render changes to this setting * as opposed to reloading the whole page. * * @since 3.4.0 * @var string */ public $transport = 'refresh'; /** * Server-side validation callback for the setting's value. * * @since 4.6.0 * @var callable */ public $validate_callback = ''; /** * Callback to filter a Customize setting value in un-slashed form. * * @since 3.4.0 * @var callable */ public $sanitize_callback = ''; /** * Callback to convert a Customize PHP setting value to a value that is JSON serializable. * * @since 3.4.0 * @var callable */ public $sanitize_js_callback = ''; /** * Whether or not the setting is initially dirty when created. * * This is used to ensure that a setting will be sent from the pane to the * preview when loading the Customizer. Normally a setting only is synced to * the preview if it has been changed. This allows the setting to be sent * from the start. * * @since 4.2.0 * @var bool */ public $dirty = \false; /** * ID Data. * * @since 3.4.0 * @var array */ protected $id_data = array(); /** * Whether or not preview() was called. * * @since 4.4.0 * @var bool */ protected $is_previewed = \false; /** * Cache of multidimensional values to improve performance. * * @since 4.4.0 * @var array */ protected static $aggregated_multidimensionals = array(); /** * Whether the multidimensional setting is aggregated. * * @since 4.4.0 * @var bool */ protected $is_multidimensional_aggregated = \false; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 3.4.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID of the setting. * Can be a theme mod or option name. * @param array $args { * Optional. Array of properties for the new Setting object. Default empty array. * * @type string $type Type of the setting. Default 'theme_mod'. * @type string $capability Capability required for the setting. Default 'edit_theme_options' * @type string|string[] $theme_supports Theme features required to support the panel. Default is none. * @type string $default Default value for the setting. Default is empty string. * @type string $transport Options for rendering the live preview of changes in Customizer. * Using 'refresh' makes the change visible by reloading the whole preview. * Using 'postMessage' allows a custom JavaScript to handle live changes. * Default is 'refresh'. * @type callable $validate_callback Server-side validation callback for the setting's value. * @type callable $sanitize_callback Callback to filter a Customize setting value in un-slashed form. * @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is * JSON serializable. * @type bool $dirty Whether or not the setting is initially dirty when created. * } * @phpstan-param array{ * type?: string, * capability?: string, * theme_supports?: string|string[], * default?: string, * transport?: string, * validate_callback?: callable, * sanitize_callback?: callable, * sanitize_js_callback?: callable, * dirty?: bool, * } $args */ public function __construct($manager, $id, $args = array()) { } /** * Get parsed ID data for multidimensional setting. * * @since 4.4.0 * * @return array { * ID data for multidimensional setting. * * @type string $base ID base * @type array $keys Keys for multidimensional array. * } * @phpstan-return array{ * base: string, * keys: array, * } */ public final function id_data() { } /** * Set up the setting for aggregated multidimensional values. * * When a multidimensional setting gets aggregated, all of its preview and update * calls get combined into one call, greatly improving performance. * * @since 4.4.0 */ protected function aggregate_multidimensional() { } /** * Reset `$aggregated_multidimensionals` static variable. * * This is intended only for use by unit tests. * * @since 4.5.0 * @ignore */ public static function reset_aggregated_multidimensionals() { } /** * The ID for the current site when the preview() method was called. * * @since 4.2.0 * @var int */ protected $_previewed_blog_id; /** * Return true if the current site is not the same as the previewed site. * * @since 4.2.0 * * @return bool If preview() has been called. */ public function is_current_blog_previewed() { } /** * Original non-previewed value stored by the preview method. * * @see WP_Customize_Setting::preview() * @since 4.1.1 * @var mixed */ protected $_original_value; /** * Add filters to supply the setting's value when accessed. * * If the setting already has a pre-existing value and there is no incoming * post value for the setting, then this method will short-circuit since * there is no change to preview. * * @since 3.4.0 * @since 4.4.0 Added boolean return value. * * @return bool False when preview short-circuits due no change needing to be previewed. */ public function preview() { } /** * Clear out the previewed-applied flag for a multidimensional-aggregated value whenever its post value is updated. * * This ensures that the new value will get sanitized and used the next time * that `WP_Customize_Setting::_multidimensional_preview_filter()` * is called for this setting. * * @since 4.4.0 * * @see WP_Customize_Manager::set_post_value() * @see WP_Customize_Setting::_multidimensional_preview_filter() */ public final function _clear_aggregated_multidimensional_preview_applied_flag() { } /** * Callback function to filter non-multidimensional theme mods and options. * * If switch_to_blog() was called after the preview() method, and the current * site is now not the same site, then this method does a no-op and returns * the original value. * * @since 3.4.0 * * @param mixed $original Old value. * @return mixed New or old value. */ public function _preview_filter($original) { } /** * Callback function to filter multidimensional theme mods and options. * * For all multidimensional settings of a given type, the preview filter for * the first setting previewed will be used to apply the values for the others. * * @since 4.4.0 * * @see WP_Customize_Setting::$aggregated_multidimensionals * @param mixed $original Original root value. * @return mixed New or old value. */ public final function _multidimensional_preview_filter($original) { } /** * Checks user capabilities and theme supports, and then saves * the value of the setting. * * @since 3.4.0 * * @return void|false Void on success, false if cap check fails * or value isn't set or is invalid. */ public final function save() { } /** * Fetch and sanitize the $_POST value for the setting. * * During a save request prior to save, post_value() provides the new value while value() does not. * * @since 3.4.0 * * @param mixed $default_value A default value which is used as a fallback. Default null. * @return mixed The default value on failure, otherwise the sanitized and validated value. */ public final function post_value($default_value = \null) { } /** * Sanitize an input. * * @since 3.4.0 * * @param string|array $value The value to sanitize. * @return string|array|null|WP_Error Sanitized value, or `null`/`WP_Error` if invalid. */ public function sanitize($value) { } /** * Validates an input. * * @since 4.6.0 * * @see WP_REST_Request::has_valid_params() * * @param mixed $value Value to validate. * @return true|WP_Error True if the input was validated, otherwise WP_Error. */ public function validate($value) { } /** * Get the root value for a setting, especially for multidimensional ones. * * @since 4.4.0 * * @param mixed $default_value Value to return if root does not exist. * @return mixed */ protected function get_root_value($default_value = \null) { } /** * Set the root value for a setting, especially for multidimensional ones. * * @since 4.4.0 * * @param mixed $value Value to set as root of multidimensional setting. * @return bool Whether the multidimensional root was updated successfully. */ protected function set_root_value($value) { } /** * Save the value of the setting, using the related API. * * @since 3.4.0 * * @param mixed $value The value to update. * @return bool The result of saving the value. */ protected function update($value) { } /** * Deprecated method. * * @since 3.4.0 * @deprecated 4.4.0 Deprecated in favor of update() method. */ protected function _update_theme_mod() { } /** * Deprecated method. * * @since 3.4.0 * @deprecated 4.4.0 Deprecated in favor of update() method. */ protected function _update_option() { } /** * Fetch the value of the setting. * * @since 3.4.0 * * @return mixed The value. */ public function value() { } /** * Sanitize the setting's value for use in JavaScript. * * @since 3.4.0 * * @return mixed The requested escaped value. */ public function js_value() { } /** * Retrieves the data to export to the client via JSON. * * @since 4.6.0 * * @return array Array of parameters passed to JavaScript. */ public function json() { } /** * Validate user capabilities whether the theme supports the setting. * * @since 3.4.0 * * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true. */ public final function check_capabilities() { } /** * Multidimensional helper function. * * @since 3.4.0 * * @param array $root * @param array $keys * @param bool $create Default false. * @return array|void Keys are 'root', 'node', and 'key'. */ protected final function multidimensional(&$root, $keys, $create = \false) { } /** * Will attempt to replace a specific value in a multidimensional array. * * @since 3.4.0 * * @param array $root * @param array $keys * @param mixed $value The value to update. * @return mixed */ protected final function multidimensional_replace($root, $keys, $value) { } /** * Will attempt to fetch a specific value from a multidimensional array. * * @since 3.4.0 * * @param array $root * @param array $keys * @param mixed $default_value A default value which is used as a fallback. Default null. * @return mixed The requested value or the default value. */ protected final function multidimensional_get($root, $keys, $default_value = \null) { } /** * Will attempt to check if a specific value in a multidimensional array is set. * * @since 3.4.0 * * @param array $root * @param array $keys * @return bool True if value is set, false if not. */ protected final function multidimensional_isset($root, $keys) { } } /** * Customize Widgets class. * * Implements widget management in the Customizer. * * @since 3.9.0 * * @see WP_Customize_Manager */ #[\AllowDynamicProperties] final class WP_Customize_Widgets { /** * WP_Customize_Manager instance. * * @since 3.9.0 * @var WP_Customize_Manager */ public $manager; /** * Initial loader. * * @since 3.9.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @phpstan-return void */ public function __construct($manager) { } /** * List whether each registered widget can be use selective refresh. * * If the theme does not support the customize-selective-refresh-widgets feature, * then this will always return an empty array. * * @since 4.5.0 * * @global WP_Widget_Factory $wp_widget_factory * * @return array Mapping of id_base to support. If theme doesn't support * selective refresh, an empty array is returned. */ public function get_selective_refreshable_widgets() { } /** * Determines if a widget supports selective refresh. * * @since 4.5.0 * * @param string $id_base Widget ID Base. * @return bool Whether the widget can be selective refreshed. */ public function is_widget_selective_refreshable($id_base) { } /** * Inspects the incoming customized data for any widget settings, and dynamically adds * them up-front so widgets will be initialized properly. * * @since 4.2.0 */ public function register_settings() { } /** * Determines the arguments for a dynamically-created setting. * * @since 4.2.0 * * @param false|array $args The arguments to the WP_Customize_Setting constructor. * @param string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`. * @return array|false Setting arguments, false otherwise. */ public function filter_customize_dynamic_setting_args($args, $setting_id) { } /** * Override sidebars_widgets for theme switch. * * When switching a theme via the Customizer, supply any previously-configured * sidebars_widgets from the target theme as the initial sidebars_widgets * setting. Also store the old theme's existing settings so that they can * be passed along for storing in the sidebars_widgets theme_mod when the * theme gets switched. * * @since 3.9.0 * * @global array $sidebars_widgets * @global array $_wp_sidebars_widgets * @phpstan-return void */ public function override_sidebars_widgets_for_theme_switch() { } /** * Filters old_sidebars_widgets_data Customizer setting. * * When switching themes, filter the Customizer setting old_sidebars_widgets_data * to supply initial $sidebars_widgets before they were overridden by retrieve_widgets(). * The value for old_sidebars_widgets_data gets set in the old theme's sidebars_widgets * theme_mod. * * @since 3.9.0 * * @see WP_Customize_Widgets::handle_theme_switch() * * @param array $old_sidebars_widgets * @return array */ public function filter_customize_value_old_sidebars_widgets_data($old_sidebars_widgets) { } /** * Filters sidebars_widgets option for theme switch. * * When switching themes, the retrieve_widgets() function is run when the Customizer initializes, * and then the new sidebars_widgets here get supplied as the default value for the sidebars_widgets * option. * * @since 3.9.0 * * @see WP_Customize_Widgets::handle_theme_switch() * @global array $sidebars_widgets * * @param array $sidebars_widgets * @return array */ public function filter_option_sidebars_widgets_for_theme_switch($sidebars_widgets) { } /** * Ensures all widgets get loaded into the Customizer. * * Note: these actions are also fired in wp_ajax_update_widget(). * * @since 3.9.0 */ public function customize_controls_init() { } /** * Ensures widgets are available for all types of previews. * * When in preview, hook to {@see 'customize_register'} for settings after WordPress is loaded * so that all filters have been initialized (e.g. Widget Visibility). * * @since 3.9.0 */ public function schedule_customize_register() { } /** * Registers Customizer settings and controls for all sidebars and widgets. * * @since 3.9.0 * * @global array $wp_registered_widgets * @global array $wp_registered_widget_controls * @global array $wp_registered_sidebars */ public function customize_register() { } /** * Determines whether the widgets panel is active, based on whether there are sidebars registered. * * @since 4.4.0 * * @see WP_Customize_Panel::$active_callback * * @global array $wp_registered_sidebars * @return bool Active. */ public function is_panel_active() { } /** * Converts a widget_id into its corresponding Customizer setting ID (option name). * * @since 3.9.0 * * @param string $widget_id Widget ID. * @return string Maybe-parsed widget ID. */ public function get_setting_id($widget_id) { } /** * Determines whether the widget is considered "wide". * * Core widgets which may have controls wider than 250, but can still be shown * in the narrow Customizer panel. The RSS and Text widgets in Core, for example, * have widths of 400 and yet they still render fine in the Customizer panel. * * This method will return all Core widgets as being not wide, but this can be * overridden with the {@see 'is_wide_widget_in_customizer'} filter. * * @since 3.9.0 * * @global array $wp_registered_widget_controls * * @param string $widget_id Widget ID. * @return bool Whether or not the widget is a "wide" widget. */ public function is_wide_widget($widget_id) { } /** * Converts a widget ID into its id_base and number components. * * @since 3.9.0 * * @param string $widget_id Widget ID. * @return array Array containing a widget's id_base and number components. */ public function parse_widget_id($widget_id) { } /** * Converts a widget setting ID (option path) to its id_base and number components. * * @since 3.9.0 * * @param string $setting_id Widget setting ID. * @return array|WP_Error Array containing a widget's id_base and number components, * or a WP_Error object. */ public function parse_widget_setting_id($setting_id) { } /** * Calls admin_print_styles-widgets.php and admin_print_styles hooks to * allow custom styles from plugins. * * @since 3.9.0 */ public function print_styles() { } /** * Calls admin_print_scripts-widgets.php and admin_print_scripts hooks to * allow custom scripts from plugins. * * @since 3.9.0 */ public function print_scripts() { } /** * Enqueues scripts and styles for Customizer panel and export data to JavaScript. * * @since 3.9.0 * * @global WP_Scripts $wp_scripts * @global array $wp_registered_sidebars * @global array $wp_registered_widgets */ public function enqueue_scripts() { } /** * Renders the widget form control templates into the DOM. * * @since 3.9.0 */ public function output_widget_control_templates() { } /** * Calls admin_print_footer_scripts and admin_print_scripts hooks to * allow custom scripts from plugins. * * @since 3.9.0 */ public function print_footer_scripts() { } /** * Retrieves common arguments to supply when constructing a Customizer setting. * * @since 3.9.0 * * @param string $id Widget setting ID. * @param array $overrides Array of setting overrides. * @return array Possibly modified setting arguments. */ public function get_setting_args($id, $overrides = array()) { } /** * Ensures sidebar widget arrays only ever contain widget IDS. * * Used as the 'sanitize_callback' for each $sidebars_widgets setting. * * @since 3.9.0 * * @param string[] $widget_ids Array of widget IDs. * @return string[] Array of sanitized widget IDs. */ public function sanitize_sidebar_widgets($widget_ids) { } /** * Builds up an index of all available widgets for use in Backbone models. * * @since 3.9.0 * * @global array $wp_registered_widgets * @global array $wp_registered_widget_controls * * @see wp_list_widgets() * * @return array List of available widgets. */ public function get_available_widgets() { } /** * Retrieves the widget control markup. * * @since 3.9.0 * * @param array $args Widget control arguments. * @return string Widget control form HTML markup. */ public function get_widget_control($args) { } /** * Retrieves the widget control markup parts. * * @since 4.4.0 * * @param array $args Widget control arguments. * @return array { * @type string $control Markup for widget control wrapping form. * @type string $content The contents of the widget form itself. * } * @phpstan-return array{ * control: string, * content: string, * } */ public function get_widget_control_parts($args) { } /** * Adds hooks for the Customizer preview. * * @since 3.9.0 */ public function customize_preview_init() { } /** * Refreshes the nonce for widget updates. * * @since 4.2.0 * * @param array $nonces Array of nonces. * @return array Array of nonces. */ public function refresh_nonces($nonces) { } /** * Tells the script loader to load the scripts and styles of custom blocks * if the widgets block editor is enabled. * * @since 5.8.0 * * @param bool $is_block_editor_screen Current decision about loading block assets. * @return bool Filtered decision about loading block assets. */ public function should_load_block_editor_scripts_and_styles($is_block_editor_screen) { } /** * When previewing, ensures the proper previewing widgets are used. * * Because wp_get_sidebars_widgets() gets called early at {@see 'init' } (via * wp_convert_widget_settings()) and can set global variable `$_wp_sidebars_widgets` * to the value of `get_option( 'sidebars_widgets' )` before the Customizer preview * filter is added, it has to be reset after the filter has been added. * * @since 3.9.0 * * @param array $sidebars_widgets List of widgets for the current sidebar. * @return array */ public function preview_sidebars_widgets($sidebars_widgets) { } /** * Enqueues scripts for the Customizer preview. * * @since 3.9.0 */ public function customize_preview_enqueue() { } /** * Inserts default style for highlighted widget at early point so theme * stylesheet can override. * * @since 3.9.0 */ public function print_preview_css() { } /** * Communicates the sidebars that appeared on the page at the very end of the page, * and at the very end of the wp_footer, * * @since 3.9.0 * * @global array $wp_registered_sidebars * @global array $wp_registered_widgets */ public function export_preview_data() { } /** * Tracks the widgets that were rendered. * * @since 3.9.0 * * @param array $widget Rendered widget to tally. */ public function tally_rendered_widgets($widget) { } /** * Determine if a widget is rendered on the page. * * @since 4.0.0 * * @param string $widget_id Widget ID to check. * @return bool Whether the widget is rendered. */ public function is_widget_rendered($widget_id) { } /** * Determines if a sidebar is rendered on the page. * * @since 4.0.0 * * @param string $sidebar_id Sidebar ID to check. * @return bool Whether the sidebar is rendered. */ public function is_sidebar_rendered($sidebar_id) { } /** * Tallies the sidebars rendered via is_active_sidebar(). * * Keep track of the times that is_active_sidebar() is called in the template, * and assume that this means that the sidebar would be rendered on the template * if there were widgets populating it. * * @since 3.9.0 * * @param bool $is_active Whether the sidebar is active. * @param string $sidebar_id Sidebar ID. * @return bool Whether the sidebar is active. */ public function tally_sidebars_via_is_active_sidebar_calls($is_active, $sidebar_id) { } /** * Tallies the sidebars rendered via dynamic_sidebar(). * * Keep track of the times that dynamic_sidebar() is called in the template, * and assume this means the sidebar would be rendered on the template if * there were widgets populating it. * * @since 3.9.0 * * @param bool $has_widgets Whether the current sidebar has widgets. * @param string $sidebar_id Sidebar ID. * @return bool Whether the current sidebar has widgets. */ public function tally_sidebars_via_dynamic_sidebar_calls($has_widgets, $sidebar_id) { } /** * Sanitizes a widget instance. * * Unserialize the JS-instance for storing in the options. It's important that this filter * only get applied to an instance *once*. * * @since 3.9.0 * @since 5.8.0 Added the `$id_base` parameter. * * @global WP_Widget_Factory $wp_widget_factory * * @param array $value Widget instance to sanitize. * @param string $id_base Optional. Base of the ID of the widget being sanitized. Default null. * @return array|void Sanitized widget instance. */ public function sanitize_widget_instance($value, $id_base = \null) { } /** * Converts a widget instance into JSON-representable format. * * @since 3.9.0 * @since 5.8.0 Added the `$id_base` parameter. * * @global WP_Widget_Factory $wp_widget_factory * * @param array $value Widget instance to convert to JSON. * @param string $id_base Optional. Base of the ID of the widget being sanitized. Default null. * @return array JSON-converted widget instance. */ public function sanitize_widget_js_instance($value, $id_base = \null) { } /** * Strips out widget IDs for widgets which are no longer registered. * * One example where this might happen is when a plugin orphans a widget * in a sidebar upon deactivation. * * @since 3.9.0 * * @global array $wp_registered_widgets * * @param array $widget_ids List of widget IDs. * @return array Parsed list of widget IDs. */ public function sanitize_sidebar_widgets_js_instance($widget_ids) { } /** * Finds and invokes the widget update and control callbacks. * * Requires that `$_POST` be populated with the instance data. * * @since 3.9.0 * * @global array $wp_registered_widget_updates * @global array $wp_registered_widget_controls * * @param string $widget_id Widget ID. * @return array|WP_Error Array containing the updated widget information. * A WP_Error object, otherwise. */ public function call_widget_update($widget_id) { } /** * Updates widget settings asynchronously. * * Allows the Customizer to update a widget using its form, but return the new * instance info via Ajax instead of saving it to the options table. * * Most code here copied from wp_ajax_save_widget(). * * @since 3.9.0 * * @see wp_ajax_save_widget() * @phpstan-return never */ public function wp_ajax_update_widget() { } /** * Filters arguments for dynamic widget partials. * * @since 4.5.0 * * @param array|false $partial_args Partial arguments. * @param string $partial_id Partial ID. * @return array (Maybe) modified partial arguments. */ public function customize_dynamic_partial_args($partial_args, $partial_id) { } /** * Adds hooks for selective refresh. * * @since 4.5.0 * @phpstan-return void */ public function selective_refresh_init() { } /** * Inject selective refresh data attributes into widget container elements. * * @since 4.5.0 * * @param array $params { * Dynamic sidebar params. * * @type array $args Sidebar args. * @type array $widget_args Widget args. * } * @see WP_Customize_Nav_Menus::filter_wp_nav_menu_args() * * @return array Params. * @phpstan-param array{ * args?: array, * widget_args?: array, * } $params */ public function filter_dynamic_sidebar_params($params) { } /** * Ensures the HTML data-* attributes for selective refresh are allowed by kses. * * This is needed in case the `$before_widget` is run through wp_kses() when printed. * * @since 4.5.0 * * @param array $allowed_html Allowed HTML. * @return array (Maybe) modified allowed HTML. */ public function filter_wp_kses_allowed_data_attributes($allowed_html) { } /** * Begins keeping track of the current sidebar being rendered. * * Insert marker before widgets are rendered in a dynamic sidebar. * * @since 4.5.0 * * @param int|string $index Index, name, or ID of the dynamic sidebar. */ public function start_dynamic_sidebar($index) { } /** * Finishes keeping track of the current sidebar being rendered. * * Inserts a marker after widgets are rendered in a dynamic sidebar. * * @since 4.5.0 * * @param int|string $index Index, name, or ID of the dynamic sidebar. */ public function end_dynamic_sidebar($index) { } /** * Filters sidebars_widgets to ensure the currently-rendered widget is the only widget in the current sidebar. * * @since 4.5.0 * * @param array $sidebars_widgets Sidebars widgets. * @return array Filtered sidebars widgets. */ public function filter_sidebars_widgets_for_rendering_widget($sidebars_widgets) { } /** * Renders a specific widget using the supplied sidebar arguments. * * @since 4.5.0 * * @see dynamic_sidebar() * * @param WP_Customize_Partial $partial Partial. * @param array $context { * Sidebar args supplied as container context. * * @type string $sidebar_id ID for sidebar for widget to render into. * @type int $sidebar_instance_number Disambiguating instance number. * } * @return string|false * @phpstan-param array{ * sidebar_id?: string, * sidebar_instance_number?: int, * } $context */ public function render_widget_partial($partial, $context) { } /** * Pre-filters captured option values before updating. * * @since 3.9.0 * * @param mixed $new_value The new option value. * @param string $option_name Name of the option. * @param mixed $old_value The old option value. * @return mixed Filtered option value. */ public function capture_filter_pre_update_option($new_value, $option_name, $old_value) { } /** * Pre-filters captured option values before retrieving. * * @since 3.9.0 * * @param mixed $value Value to return instead of the option value. * @return mixed Filtered option value. */ public function capture_filter_pre_get_option($value) { } /** * {@internal Missing Summary} * * See the {@see 'customize_dynamic_setting_args'} filter. * * @since 3.9.0 * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. */ public function setup_widget_addition_previews() { } /** * {@internal Missing Summary} * * See the {@see 'customize_dynamic_setting_args'} filter. * * @since 3.9.0 * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. */ public function prepreview_added_sidebars_widgets() { } /** * {@internal Missing Summary} * * See the {@see 'customize_dynamic_setting_args'} filter. * * @since 3.9.0 * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. */ public function prepreview_added_widget_instance() { } /** * {@internal Missing Summary} * * See the {@see 'customize_dynamic_setting_args'} filter. * * @since 3.9.0 * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. */ public function remove_prepreview_filters() { } } /** * Class for generating SQL clauses that filter a primary query according to date. * * WP_Date_Query is a helper that allows primary query classes, such as WP_Query, to filter * their results by date columns, by generating `WHERE` subclauses to be attached to the * primary SQL query string. * * Attempting to filter by an invalid date value (eg month=13) will generate SQL that will * return no results. In these cases, a _doing_it_wrong() error notice is also thrown. * See WP_Date_Query::validate_date_values(). * * @link https://developer.wordpress.org/reference/classes/wp_query/ * * @since 3.7.0 */ #[\AllowDynamicProperties] class WP_Date_Query { /** * Array of date queries. * * See WP_Date_Query::__construct() for information on date query arguments. * * @since 3.7.0 * @var array */ public $queries = array(); /** * The default relation between top-level queries. Can be either 'AND' or 'OR'. * * @since 3.7.0 * @var string */ public $relation = 'AND'; /** * The column to query against. Can be changed via the query arguments. * * @since 3.7.0 * @var string */ public $column = 'post_date'; /** * The value comparison operator. Can be changed via the query arguments. * * @since 3.7.0 * @var string */ public $compare = '='; /** * Supported time-related parameter keys. * * @since 4.1.0 * @var string[] */ public $time_keys = array('after', 'before', 'year', 'month', 'monthnum', 'week', 'w', 'dayofyear', 'day', 'dayofweek', 'dayofweek_iso', 'hour', 'minute', 'second'); /** * Constructor. * * Time-related parameters that normally require integer values ('year', 'month', 'week', 'dayofyear', 'day', * 'dayofweek', 'dayofweek_iso', 'hour', 'minute', 'second') accept arrays of integers for some values of * 'compare'. When 'compare' is 'IN' or 'NOT IN', arrays are accepted; when 'compare' is 'BETWEEN' or 'NOT * BETWEEN', arrays of two valid values are required. See individual argument descriptions for accepted values. * * @since 3.7.0 * @since 4.0.0 The $inclusive logic was updated to include all times within the date range. * @since 4.1.0 Introduced 'dayofweek_iso' time type parameter. * * @param array $date_query { * Array of date query clauses. * * @type array ...$0 { * @type string $column Optional. The column to query against. If undefined, inherits the value of * the `$default_column` parameter. See WP_Date_Query::validate_column() and * the {@see 'date_query_valid_columns'} filter for the list of accepted values. * Default 'post_date'. * @type string $compare Optional. The comparison operator. Accepts '=', '!=', '>', '>=', '<', '<=', * 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. Default '='. * @type string $relation Optional. The boolean relationship between the date queries. Accepts 'OR' or 'AND'. * Default 'OR'. * @type array ...$0 { * Optional. An array of first-order clause parameters, or another fully-formed date query. * * @type string|array $before { * Optional. Date to retrieve posts before. Accepts `strtotime()`-compatible string, * or array of 'year', 'month', 'day' values. * * @type string $year The four-digit year. Default empty. Accepts any four-digit year. * @type string $month Optional when passing array.The month of the year. * Default (string:empty)|(array:1). Accepts numbers 1-12. * @type string $day Optional when passing array.The day of the month. * Default (string:empty)|(array:1). Accepts numbers 1-31. * } * @type string|array $after { * Optional. Date to retrieve posts after. Accepts `strtotime()`-compatible string, * or array of 'year', 'month', 'day' values. * * @type string $year The four-digit year. Accepts any four-digit year. Default empty. * @type string $month Optional when passing array. The month of the year. Accepts numbers 1-12. * Default (string:empty)|(array:12). * @type string $day Optional when passing array.The day of the month. Accepts numbers 1-31. * Default (string:empty)|(array:last day of month). * } * @type string $column Optional. Used to add a clause comparing a column other than * the column specified in the top-level `$column` parameter. * See WP_Date_Query::validate_column() and * the {@see 'date_query_valid_columns'} filter for the list * of accepted values. Default is the value of top-level `$column`. * @type string $compare Optional. The comparison operator. Accepts '=', '!=', '>', '>=', * '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. 'IN', * 'NOT IN', 'BETWEEN', and 'NOT BETWEEN'. Comparisons support * arrays in some time-related parameters. Default '='. * @type bool $inclusive Optional. Include results from dates specified in 'before' or * 'after'. Default false. * @type int|int[] $year Optional. The four-digit year number. Accepts any four-digit year * or an array of years if `$compare` supports it. Default empty. * @type int|int[] $month Optional. The two-digit month number. Accepts numbers 1-12 or an * array of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $week Optional. The week number of the year. Accepts numbers 0-53 or an * array of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $dayofyear Optional. The day number of the year. Accepts numbers 1-366 or an * array of valid numbers if `$compare` supports it. * @type int|int[] $day Optional. The day of the month. Accepts numbers 1-31 or an array * of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $dayofweek Optional. The day number of the week. Accepts numbers 1-7 (1 is * Sunday) or an array of valid numbers if `$compare` supports it. * Default empty. * @type int|int[] $dayofweek_iso Optional. The day number of the week (ISO). Accepts numbers 1-7 * (1 is Monday) or an array of valid numbers if `$compare` supports it. * Default empty. * @type int|int[] $hour Optional. The hour of the day. Accepts numbers 0-23 or an array * of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $minute Optional. The minute of the hour. Accepts numbers 0-59 or an array * of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $second Optional. The second of the minute. Accepts numbers 0-59 or an * array of valid numbers if `$compare` supports it. Default empty. * } * } * } * @param string $default_column Optional. Default column to query against. See WP_Date_Query::validate_column() * and the {@see 'date_query_valid_columns'} filter for the list of accepted values. * Default 'post_date'. * @phpstan-return void */ public function __construct($date_query, $default_column = 'post_date') { } /** * Recursive-friendly query sanitizer. * * Ensures that each query-level clause has a 'relation' key, and that * each first-order clause contains all the necessary keys from `$defaults`. * * @since 4.1.0 * * @param array $queries * @param array $parent_query * @return array Sanitized queries. */ public function sanitize_query($queries, $parent_query = \null) { } /** * Determines whether this is a first-order clause. * * Checks to see if the current clause has any time-related keys. * If so, it's first-order. * * @since 4.1.0 * * @param array $query Query clause. * @return bool True if this is a first-order clause. */ protected function is_first_order_clause($query) { } /** * Determines and validates what comparison operator to use. * * @since 3.7.0 * * @param array $query A date query or a date subquery. * @return string The comparison operator. */ public function get_compare($query) { } /** * Validates the given date_query values and triggers errors if something is not valid. * * Note that date queries with invalid date ranges are allowed to * continue (though of course no items will be found for impossible dates). * This method only generates debug notices for these cases. * * @since 4.1.0 * * @param array $date_query The date_query array. * @return bool True if all values in the query are valid, false if one or more fail. */ public function validate_date_values($date_query = array()) { } /** * Validates a column name parameter. * * Column names without a table prefix (like 'post_date') are checked against a list of * allowed and known tables, and then, if found, have a table prefix (such as 'wp_posts.') * prepended. Prefixed column names (such as 'wp_posts.post_date') bypass this allowed * check, and are only sanitized to remove illegal characters. * * @since 3.7.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $column The user-supplied column name. * @return string A validated column name value. */ public function validate_column($column) { } /** * Generates WHERE clause to be appended to a main query. * * @since 3.7.0 * * @return string MySQL WHERE clause. */ public function get_sql() { } /** * Generates SQL clauses to be appended to a main query. * * Called by the public WP_Date_Query::get_sql(), this method is abstracted * out to maintain parity with the other Query classes. * * @since 4.1.0 * * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return array{ * join: string, * where: string, * } */ protected function get_sql_clauses() { } /** * Generates SQL clauses for a single query array. * * If nested subqueries are found, this method recurses the tree to * produce the properly nested SQL. * * @since 4.1.0 * * @param array $query Query to parse. * @param int $depth Optional. Number of tree levels deep we currently are. * Used to calculate indentation. Default 0. * @return array { * Array containing JOIN and WHERE SQL clauses to append to a single query array. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return array{ * join: string, * where: string, * } */ protected function get_sql_for_query($query, $depth = 0) { } /** * Turns a single date clause into pieces for a WHERE clause. * * A wrapper for get_sql_for_clause(), included here for backward * compatibility while retaining the naming convention across Query classes. * * @since 3.7.0 * * @param array $query Date query arguments. * @return array { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string[] $join Array of SQL fragments to append to the main JOIN clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause. * } * @phpstan-return array{ * join: string[], * where: string[], * } */ protected function get_sql_for_subquery($query) { } /** * Turns a first-order date query into SQL for a WHERE clause. * * @since 4.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $query Date query clause. * @param array $parent_query Parent query of the current date query. * @return array { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string[] $join Array of SQL fragments to append to the main JOIN clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause. * } * @phpstan-return array{ * join: string[], * where: string[], * } */ protected function get_sql_for_clause($query, $parent_query) { } /** * Builds and validates a value string based on the comparison operator. * * @since 3.7.0 * * @param string $compare The compare operator to use. * @param string|array $value The value. * @return string|false|int The value to be used in SQL or false on error. */ public function build_value($compare, $value) { } /** * Builds a MySQL format date/time based on some query parameters. * * You can pass an array of values (year, month, etc.) with missing parameter values being defaulted to * either the maximum or minimum values (controlled by the $default_to parameter). Alternatively you can * pass a string that will be passed to date_create(). * * @since 3.7.0 * * @param string|array $datetime An array of parameters or a strtotime() string. * @param bool $default_to_max Whether to round up incomplete dates. Supported by values * of $datetime that are arrays, or string values that are a * subset of MySQL date format ('Y', 'Y-m', 'Y-m-d', 'Y-m-d H:i'). * Default: false. * @return string|false A MySQL format date/time or false on failure. */ public function build_mysql_datetime($datetime, $default_to_max = \false) { } /** * Builds a query string for comparing time values (hour, minute, second). * * If just hour, minute, or second is set than a normal comparison will be done. * However if multiple values are passed, a pseudo-decimal time will be created * in order to be able to accurately compare against. * * @since 3.7.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $column The column to query against. Needs to be pre-validated! * @param string $compare The comparison operator. Needs to be pre-validated! * @param int|null $hour Optional. An hour value (0-23). * @param int|null $minute Optional. A minute value (0-59). * @param int|null $second Optional. A second value (0-59). * @return string|false A query part or false on failure. */ public function build_time_query($column, $compare, $hour = \null, $minute = \null, $second = \null) { } /** * Sanitizes a 'relation' operator. * * @since 6.0.3 * * @param string $relation Raw relation key from the query argument. * @return string Sanitized relation. Either 'AND' or 'OR'. * @phpstan-return 'AND'|'OR' */ public function sanitize_relation($relation) { } } /** * Core base class extended to register items. * * @since 2.6.0 * * @see _WP_Dependency */ #[\AllowDynamicProperties] class WP_Dependencies { /** * An array of all registered dependencies keyed by handle. * * @since 2.6.8 * * @var _WP_Dependency[] */ public $registered = array(); /** * An array of handles of queued dependencies. * * @since 2.6.8 * * @var string[] */ public $queue = array(); /** * An array of handles of dependencies to queue. * * @since 2.6.0 * * @var string[] */ public $to_do = array(); /** * An array of handles of dependencies already queued. * * @since 2.6.0 * * @var string[] */ public $done = array(); /** * An array of additional arguments passed when a handle is registered. * * Arguments are appended to the item query string. * * @since 2.6.0 * * @var array */ public $args = array(); /** * An array of dependency groups to enqueue. * * Each entry is keyed by handle and represents the integer group level or boolean * false if the handle has no group. * * @since 2.8.0 * * @var (int|false)[] */ public $groups = array(); /** * A handle group to enqueue. * * @since 2.8.0 * * @deprecated 4.5.0 * @var int */ public $group = 0; /** * Processes the items and dependencies. * * Processes the items passed to it or the queue, and their dependencies. * * @since 2.6.0 * @since 2.8.0 Added the `$group` parameter. * * @param string|string[]|false $handles Optional. Items to be processed: queue (false), * single item (string), or multiple items (array of strings). * Default false. * @param int|false $group Optional. Group level: level (int), no group (false). * @return string[] Array of handles of items that have been processed. */ public function do_items($handles = \false, $group = \false) { } /** * Processes a dependency. * * @since 2.6.0 * @since 5.5.0 Added the `$group` parameter. * * @param string $handle Name of the item. Should be unique. * @param int|false $group Optional. Group level: level (int), no group (false). * Default false. * @return bool True on success, false if not set. */ public function do_item($handle, $group = \false) { } /** * Determines dependencies. * * Recursively builds an array of items to process taking * dependencies into account. Does NOT catch infinite loops. * * @since 2.1.0 * @since 2.6.0 Moved from `WP_Scripts`. * @since 2.8.0 Added the `$group` parameter. * * @param string|string[] $handles Item handle (string) or item handles (array of strings). * @param bool $recursion Optional. Internal flag that function is calling itself. * Default false. * @param int|false $group Optional. Group level: level (int), no group (false). * Default false. * @return bool True on success, false on failure. */ public function all_deps($handles, $recursion = \false, $group = \false) { } /** * Register an item. * * Registers the item if no item of that name already exists. * * @since 2.1.0 * @since 2.6.0 Moved from `WP_Scripts`. * * @param string $handle Name of the item. Should be unique. * @param string|false $src Full URL of the item, or path of the item relative * to the WordPress root directory. If source is set to false, * the item is an alias of other items it depends on. * @param string[] $deps Optional. An array of registered item handles this item depends on. * Default empty array. * @param string|bool|null $ver Optional. String specifying item version number, if it has one, * which is added to the URL as a query string for cache busting purposes. * If version is set to false, a version number is automatically added * equal to current installed WordPress version. * If set to null, no version is added. * @param mixed $args Optional. Custom property of the item. NOT the class property $args. * Examples: $media, $in_footer. * @return bool Whether the item has been registered. True on success, false on failure. */ public function add($handle, $src, $deps = array(), $ver = \false, $args = \null) { } /** * Add extra item data. * * Adds data to a registered item. * * @since 2.6.0 * * @param string $handle Name of the item. Should be unique. * @param string $key The data key. * @param mixed $value The data value. * @return bool True on success, false on failure. */ public function add_data($handle, $key, $value) { } /** * Get extra item data. * * Gets data associated with a registered item. * * @since 3.3.0 * * @param string $handle Name of the item. Should be unique. * @param string $key The data key. * @return mixed Extra item data (string), false otherwise. */ public function get_data($handle, $key) { } /** * Un-register an item or items. * * @since 2.1.0 * @since 2.6.0 Moved from `WP_Scripts`. * * @param string|string[] $handles Item handle (string) or item handles (array of strings). */ public function remove($handles) { } /** * Queue an item or items. * * Decodes handles and arguments, then queues handles and stores * arguments in the class property $args. For example in extending * classes, $args is appended to the item url as a query string. * Note $args is NOT the $args property of items in the $registered array. * * @since 2.1.0 * @since 2.6.0 Moved from `WP_Scripts`. * * @param string|string[] $handles Item handle (string) or item handles (array of strings). */ public function enqueue($handles) { } /** * Dequeue an item or items. * * Decodes handles and arguments, then dequeues handles * and removes arguments from the class property $args. * * @since 2.1.0 * @since 2.6.0 Moved from `WP_Scripts`. * * @param string|string[] $handles Item handle (string) or item handles (array of strings). */ public function dequeue($handles) { } /** * Recursively search the passed dependency tree for a handle. * * @since 4.0.0 * * @param string[] $queue An array of queued _WP_Dependency handles. * @param string $handle Name of the item. Should be unique. * @return bool Whether the handle is found after recursively searching the dependency tree. */ protected function recurse_deps($queue, $handle) { } /** * Query the list for an item. * * @since 2.1.0 * @since 2.6.0 Moved from `WP_Scripts`. * * @param string $handle Name of the item. Should be unique. * @param string $status Optional. Status of the item to query. Default 'registered'. * @return bool|_WP_Dependency Found, or object Item data. */ public function query($handle, $status = 'registered') { } /** * Set item group, unless already in a lower group. * * @since 2.8.0 * * @param string $handle Name of the item. Should be unique. * @param bool $recursion Internal flag that calling function was called recursively. * @param int|false $group Group level: level (int), no group (false). * @return bool Not already in the group or a lower group. */ public function set_group($handle, $recursion, $group) { } /** * Get etag header for cache validation. * * @since 6.7.0 * * @global string $wp_version The WordPress version string. * * @param string[] $load Array of script or style handles to load. * @return string Etag header. */ public function get_etag($load) { } } /** * Class _WP_Dependency * * Helper class to register a handle and associated data. * * @access private * @since 2.6.0 */ #[\AllowDynamicProperties] class _WP_Dependency { /** * The handle name. * * @since 2.6.0 * @var string */ public $handle; /** * The handle source. * * If source is set to false, the item is an alias of other items it depends on. * * @since 2.6.0 * @var string|false */ public $src; /** * An array of handle dependencies. * * @since 2.6.0 * @var string[] */ public $deps = array(); /** * The handle version. * * Used for cache-busting. * * @since 2.6.0 * @var bool|string */ public $ver = \false; /** * Additional arguments for the handle. * * @since 2.6.0 * @var array */ public $args = \null; /** * Extra data to supply to the handle. * * @since 2.6.0 * @var array */ public $extra = array(); /** * Translation textdomain set for this dependency. * * @since 5.0.0 * @var string */ public $textdomain; /** * Translation path set for this dependency. * * @since 5.0.0 * @var string */ public $translations_path; /** * Setup dependencies. * * @since 2.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param mixed ...$args Dependency information. */ public function __construct(...$args) { } /** * Add handle data. * * @since 2.6.0 * * @param string $name The data key to add. * @param mixed $data The data value to add. * @return bool False if not scalar, true otherwise. */ public function add_data($name, $data) { } /** * Sets the translation domain for this dependency. * * @since 5.0.0 * * @param string $domain The translation textdomain. * @param string $path Optional. The full file path to the directory containing translation files. * @return bool False if $domain is not a string, true otherwise. */ public function set_translations($domain, $path = '') { } } /** * Manages duotone block supports and global styles. * * @access private */ class WP_Duotone { /** * Returns the prefixed id for the duotone filter for use as a CSS id. * * Exported for the deprecated function wp_get_duotone_filter_id(). * * @internal * * @since 6.3.0 * @deprecated 6.3.0 * * @param array $preset Duotone preset value as seen in theme.json. * @return string Duotone filter CSS id. */ public static function get_filter_id_from_preset($preset) { } /** * Gets the SVG for the duotone filter definition from a preset. * * Exported for the deprecated function wp_get_duotone_filter_property(). * * @internal * * @since 6.3.0 * @deprecated 6.3.0 * * @param array $preset The duotone preset. * @return string The SVG for the filter definition. */ public static function get_filter_svg_from_preset($preset) { } /** * Registers the style and colors block attributes for block types that support it. * * Block support is added with `supports.filter.duotone` in block.json. * * @since 6.3.0 * * @param WP_Block_Type $block_type Block Type. */ public static function register_duotone_support($block_type) { } /** * Render out the duotone CSS styles and SVG. * * The hooks self::set_global_style_block_names and self::set_global_styles_presets * must be called before this function. * * @since 6.3.0 * * @param string $block_content Rendered block content. * @param array $block Block object. * @param WP_Block $wp_block The block instance. * @return string Filtered block content. */ public static function render_duotone_support($block_content, $block, $wp_block) { } /** * Fixes the issue with our generated class name not being added to the block's outer container * in classic themes due to gutenberg_restore_image_outer_container from layout block supports. * * @since 6.6.0 * * @param string $block_content Rendered block content. * @return string Filtered block content. */ public static function restore_image_outer_container($block_content) { } /** * Appends the used block duotone filter declarations to the inline block supports CSS. * * Uses the declarations saved in earlier calls to self::enqueue_block_css. * * @since 6.3.0 */ public static function output_block_styles() { } /** * Appends the used global style duotone filter presets (CSS custom * properties) to the inline global styles CSS. * * Uses the declarations saved in earlier calls to self::enqueue_global_styles_preset. * * @since 6.3.0 */ public static function output_global_styles() { } /** * Outputs all necessary SVG for duotone filters, CSS for classic themes. * * Uses the declarations saved in earlier calls to self::enqueue_global_styles_preset * and self::enqueue_custom_filter. * * @since 6.3.0 */ public static function output_footer_assets() { } /** * Adds the duotone SVGs and CSS custom properties to the editor settings. * * This allows the properties to be pulled in by the EditorStyles component * in JS and rendered in the post editor. * * @since 6.3.0 * * @param array $settings The block editor settings from the `block_editor_settings_all` filter. * @return array The editor settings with duotone SVGs and CSS custom properties. */ public static function add_editor_settings($settings) { } /** * Migrates the experimental duotone support flag to the stabilized location. * * This moves `supports.color.__experimentalDuotone` to `supports.filter.duotone`. * * @since 6.3.0 * * @param array $settings Current block type settings. * @param array $metadata Block metadata as read in via block.json. * @return array Filtered block type settings. */ public static function migrate_experimental_duotone_support_flag($settings, $metadata) { } /** * Gets the CSS filter property value from a preset. * * Exported for the deprecated function wp_get_duotone_filter_id(). * * @internal * * @since 6.3.0 * @deprecated 6.3.0 * * @param array $preset The duotone preset. * @return string The CSS filter property value. */ public static function get_filter_css_property_value_from_preset($preset) { } } /** * Facilitates adding of the WordPress editor as used on the Write and Edit screens. * * @package WordPress * @since 3.3.0 * * Private, not included by default. See wp_editor() in wp-includes/general-template.php. */ #[\AllowDynamicProperties] final class _WP_Editors { public static $mce_locale; /** * Parse default arguments for the editor instance. * * @since 3.3.0 * * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances. * Should not contain square brackets. * @param array $settings { * Array of editor arguments. * * @type bool $wpautop Whether to use wpautop(). Default true. * @type bool $media_buttons Whether to show the Add Media/other media buttons. * @type string $default_editor When both TinyMCE and Quicktags are used, set which * editor is shown on page load. Default empty. * @type bool $drag_drop_upload Whether to enable drag & drop on the editor uploading. Default false. * Requires the media modal. * @type string $textarea_name Give the textarea a unique name here. Square brackets * can be used here. Default $editor_id. * @type int $textarea_rows Number rows in the editor textarea. Default 20. * @type string|int $tabindex Tabindex value to use. Default empty. * @type string $tabfocus_elements The previous and next element ID to move the focus to * when pressing the Tab key in TinyMCE. Default ':prev,:next'. * @type string $editor_css Intended for extra styles for both Visual and Text editors. * Should include `<style>` tags, and can use "scoped". Default empty. * @type string $editor_class Extra classes to add to the editor textarea element. Default empty. * @type bool $teeny Whether to output the minimal editor config. Examples include * Press This and the Comment editor. Default false. * @type bool $dfw Deprecated in 4.1. Unused. * @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to * TinyMCE using an array. Default true. * @type bool|array $quicktags Whether to load Quicktags. Can be used to pass settings directly to * Quicktags using an array. Default true. * } * @return array Parsed arguments array. * @phpstan-param array{ * wpautop?: bool, * media_buttons?: bool, * default_editor?: string, * drag_drop_upload?: bool, * textarea_name?: string, * textarea_rows?: int, * tabindex?: string|int, * tabfocus_elements?: string, * editor_css?: string, * editor_class?: string, * teeny?: bool, * dfw?: bool, * tinymce?: bool|array, * quicktags?: bool|array, * } $settings */ public static function parse_settings($editor_id, $settings) { } /** * Outputs the HTML for a single instance of the editor. * * @since 3.3.0 * * @global WP_Screen $current_screen WordPress current screen object. * * @param string $content Initial content for the editor. * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances. * Should not contain square brackets. * @param array $settings See _WP_Editors::parse_settings() for description. * @phpstan-param array{ * wpautop?: bool, * media_buttons?: bool, * default_editor?: string, * drag_drop_upload?: bool, * textarea_name?: string, * textarea_rows?: int, * tabindex?: string|int, * tabfocus_elements?: string, * editor_css?: string, * editor_class?: string, * teeny?: bool, * dfw?: bool, * tinymce?: bool|array, * quicktags?: bool|array, * } $settings See _WP_Editors::parse_settings() */ public static function editor($content, $editor_id, $settings = array()) { } /** * @since 3.3.0 * * @param string $editor_id Unique editor identifier, e.g. 'content'. * @param array $set Array of editor arguments. */ public static function editor_settings($editor_id, $set) { } /** * @since 3.3.0 * * @param bool $default_scripts Optional. Whether default scripts should be enqueued. Default false. */ public static function enqueue_scripts($default_scripts = \false) { } /** * Enqueue all editor scripts. * For use when the editor is going to be initialized after page load. * * @since 4.8.0 * @phpstan-return void */ public static function enqueue_default_editor() { } /** * Print (output) all editor scripts and default settings. * For use when the editor is going to be initialized after page load. * * @since 4.8.0 */ public static function print_default_editor_scripts() { } /** * Returns the TinyMCE locale. * * @since 4.8.0 * * @return string */ public static function get_mce_locale() { } /** * Returns the TinyMCE base URL. * * @since 4.8.0 * * @return string */ public static function get_baseurl() { } /** * Translates the default TinyMCE strings and returns them as JSON encoded object ready to be loaded with tinymce.addI18n(), * or as JS snippet that should run after tinymce.js is loaded. * * @since 3.9.0 * * @param string $mce_locale The locale used for the editor. * @param bool $json_only Optional. Whether to include the JavaScript calls to tinymce.addI18n() and * tinymce.ScriptLoader.markDone(). Default false. * @return string Translation object, JSON encoded. */ public static function wp_mce_translation($mce_locale = '', $json_only = \false) { } /** * Force uncompressed TinyMCE when a custom theme has been defined. * * The compressed TinyMCE file cannot deal with custom themes, so this makes * sure that WordPress uses the uncompressed TinyMCE file if a theme is defined. * Even if the website is running on a production environment. * * @since 5.0.0 * @phpstan-return void */ public static function force_uncompressed_tinymce() { } /** * Print (output) the main TinyMCE scripts. * * @since 4.8.0 * * @global bool $concatenate_scripts * @phpstan-return void */ public static function print_tinymce_scripts() { } /** * Print (output) the TinyMCE configuration and initialization scripts. * * @since 3.3.0 * * @global string $tinymce_version */ public static function editor_js() { } /** * Outputs the HTML for distraction-free writing mode. * * @since 3.2.0 * @deprecated 4.3.0 */ public static function wp_fullscreen_html() { } /** * Performs post queries for internal linking. * * @since 3.1.0 * * @param array $args { * Optional. Array of link query arguments. * * @type int $pagenum Page number. Default 1. * @type string $s Search keywords. * } * @return array|false $results { * An array of associative arrays of query results, false if there are none. * * @type array ...$0 { * @type int $ID Post ID. * @type string $title The trimmed, escaped post title. * @type string $permalink Post permalink. * @type string $info A 'Y/m/d'-formatted date for 'post' post type, * the 'singular_name' post type label otherwise. * } * } * @phpstan-param array{ * pagenum?: int, * s?: string, * } $args * @phpstan-return false|array<int|string, array{ * ID: int, * title: string, * permalink: string, * info: string, * }> */ public static function wp_link_query($args = array()) { } /** * Dialog for internal linking. * * @since 3.1.0 * @phpstan-return void */ public static function wp_link_dialog() { } } /** * API for easily embedding rich media such as videos and images into content. * * @package WordPress * @subpackage Embed * @since 2.9.0 */ #[\AllowDynamicProperties] class WP_Embed { public $handlers = array(); public $post_ID; public $usecache = \true; public $linkifunknown = \true; public $last_attr = array(); public $last_url = ''; /** * When a URL cannot be embedded, return false instead of returning a link * or the URL. * * Bypasses the {@see 'embed_maybe_make_link'} filter. * * @var bool */ public $return_false_on_fail = \false; /** * Constructor */ public function __construct() { } /** * Processes the [embed] shortcode. * * Since the [embed] shortcode needs to be run earlier than other shortcodes, * this function removes all existing shortcodes, registers the [embed] shortcode, * calls do_shortcode(), and then re-registers the old shortcodes. * * @global array $shortcode_tags * * @param string $content Content to parse. * @return string Content with shortcode parsed. */ public function run_shortcode($content) { } /** * If a post/page was saved, then output JavaScript to make * an Ajax request that will call WP_Embed::cache_oembed(). * @phpstan-return void */ public function maybe_run_ajax_cache() { } /** * Registers an embed handler. * * Do not use this function directly, use wp_embed_register_handler() instead. * * This function should probably also only be used for sites that do not support oEmbed. * * @param string $id An internal ID/name for the handler. Needs to be unique. * @param string $regex The regex that will be used to see if this handler should be used for a URL. * @param callable $callback The callback function that will be called if the regex is matched. * @param int $priority Optional. Used to specify the order in which the registered handlers will be tested. * Lower numbers correspond with earlier testing, and handlers with the same priority are * tested in the order in which they were added to the action. Default 10. */ public function register_handler($id, $regex, $callback, $priority = 10) { } /** * Unregisters a previously-registered embed handler. * * Do not use this function directly, use wp_embed_unregister_handler() instead. * * @param string $id The handler ID that should be removed. * @param int $priority Optional. The priority of the handler to be removed (default: 10). */ public function unregister_handler($id, $priority = 10) { } /** * Returns embed HTML for a given URL from embed handlers. * * Attempts to convert a URL into embed HTML by checking the URL * against the regex of the registered embed handlers. * * @since 5.5.0 * * @param array $attr { * Shortcode attributes. Optional. * * @type int $width Width of the embed in pixels. * @type int $height Height of the embed in pixels. * } * @param string $url The URL attempting to be embedded. * @return string|false The embed HTML on success, false otherwise. * @phpstan-param array{ * width?: int, * height?: int, * } $attr */ public function get_embed_handler_html($attr, $url) { } /** * The do_shortcode() callback function. * * Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of * the registered embed handlers. If none of the regex matches and it's enabled, then the URL * will be given to the WP_oEmbed class. * * @param array $attr { * Shortcode attributes. Optional. * * @type int $width Width of the embed in pixels. * @type int $height Height of the embed in pixels. * } * @param string $url The URL attempting to be embedded. * @return string|false The embed HTML on success, otherwise the original URL. * `->maybe_make_link()` can return false on failure. * @phpstan-param array{ * width?: int, * height?: int, * } $attr */ public function shortcode($attr, $url = '') { } /** * Deletes all oEmbed caches. Unused by core as of 4.0.0. * * @param int $post_id Post ID to delete the caches for. * @phpstan-return void */ public function delete_oembed_caches($post_id) { } /** * Triggers a caching of all oEmbed results. * * @param int $post_id Post ID to do the caching for. * @phpstan-return void */ public function cache_oembed($post_id) { } /** * Passes any unlinked URLs that are on their own line to WP_Embed::shortcode() for potential embedding. * * @see WP_Embed::autoembed_callback() * * @param string $content The content to be searched. * @return string Potentially modified $content. */ public function autoembed($content) { } /** * Callback function for WP_Embed::autoembed(). * * @param array $matches A regex match array. * @return string The embed HTML on success, otherwise the original URL. */ public function autoembed_callback($matches) { } /** * Conditionally makes a hyperlink based on an internal class variable. * * @param string $url URL to potentially be linked. * @return string|false Linked URL or the original URL. False if 'return_false_on_fail' is true. */ public function maybe_make_link($url) { } /** * Finds the oEmbed cache post ID for a given cache key. * * @since 4.9.0 * * @param string $cache_key oEmbed cache key. * @return int|null Post ID on success, null on failure. */ public function find_oembed_post_id($cache_key) { } } /** * WordPress Error class. * * Container for checking for WordPress errors and error messages. Return * WP_Error and use is_wp_error() to check if this class is returned. Many * core WordPress functions pass this class in the event of an error and * if not handled properly will result in code errors. * * @since 2.1.0 */ #[\AllowDynamicProperties] class WP_Error { /** * Stores the list of errors. * * @since 2.1.0 * @var array */ public $errors = array(); /** * Stores the most recently added data for each error code. * * @since 2.1.0 * @var array */ public $error_data = array(); /** * Stores previously added data added for error codes, oldest-to-newest by code. * * @since 5.6.0 * @var array[] */ protected $additional_data = array(); /** * Initializes the error. * * If `$code` is empty, the other parameters will be ignored. * When `$code` is not empty, `$message` will be used even if * it is empty. The `$data` parameter will be used only if it * is not empty. * * Though the class is constructed with a single error code and * message, multiple codes can be added using the `add()` method. * * @since 2.1.0 * * @param string|int $code Error code. * @param string $message Error message. * @param mixed $data Optional. Error data. Default empty string. * @phpstan-return void */ public function __construct($code = '', $message = '', $data = '') { } /** * Retrieves all error codes. * * @since 2.1.0 * * @return array List of error codes, if available. */ public function get_error_codes() { } /** * Retrieves the first error code available. * * @since 2.1.0 * * @return string|int Empty string, if no error codes. */ public function get_error_code() { } /** * Retrieves all error messages, or the error messages for the given error code. * * @since 2.1.0 * * @param string|int $code Optional. Error code to retrieve the messages for. * Default empty string. * @return string[] Error strings on success, or empty array if there are none. */ public function get_error_messages($code = '') { } /** * Gets a single error message. * * This will get the first message available for the code. If no code is * given then the first code available will be used. * * @since 2.1.0 * * @param string|int $code Optional. Error code to retrieve the message for. * Default empty string. * @return string The error message. */ public function get_error_message($code = '') { } /** * Retrieves the most recently added error data for an error code. * * @since 2.1.0 * * @param string|int $code Optional. Error code. Default empty string. * @return mixed Error data, if it exists. */ public function get_error_data($code = '') { } /** * Verifies if the instance contains errors. * * @since 5.1.0 * * @return bool If the instance contains errors. */ public function has_errors() { } /** * Adds an error or appends an additional message to an existing error. * * @since 2.1.0 * * @param string|int $code Error code. * @param string $message Error message. * @param mixed $data Optional. Error data. Default empty string. */ public function add($code, $message, $data = '') { } /** * Adds data to an error with the given code. * * @since 2.1.0 * @since 5.6.0 Errors can now contain more than one item of error data. {@see WP_Error::$additional_data}. * * @param mixed $data Error data. * @param string|int $code Error code. */ public function add_data($data, $code = '') { } /** * Retrieves all error data for an error code in the order in which the data was added. * * @since 5.6.0 * * @param string|int $code Error code. * @return mixed[] Array of error data, if it exists. */ public function get_all_error_data($code = '') { } /** * Removes the specified error. * * This function removes all error messages associated with the specified * error code, along with any error data for that code. * * @since 4.1.0 * * @param string|int $code Error code. */ public function remove($code) { } /** * Merges the errors in the given error object into this one. * * @since 5.6.0 * * @param WP_Error $error Error object to merge. */ public function merge_from(\WP_Error $error) { } /** * Exports the errors in this object into the given one. * * @since 5.6.0 * * @param WP_Error $error Error object to export into. */ public function export_to(\WP_Error $error) { } /** * Copies errors from one WP_Error instance to another. * * @since 5.6.0 * * @param WP_Error $from The WP_Error to copy from. * @param WP_Error $to The WP_Error to copy to. */ protected static function copy_errors(\WP_Error $from, \WP_Error $to) { } } /** * Core base Exception class. * * Future, more specific, Exceptions should always extend this base class. * * @since 6.7.0 */ class WP_Exception extends \Exception { } /** * Core class used as the default shutdown handler for fatal errors. * * A drop-in 'fatal-error-handler.php' can be used to override the instance of this class and use a custom * implementation for the fatal error handler that WordPress registers. The custom class should extend this class and * can override its methods individually as necessary. The file must return the instance of the class that should be * registered. * * @since 5.2.0 */ #[\AllowDynamicProperties] class WP_Fatal_Error_Handler { /** * Runs the shutdown handler. * * This method is registered via `register_shutdown_function()`. * * @since 5.2.0 * * @global WP_Locale $wp_locale WordPress date and time locale object. * @phpstan-return void */ public function handle() { } /** * Detects the error causing the crash if it should be handled. * * @since 5.2.0 * * @return array|null Error information returned by `error_get_last()`, or null * if none was recorded or the error should not be handled. */ protected function detect_error() { } /** * Determines whether we are dealing with an error that WordPress should handle * in order to protect the admin backend against WSODs. * * @since 5.2.0 * * @param array $error Error information retrieved from `error_get_last()`. * @return bool Whether WordPress should handle this error. */ protected function should_handle_error($error) { } /** * Displays the PHP error template and sends the HTTP status code, typically 500. * * A drop-in 'php-error.php' can be used as a custom template. This drop-in should control the HTTP status code and * print the HTML markup indicating that a PHP error occurred. Note that this drop-in may potentially be executed * very early in the WordPress bootstrap process, so any core functions used that are not part of * `wp-includes/load.php` should be checked for before being called. * * If no such drop-in is available, this will call {@see WP_Fatal_Error_Handler::display_default_error_template()}. * * @since 5.2.0 * @since 5.3.0 The `$handled` parameter was added. * * @param array $error Error information retrieved from `error_get_last()`. * @param true|WP_Error $handled Whether Recovery Mode handled the fatal error. * @phpstan-return void */ protected function display_error_template($error, $handled) { } /** * Displays the default PHP error template. * * This method is called conditionally if no 'php-error.php' drop-in is available. * * It calls {@see wp_die()} with a message indicating that the site is experiencing technical difficulties and a * login link to the admin backend. The {@see 'wp_php_error_message'} and {@see 'wp_php_error_args'} filters can * be used to modify these parameters. * * @since 5.2.0 * @since 5.3.0 The `$handled` parameter was added. * * @param array $error Error information retrieved from `error_get_last()`. * @param true|WP_Error $handled Whether Recovery Mode handled the fatal error. */ protected function display_default_error_template($error, $handled) { } } /** * Core class used to implement feed cache transients. * * @since 2.8.0 * @since 6.7.0 Now properly implements the SimplePie\Cache\Base interface. */ #[\AllowDynamicProperties] class WP_Feed_Cache_Transient implements \SimplePie\Cache\Base { /** * Holds the transient name. * * @since 2.8.0 * @var string */ public $name; /** * Holds the transient mod name. * * @since 2.8.0 * @var string */ public $mod_name; /** * Holds the cache duration in seconds. * * Defaults to 43200 seconds (12 hours). * * @since 2.8.0 * @var int */ public $lifetime = 43200; /** * Creates a new (transient) cache object. * * @since 2.8.0 * @since 3.2.0 Updated to use a PHP5 constructor. * @since 6.7.0 Parameter names have been updated to be in line with the `SimplePie\Cache\Base` interface. * * @param string $location URL location (scheme is used to determine handler). * @param string $name Unique identifier for cache object. * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either `TYPE_FEED` ('spc') for SimplePie data, * or `TYPE_IMAGE` ('spi') for image data. */ public function __construct($location, $name, $type) { } /** * Saves data to the transient. * * @since 2.8.0 * * @param array|SimplePie\SimplePie $data Data to save. If passed a SimplePie object, * only cache the `$data` property. * @return true Always true. */ public function save($data) { } /** * Retrieves the data saved in the transient. * * @since 2.8.0 * * @return array Data for `SimplePie::$data`. */ public function load() { } /** * Gets mod transient. * * @since 2.8.0 * * @return int Timestamp. */ public function mtime() { } /** * Sets mod transient. * * @since 2.8.0 * * @return bool False if value was not set and true if value was set. */ public function touch() { } /** * Deletes transients. * * @since 2.8.0 * * @return true Always true. */ public function unlink() { } } /** * Core class used to implement a feed cache. * * @since 2.8.0 */ #[\AllowDynamicProperties] class WP_Feed_Cache extends \SimplePie\Cache { /** * Creates a new SimplePie\Cache object. * * @since 2.8.0 * * @param string $location URL location (scheme is used to determine handler). * @param string $filename Unique identifier for cache object. * @param string $extension 'spi' or 'spc'. * @return WP_Feed_Cache_Transient Feed cache handler object that uses transients. */ public function create($location, $filename, $extension) { } } /** * Core class used to implement action and filter hook functionality. * * @since 4.7.0 * * @see Iterator * @see ArrayAccess */ #[\AllowDynamicProperties] final class WP_Hook implements \Iterator, \ArrayAccess { /** * Hook callbacks. * * @since 4.7.0 * @var array */ public $callbacks = array(); /** * Adds a callback function to a filter hook. * * @since 4.7.0 * * @param string $hook_name The name of the filter to add the callback to. * @param callable $callback The callback to be run when the filter is applied. * @param int $priority The order in which the functions associated with a particular filter * are executed. Lower numbers correspond with earlier execution, * and functions with the same priority are executed in the order * in which they were added to the filter. * @param int $accepted_args The number of arguments the function accepts. */ public function add_filter($hook_name, $callback, $priority, $accepted_args) { } /** * Removes a callback function from a filter hook. * * @since 4.7.0 * * @param string $hook_name The filter hook to which the function to be removed is hooked. * @param callable|string|array $callback The callback to be removed from running when the filter is applied. * This method can be called unconditionally to speculatively remove * a callback that may or may not exist. * @param int $priority The exact priority used when adding the original filter callback. * @return bool Whether the callback existed before it was removed. */ public function remove_filter($hook_name, $callback, $priority) { } /** * Checks if a specific callback has been registered for this hook. * * When using the `$callback` argument, this function may return a non-boolean value * that evaluates to false (e.g. 0), so use the `===` operator for testing the return value. * * @since 4.7.0 * * @param string $hook_name Optional. The name of the filter hook. Default empty. * @param callable|string|array|false $callback Optional. The callback to check for. * This method can be called unconditionally to speculatively check * a callback that may or may not exist. Default false. * @return bool|int If `$callback` is omitted, returns boolean for whether the hook has * anything registered. When checking a specific function, the priority * of that hook is returned, or false if the function is not attached. */ public function has_filter($hook_name = '', $callback = \false) { } /** * Checks if any callbacks have been registered for this hook. * * @since 4.7.0 * * @return bool True if callbacks have been registered for the current hook, otherwise false. */ public function has_filters() { } /** * Removes all callbacks from the current filter. * * @since 4.7.0 * * @param int|false $priority Optional. The priority number to remove. Default false. * @phpstan-return void */ public function remove_all_filters($priority = \false) { } /** * Calls the callback functions that have been added to a filter hook. * * @since 4.7.0 * * @param mixed $value The value to filter. * @param array $args Additional parameters to pass to the callback functions. * This array is expected to include $value at index 0. * @return mixed The filtered value after all hooked functions are applied to it. */ public function apply_filters($value, $args) { } /** * Calls the callback functions that have been added to an action hook. * * @since 4.7.0 * * @param array $args Parameters to pass to the callback functions. */ public function do_action($args) { } /** * Processes the functions hooked into the 'all' hook. * * @since 4.7.0 * * @param array $args Arguments to pass to the hook callbacks. Passed by reference. */ public function do_all_hook(&$args) { } /** * Return the current priority level of the currently running iteration of the hook. * * @since 4.7.0 * * @return int|false If the hook is running, return the current priority level. * If it isn't running, return false. */ public function current_priority() { } /** * Normalizes filters set up before WordPress has initialized to WP_Hook objects. * * The `$filters` parameter should be an array keyed by hook name, with values * containing either: * * - A `WP_Hook` instance * - An array of callbacks keyed by their priorities * * Examples: * * $filters = array( * 'wp_fatal_error_handler_enabled' => array( * 10 => array( * array( * 'accepted_args' => 0, * 'function' => function() { * return false; * }, * ), * ), * ), * ); * * @since 4.7.0 * * @param array $filters Filters to normalize. See documentation above for details. * @return WP_Hook[] Array of normalized filters. */ public static function build_preinitialized_hooks($filters) { } /** * Determines whether an offset value exists. * * @since 4.7.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetexists.php * * @param mixed $offset An offset to check for. * @return bool True if the offset exists, false otherwise. */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Retrieves a value at a specified offset. * * @since 4.7.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetget.php * * @param mixed $offset The offset to retrieve. * @return mixed If set, the value at the specified offset, null otherwise. */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } /** * Sets a value at a specified offset. * * @since 4.7.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetset.php * * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } /** * Unsets a specified offset. * * @since 4.7.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetunset.php * * @param mixed $offset The offset to unset. */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { } /** * Returns the current element. * * @since 4.7.0 * * @link https://www.php.net/manual/en/iterator.current.php * * @return array Of callbacks at current priority. */ #[\ReturnTypeWillChange] public function current() { } /** * Moves forward to the next element. * * @since 4.7.0 * * @link https://www.php.net/manual/en/iterator.next.php * * @return array Of callbacks at next priority. */ #[\ReturnTypeWillChange] public function next() { } /** * Returns the key of the current element. * * @since 4.7.0 * * @link https://www.php.net/manual/en/iterator.key.php * * @return mixed Returns current priority on success, or NULL on failure */ #[\ReturnTypeWillChange] public function key() { } /** * Checks if current position is valid. * * @since 4.7.0 * * @link https://www.php.net/manual/en/iterator.valid.php * * @return bool Whether the current position is valid. */ #[\ReturnTypeWillChange] public function valid() { } /** * Rewinds the Iterator to the first element. * * @since 4.7.0 * * @link https://www.php.net/manual/en/iterator.rewind.php */ #[\ReturnTypeWillChange] public function rewind() { } } /** * Core class used to encapsulate a single cookie object for internal use. * * Returned cookies are represented using this class, and when cookies are set, if they are not * already a WP_Http_Cookie() object, then they are turned into one. * * @todo The WordPress convention is to use underscores instead of camelCase for function and method * names. Need to switch to use underscores instead for the methods. * * @since 2.8.0 */ #[\AllowDynamicProperties] class WP_Http_Cookie { /** * Cookie name. * * @since 2.8.0 * * @var string */ public $name; /** * Cookie value. * * @since 2.8.0 * * @var string */ public $value; /** * When the cookie expires. Unix timestamp or formatted date. * * @since 2.8.0 * * @var string|int|null */ public $expires; /** * Cookie URL path. * * @since 2.8.0 * * @var string */ public $path; /** * Cookie Domain. * * @since 2.8.0 * * @var string */ public $domain; /** * Cookie port or comma-separated list of ports. * * @since 2.8.0 * * @var int|string */ public $port; /** * host-only flag. * * @since 5.2.0 * * @var bool */ public $host_only; /** * Sets up this cookie object. * * The parameter $data should be either an associative array containing the indices names below * or a header string detailing it. * * @since 2.8.0 * @since 5.2.0 Added `host_only` to the `$data` parameter. * * @param string|array $data { * Raw cookie data as header string or data array. * * @type string $name Cookie name. * @type mixed $value Value. Should NOT already be urlencoded. * @type string|int|null $expires Optional. Unix timestamp or formatted date. Default null. * @type string $path Optional. Path. Default '/'. * @type string $domain Optional. Domain. Default host of parsed $requested_url. * @type int|string $port Optional. Port or comma-separated list of ports. Default null. * @type bool $host_only Optional. host-only storage flag. Default true. * } * @param string $requested_url The URL which the cookie was set on, used for default $domain * and $port values. * @phpstan-param array{ * name?: string, * value?: mixed, * expires?: string|int|null, * path?: string, * domain?: string, * port?: int|string, * host_only?: bool, * } $data * @phpstan-return void */ public function __construct($data, $requested_url = '') { } /** * Confirms that it's OK to send this cookie to the URL checked against. * * Decision is based on RFC 2109/2965, so look there for details on validity. * * @since 2.8.0 * * @param string $url URL you intend to send this cookie to * @return bool true if allowed, false otherwise. */ public function test($url) { } /** * Convert cookie name and value back to header string. * * @since 2.8.0 * * @return string Header encoded cookie name and value. */ public function getHeaderValue() { } /** * Retrieve cookie header for usage in the rest of the WordPress HTTP API. * * @since 2.8.0 * * @return string */ public function getFullHeader() { } /** * Retrieves cookie attributes. * * @since 4.6.0 * * @return array { * List of attributes. * * @type string|int|null $expires When the cookie expires. Unix timestamp or formatted date. * @type string $path Cookie URL path. * @type string $domain Cookie domain. * } * @phpstan-return array{ * expires: string|int|null, * path: string, * domain: string, * } */ public function get_attributes() { } } /** * Core class used to integrate Curl as an HTTP transport. * * HTTP request method uses Curl extension to retrieve the url. * * Requires the Curl extension to be installed. * * @since 2.7.0 * @deprecated 6.4.0 Use WP_Http * @see WP_Http */ #[\AllowDynamicProperties] class WP_Http_Curl { /** * Send a HTTP request to a URI using cURL extension. * * @since 2.7.0 * * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error */ public function request($url, $args = array()) { } /** * Determines whether this class can be used for retrieving a URL. * * @since 2.7.0 * * @param array $args Optional. Array of request arguments. Default empty array. * @return bool False means this class can not be used, true means it can. */ public static function test($args = array()) { } } /** * Core class used to implement deflate and gzip transfer encoding support for HTTP requests. * * Includes RFC 1950, RFC 1951, and RFC 1952. * * @since 2.8.0 */ #[\AllowDynamicProperties] class WP_Http_Encoding { /** * Compress raw string using the deflate format. * * Supports the RFC 1951 standard. * * @since 2.8.0 * * @param string $raw String to compress. * @param int $level Optional. Compression level, 9 is highest. Default 9. * @param string $supports Optional, not used. When implemented it will choose * the right compression based on what the server supports. * @return string|false Compressed string on success, false on failure. */ public static function compress($raw, $level = 9, $supports = \null) { } /** * Decompression of deflated string. * * Will attempt to decompress using the RFC 1950 standard, and if that fails * then the RFC 1951 standard deflate will be attempted. Finally, the RFC * 1952 standard gzip decode will be attempted. If all fail, then the * original compressed string will be returned. * * @since 2.8.0 * * @param string $compressed String to decompress. * @param int $length The optional length of the compressed data. * @return string|false Decompressed string on success, false on failure. */ public static function decompress($compressed, $length = \null) { } /** * Decompression of deflated string while staying compatible with the majority of servers. * * Certain Servers will return deflated data with headers which PHP's gzinflate() * function cannot handle out of the box. The following function has been created from * various snippets on the gzinflate() PHP documentation. * * Warning: Magic numbers within. Due to the potential different formats that the compressed * data may be returned in, some "magic offsets" are needed to ensure proper decompression * takes place. For a simple pragmatic way to determine the magic offset in use, see: * https://core.trac.wordpress.org/ticket/18273 * * @since 2.8.1 * * @link https://core.trac.wordpress.org/ticket/18273 * @link https://www.php.net/manual/en/function.gzinflate.php#70875 * @link https://www.php.net/manual/en/function.gzinflate.php#77336 * * @param string $gz_data String to decompress. * @return string|false Decompressed string on success, false on failure. */ public static function compatible_gzinflate($gz_data) { } /** * What encoding types to accept and their priority values. * * @since 2.8.0 * * @param string $url * @param array $args * @return string Types of encoding to accept. */ public static function accept_encoding($url, $args) { } /** * What encoding the content used when it was compressed to send in the headers. * * @since 2.8.0 * * @return string Content-Encoding string to send in the header. */ public static function content_encoding() { } /** * Whether the content be decoded based on the headers. * * @since 2.8.0 * * @param array|string $headers All of the available headers. * @return bool */ public static function should_decode($headers) { } /** * Whether decompression and compression are supported by the PHP version. * * Each function is tested instead of checking for the zlib extension, to * ensure that the functions all exist in the PHP version and aren't * disabled. * * @since 2.8.0 * * @return bool */ public static function is_available() { } } /** * WP_HTTP_IXR_Client * * @package WordPress * @since 3.1.0 */ #[\AllowDynamicProperties] class WP_HTTP_IXR_Client extends \IXR_Client { public $scheme; /** * @var IXR_Error */ public $error; /** * @param string $server * @param string|false $path * @param int|false $port * @param int $timeout */ public function __construct($server, $path = \false, $port = \false, $timeout = 15) { } /** * @since 3.1.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */ public function query(...$args) { } } /** * Core class used to implement HTTP API proxy support. * * There are caveats to proxy support. It requires that defines be made in the wp-config.php file to * enable proxy support. There are also a few filters that plugins can hook into for some of the * constants. * * Please note that only BASIC authentication is supported by most transports. * cURL MAY support more methods (such as NTLM authentication) depending on your environment. * * The constants are as follows: * <ol> * <li>WP_PROXY_HOST - Enable proxy support and host for connecting.</li> * <li>WP_PROXY_PORT - Proxy port for connection. No default, must be defined.</li> * <li>WP_PROXY_USERNAME - Proxy username, if it requires authentication.</li> * <li>WP_PROXY_PASSWORD - Proxy password, if it requires authentication.</li> * <li>WP_PROXY_BYPASS_HOSTS - Will prevent the hosts in this list from going through the proxy. * You do not need to have localhost and the site host in this list, because they will not be passed * through the proxy. The list should be presented in a comma separated list, wildcards using * are supported. Example: *.wordpress.org</li> * </ol> * * An example can be as seen below. * * define('WP_PROXY_HOST', '192.168.84.101'); * define('WP_PROXY_PORT', '8080'); * define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com, *.wordpress.org'); * * @link https://core.trac.wordpress.org/ticket/4011 Proxy support ticket in WordPress. * @link https://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_PROXY_BYPASS_HOSTS * * @since 2.8.0 */ #[\AllowDynamicProperties] class WP_HTTP_Proxy { /** * Whether proxy connection should be used. * * Constants which control this behavior: * * - `WP_PROXY_HOST` * - `WP_PROXY_PORT` * * @since 2.8.0 * * @return bool */ public function is_enabled() { } /** * Whether authentication should be used. * * Constants which control this behavior: * * - `WP_PROXY_USERNAME` * - `WP_PROXY_PASSWORD` * * @since 2.8.0 * * @return bool */ public function use_authentication() { } /** * Retrieve the host for the proxy server. * * @since 2.8.0 * * @return string */ public function host() { } /** * Retrieve the port for the proxy server. * * @since 2.8.0 * * @return string */ public function port() { } /** * Retrieve the username for proxy authentication. * * @since 2.8.0 * * @return string */ public function username() { } /** * Retrieve the password for proxy authentication. * * @since 2.8.0 * * @return string */ public function password() { } /** * Retrieve authentication string for proxy authentication. * * @since 2.8.0 * * @return string */ public function authentication() { } /** * Retrieve header string for proxy authentication. * * @since 2.8.0 * * @return string */ public function authentication_header() { } /** * Determines whether the request should be sent through a proxy. * * We want to keep localhost and the site URL from being sent through the proxy, because * some proxies can not handle this. We also have the constant available for defining other * hosts that won't be sent through the proxy. * * @since 2.8.0 * * @param string $uri URL of the request. * @return bool Whether to send the request through the proxy. */ public function send_through_proxy($uri) { } } /** * Bridge to connect Requests internal hooks to WordPress actions. * * @since 4.7.0 * * @see WpOrg\Requests\Hooks */ #[\AllowDynamicProperties] class WP_HTTP_Requests_Hooks extends \WpOrg\Requests\Hooks { /** * Requested URL. * * @var string Requested URL. */ protected $url; /** * WordPress WP_HTTP request data. * * @var array Request data in WP_Http format. */ protected $request = array(); /** * Constructor. * * @param string $url URL to request. * @param array $request Request data in WP_Http format. */ public function __construct($url, $request) { } /** * Dispatch a Requests hook to a native WordPress action. * * @param string $hook Hook name. * @param array $parameters Parameters to pass to callbacks. * @return bool True if hooks were run, false if nothing was hooked. */ public function dispatch($hook, $parameters = array()) { } } /** * Core class used to prepare HTTP responses. * * @since 4.4.0 */ #[\AllowDynamicProperties] class WP_HTTP_Response { /** * Response data. * * @since 4.4.0 * @var mixed */ public $data; /** * Response headers. * * @since 4.4.0 * @var array */ public $headers; /** * Response status. * * @since 4.4.0 * @var int */ public $status; /** * Constructor. * * @since 4.4.0 * * @param mixed $data Response data. Default null. * @param int $status Optional. HTTP status code. Default 200. * @param array $headers Optional. HTTP header map. Default empty array. */ public function __construct($data = \null, $status = 200, $headers = array()) { } /** * Retrieves headers associated with the response. * * @since 4.4.0 * * @return array Map of header name to header value. */ public function get_headers() { } /** * Sets all header values. * * @since 4.4.0 * * @param array $headers Map of header name to header value. */ public function set_headers($headers) { } /** * Sets a single HTTP header. * * @since 4.4.0 * * @param string $key Header name. * @param string $value Header value. * @param bool $replace Optional. Whether to replace an existing header of the same name. * Default true. */ public function header($key, $value, $replace = \true) { } /** * Retrieves the HTTP return code for the response. * * @since 4.4.0 * * @return int The 3-digit HTTP status code. */ public function get_status() { } /** * Sets the 3-digit HTTP status code. * * @since 4.4.0 * * @param int $code HTTP status. */ public function set_status($code) { } /** * Retrieves the response data. * * @since 4.4.0 * * @return mixed Response data. */ public function get_data() { } /** * Sets the response data. * * @since 4.4.0 * * @param mixed $data Response data. */ public function set_data($data) { } /** * Retrieves the response data for JSON serialization. * * It is expected that in most implementations, this will return the same as get_data(), * however this may be different if you want to do custom JSON data handling. * * @since 4.4.0 * * @return mixed Any JSON-serializable value. */ public function jsonSerialize() { } } /** * Core wrapper object for a WpOrg\Requests\Response for standardization. * * @since 4.6.0 * * @see WP_HTTP_Response */ class WP_HTTP_Requests_Response extends \WP_HTTP_Response { /** * Requests Response object. * * @since 4.6.0 * @var \WpOrg\Requests\Response */ protected $response; /** * Filename the response was saved to. * * @since 4.6.0 * @var string|null */ protected $filename; /** * Constructor. * * @since 4.6.0 * * @param \WpOrg\Requests\Response $response HTTP response. * @param string $filename Optional. File name. Default empty. */ public function __construct(\WpOrg\Requests\Response $response, $filename = '') { } /** * Retrieves the response object for the request. * * @since 4.6.0 * * @return WpOrg\Requests\Response HTTP response. */ public function get_response_object() { } /** * Retrieves headers associated with the response. * * @since 4.6.0 * * @return \WpOrg\Requests\Utility\CaseInsensitiveDictionary Map of header name to header value. */ public function get_headers() { } /** * Sets all header values. * * @since 4.6.0 * * @param array $headers Map of header name to header value. */ public function set_headers($headers) { } /** * Sets a single HTTP header. * * @since 4.6.0 * * @param string $key Header name. * @param string $value Header value. * @param bool $replace Optional. Whether to replace an existing header of the same name. * Default true. */ public function header($key, $value, $replace = \true) { } /** * Retrieves the HTTP return code for the response. * * @since 4.6.0 * * @return int The 3-digit HTTP status code. */ public function get_status() { } /** * Sets the 3-digit HTTP status code. * * @since 4.6.0 * * @param int $code HTTP status. */ public function set_status($code) { } /** * Retrieves the response data. * * @since 4.6.0 * * @return string Response data. */ public function get_data() { } /** * Sets the response data. * * @since 4.6.0 * * @param string $data Response data. */ public function set_data($data) { } /** * Retrieves cookies from the response. * * @since 4.6.0 * * @return WP_HTTP_Cookie[] List of cookie objects. */ public function get_cookies() { } /** * Converts the object to a WP_Http response array. * * @since 4.6.0 * * @return array WP_Http response array, per WP_Http::request(). */ public function to_array() { } } /** * Core class used to integrate PHP Streams as an HTTP transport. * * @since 2.7.0 * @since 3.7.0 Combined with the fsockopen transport and switched to `stream_socket_client()`. * @deprecated 6.4.0 Use WP_Http * @see WP_Http */ #[\AllowDynamicProperties] class WP_Http_Streams { /** * Send a HTTP request to a URI using PHP Streams. * * @see WP_Http::request() For default options descriptions. * * @since 2.7.0 * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client(). * * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error */ public function request($url, $args = array()) { } /** * Verifies the received SSL certificate against its Common Names and subjectAltName fields. * * PHP's SSL verifications only verify that it's a valid Certificate, it doesn't verify if * the certificate is valid for the hostname which was requested. * This function verifies the requested hostname against certificate's subjectAltName field, * if that is empty, or contains no DNS entries, a fallback to the Common Name field is used. * * IP Address support is included if the request is being made to an IP address. * * @since 3.7.0 * * @param resource $stream The PHP Stream which the SSL request is being made over * @param string $host The hostname being requested * @return bool If the certificate presented in $stream is valid for $host */ public static function verify_ssl_certificate($stream, $host) { } /** * Determines whether this class can be used for retrieving a URL. * * @since 2.7.0 * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client(). * * @param array $args Optional. Array of request arguments. Default empty array. * @return bool False means this class can not be used, true means it can. */ public static function test($args = array()) { } } /** * Deprecated HTTP Transport method which used fsockopen. * * This class is not used, and is included for backward compatibility only. * All code should make use of WP_Http directly through its API. * * @see WP_HTTP::request * * @since 2.7.0 * @deprecated 3.7.0 Please use WP_HTTP::request() directly */ class WP_HTTP_Fsockopen extends \WP_Http_Streams { // For backward compatibility for users who are using the class directly. } /** * Core class used for managing HTTP transports and making HTTP requests. * * This class is used to consistently make outgoing HTTP requests easy for developers * while still being compatible with the many PHP configurations under which * WordPress runs. * * Debugging includes several actions, which pass different variables for debugging the HTTP API. * * @since 2.7.0 */ #[\AllowDynamicProperties] class WP_Http { // Aliases for HTTP response codes. const HTTP_CONTINUE = 100; const SWITCHING_PROTOCOLS = 101; const PROCESSING = 102; const EARLY_HINTS = 103; const OK = 200; const CREATED = 201; const ACCEPTED = 202; const NON_AUTHORITATIVE_INFORMATION = 203; const NO_CONTENT = 204; const RESET_CONTENT = 205; const PARTIAL_CONTENT = 206; const MULTI_STATUS = 207; const IM_USED = 226; const MULTIPLE_CHOICES = 300; const MOVED_PERMANENTLY = 301; const FOUND = 302; const SEE_OTHER = 303; const NOT_MODIFIED = 304; const USE_PROXY = 305; const RESERVED = 306; const TEMPORARY_REDIRECT = 307; const PERMANENT_REDIRECT = 308; const BAD_REQUEST = 400; const UNAUTHORIZED = 401; const PAYMENT_REQUIRED = 402; const FORBIDDEN = 403; const NOT_FOUND = 404; const METHOD_NOT_ALLOWED = 405; const NOT_ACCEPTABLE = 406; const PROXY_AUTHENTICATION_REQUIRED = 407; const REQUEST_TIMEOUT = 408; const CONFLICT = 409; const GONE = 410; const LENGTH_REQUIRED = 411; const PRECONDITION_FAILED = 412; const REQUEST_ENTITY_TOO_LARGE = 413; const REQUEST_URI_TOO_LONG = 414; const UNSUPPORTED_MEDIA_TYPE = 415; const REQUESTED_RANGE_NOT_SATISFIABLE = 416; const EXPECTATION_FAILED = 417; const IM_A_TEAPOT = 418; const MISDIRECTED_REQUEST = 421; const UNPROCESSABLE_ENTITY = 422; const LOCKED = 423; const FAILED_DEPENDENCY = 424; const TOO_EARLY = 425; const UPGRADE_REQUIRED = 426; const PRECONDITION_REQUIRED = 428; const TOO_MANY_REQUESTS = 429; const REQUEST_HEADER_FIELDS_TOO_LARGE = 431; const UNAVAILABLE_FOR_LEGAL_REASONS = 451; const INTERNAL_SERVER_ERROR = 500; const NOT_IMPLEMENTED = 501; const BAD_GATEWAY = 502; const SERVICE_UNAVAILABLE = 503; const GATEWAY_TIMEOUT = 504; const HTTP_VERSION_NOT_SUPPORTED = 505; const VARIANT_ALSO_NEGOTIATES = 506; const INSUFFICIENT_STORAGE = 507; const NOT_EXTENDED = 510; const NETWORK_AUTHENTICATION_REQUIRED = 511; /** * Send an HTTP request to a URI. * * Please note: The only URI that are supported in the HTTP Transport implementation * are the HTTP and HTTPS protocols. * * @since 2.7.0 * * @param string $url The request URL. * @param string|array $args { * Optional. Array or string of HTTP request arguments. * * @type string $method Request method. Accepts 'GET', 'POST', 'HEAD', 'PUT', 'DELETE', * 'TRACE', 'OPTIONS', or 'PATCH'. * Some transports technically allow others, but should not be * assumed. Default 'GET'. * @type float $timeout How long the connection should stay open in seconds. Default 5. * @type int $redirection Number of allowed redirects. Not supported by all transports. * Default 5. * @type string $httpversion Version of the HTTP protocol to use. Accepts '1.0' and '1.1'. * Default '1.0'. * @type string $user-agent User-agent value sent. * Default 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ). * @type bool $reject_unsafe_urls Whether to pass URLs through wp_http_validate_url(). * Default false. * @type bool $blocking Whether the calling code requires the result of the request. * If set to false, the request will be sent to the remote server, * and processing returned to the calling code immediately, the caller * will know if the request succeeded or failed, but will not receive * any response from the remote server. Default true. * @type string|array $headers Array or string of headers to send with the request. * Default empty array. * @type array $cookies List of cookies to send with the request. Default empty array. * @type string|array $body Body to send with the request. Default null. * @type bool $compress Whether to compress the $body when sending the request. * Default false. * @type bool $decompress Whether to decompress a compressed response. If set to false and * compressed content is returned in the response anyway, it will * need to be separately decompressed. Default true. * @type bool $sslverify Whether to verify SSL for the request. Default true. * @type string $sslcertificates Absolute path to an SSL certificate .crt file. * Default ABSPATH . WPINC . '/certificates/ca-bundle.crt'. * @type bool $stream Whether to stream to a file. If set to true and no filename was * given, it will be dropped it in the WP temp dir and its name will * be set using the basename of the URL. Default false. * @type string $filename Filename of the file to write to when streaming. $stream must be * set to true. Default null. * @type int $limit_response_size Size in bytes to limit the response to. Default null. * * } * @return array|WP_Error { * Array of response data, or a WP_Error instance upon error. * * @type \WpOrg\Requests\Utility\CaseInsensitiveDictionary $headers Response headers keyed by name. * @type string $body Response body. * @type array $response { * Array of HTTP response data. * * @type int|false $code HTTP response status code. * @type string|false $message HTTP response message. * } * @type WP_HTTP_Cookie[] $cookies Array of cookies set by the server. * @type string|null $filename Optional. Filename of the response. * @type WP_HTTP_Requests_Response|null $http_response Response object. * } * @phpstan-param array{ * method?: string, * timeout?: float, * redirection?: int, * httpversion?: string, * user-agent?: string, * reject_unsafe_urls?: bool, * blocking?: bool, * headers?: string|array, * cookies?: array, * body?: string|array, * compress?: bool, * decompress?: bool, * sslverify?: bool, * sslcertificates?: string, * stream?: bool, * filename?: string, * limit_response_size?: int, * } $args * @phpstan-return \WP_Error|array{ * headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, * body: string, * response: array{ * code: int|false, * message: string|false, * }, * cookies: WP_HTTP_Cookie[], * filename: string|null, * http_response: WP_HTTP_Requests_Response|null, * } * @phpstan-return array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int, message: string}, cookies: array<int, \WP_Http_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error */ public function request($url, $args = array()) { } /** * Normalizes cookies for using in Requests. * * @since 4.6.0 * * @param array $cookies Array of cookies to send with the request. * @return WpOrg\Requests\Cookie\Jar Cookie holder object. */ public static function normalize_cookies($cookies) { } /** * Match redirect behavior to browser handling. * * Changes 302 redirects from POST to GET to match browser handling. Per * RFC 7231, user agents can deviate from the strict reading of the * specification for compatibility purposes. * * @since 4.6.0 * * @param string $location URL to redirect to. * @param array $headers Headers for the redirect. * @param string|array $data Body to send with the request. * @param array $options Redirect request options. * @param WpOrg\Requests\Response $original Response object. */ public static function browser_redirect_compatibility($location, $headers, $data, &$options, $original) { } /** * Validate redirected URLs. * * @since 4.7.5 * * @throws WpOrg\Requests\Exception On unsuccessful URL validation. * @param string $location URL to redirect to. */ public static function validate_redirects($location) { } /** * Tests which transports are capable of supporting the request. * * @since 3.2.0 * @deprecated 6.4.0 Use WpOrg\Requests\Requests::get_transport_class() * @see WpOrg\Requests\Requests::get_transport_class() * * @param array $args Request arguments. * @param string $url URL to request. * @return string|false Class name for the first transport that claims to support the request. * False if no transport claims to support the request. */ public function _get_first_available_transport($args, $url = \null) { } /** * Uses the POST HTTP method. * * Used for sending data that is expected to be in the body. * * @since 2.7.0 * * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. * A WP_Error instance upon error. See WP_Http::response() for details. * @phpstan-return array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int, message: string}, cookies: array<int, \WP_Http_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error */ public function post($url, $args = array()) { } /** * Uses the GET HTTP method. * * Used for sending data that is expected to be in the body. * * @since 2.7.0 * * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. * A WP_Error instance upon error. See WP_Http::response() for details. * @phpstan-return array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int, message: string}, cookies: array<int, \WP_Http_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error */ public function get($url, $args = array()) { } /** * Uses the HEAD HTTP method. * * Used for sending data that is expected to be in the body. * * @since 2.7.0 * * @param string $url The request URL. * @param string|array $args Optional. Override the defaults. * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. * A WP_Error instance upon error. See WP_Http::response() for details. * @phpstan-return array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int, message: string}, cookies: array<int, \WP_Http_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error */ public function head($url, $args = array()) { } /** * Parses the responses and splits the parts into headers and body. * * @since 2.7.0 * * @param string $response The full response string. * @return array { * Array with response headers and body. * * @type string $headers HTTP response headers. * @type string $body HTTP response body. * } * @phpstan-return array{ * headers: string, * body: string, * } */ public static function processResponse($response) { } /** * Transforms header string into an array. * * @since 2.7.0 * * @param string|array $headers The original headers. If a string is passed, it will be converted * to an array. If an array is passed, then it is assumed to be * raw header data with numeric keys with the headers as the values. * No headers must be passed that were already processed. * @param string $url Optional. The URL that was requested. Default empty. * @return array { * Processed string headers. If duplicate headers are encountered, * then a numbered array is returned as the value of that header-key. * * @type array $response { * @type int $code The response status code. Default 0. * @type string $message The response message. Default empty. * } * @type array $newheaders The processed header data as a multidimensional array. * @type WP_Http_Cookie[] $cookies If the original headers contain the 'Set-Cookie' key, * an array containing `WP_Http_Cookie` objects is returned. * } * @phpstan-return array{ * response: array{ * code: int, * message: string, * }, * newheaders: array, * cookies: WP_Http_Cookie[], * } */ public static function processHeaders($headers, $url = '') { } /** * Takes the arguments for a ::request() and checks for the cookie array. * * If it's found, then it upgrades any basic name => value pairs to WP_Http_Cookie instances, * which are each parsed into strings and added to the Cookie: header (within the arguments array). * Edits the array by reference. * * @since 2.8.0 * * @param array $r Full array of args passed into ::request() */ public static function buildCookieHeader(&$r) { } /** * Decodes chunk transfer-encoding, based off the HTTP 1.1 specification. * * Based off the HTTP http_encoding_dechunk function. * * @link https://tools.ietf.org/html/rfc2616#section-19.4.6 Process for chunked decoding. * * @since 2.7.0 * * @param string $body Body content. * @return string Chunked decoded body on success or raw body on failure. */ public static function chunkTransferDecode($body) { } /** * Determines whether an HTTP API request to the given URL should be blocked. * * Those who are behind a proxy and want to prevent access to certain hosts may do so. This will * prevent plugins from working and core functionality, if you don't include `api.wordpress.org`. * * You block external URL requests by defining `WP_HTTP_BLOCK_EXTERNAL` as true in your `wp-config.php` * file and this will only allow localhost and your site to make requests. The constant * `WP_ACCESSIBLE_HOSTS` will allow additional hosts to go through for requests. The format of the * `WP_ACCESSIBLE_HOSTS` constant is a comma separated list of hostnames to allow, wildcard domains * are supported, eg `*.wordpress.org` will allow for all subdomains of `wordpress.org` to be contacted. * * @since 2.8.0 * * @link https://core.trac.wordpress.org/ticket/8927 Allow preventing external requests. * @link https://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_ACCESSIBLE_HOSTS * * @param string $uri URI of url. * @return bool True to block, false to allow. */ public function block_request($uri) { } /** * Used as a wrapper for PHP's parse_url() function that handles edgecases in < PHP 5.4.7. * * @deprecated 4.4.0 Use wp_parse_url() * @see wp_parse_url() * * @param string $url The URL to parse. * @return bool|array False on failure; Array of URL components on success; * See parse_url()'s return values. */ protected static function parse_url($url) { } /** * Converts a relative URL to an absolute URL relative to a given URL. * * If an Absolute URL is provided, no processing of that URL is done. * * @since 3.4.0 * * @param string $maybe_relative_path The URL which might be relative. * @param string $url The URL which $maybe_relative_path is relative to. * @return string An Absolute URL, in a failure condition where the URL cannot be parsed, the relative URL will be returned. */ public static function make_absolute_url($maybe_relative_path, $url) { } /** * Handles an HTTP redirect and follows it if appropriate. * * @since 3.7.0 * * @param string $url The URL which was requested. * @param array $args The arguments which were used to make the request. * @param array $response The response of the HTTP request. * @return array|false|WP_Error An HTTP API response array if the redirect is successfully followed, * false if no redirect is present, or a WP_Error object if there's an error. */ public static function handle_redirects($url, $args, $response) { } /** * Determines if a specified string represents an IP address or not. * * This function also detects the type of the IP address, returning either * '4' or '6' to represent an IPv4 and IPv6 address respectively. * This does not verify if the IP is a valid IP, only that it appears to be * an IP address. * * @link http://home.deds.nl/~aeron/regex/ for IPv6 regex. * * @since 3.7.0 * * @param string $maybe_ip A suspected IP address. * @return int|false Upon success, '4' or '6' to represent an IPv4 or IPv6 address, false upon failure. */ public static function is_ip_address($maybe_ip) { } } /** * Base image editor class from which implementations extend * * @since 3.5.0 */ #[\AllowDynamicProperties] abstract class WP_Image_Editor { protected $file = \null; protected $size = \null; protected $mime_type = \null; protected $output_mime_type = \null; protected $default_mime_type = 'image/jpeg'; protected $quality = \false; protected $default_quality = 82; /** * Each instance handles a single file. * * @param string $file Path to the file to load. */ public function __construct($file) { } /** * Checks to see if current environment supports the editor chosen. * Must be overridden in a subclass. * * @since 3.5.0 * * @abstract * * @param array $args * @return bool */ public static function test($args = array()) { } /** * Checks to see if editor supports the mime-type specified. * Must be overridden in a subclass. * * @since 3.5.0 * * @abstract * * @param string $mime_type * @return bool */ public static function supports_mime_type($mime_type) { } /** * Loads image from $this->file into editor. * * @since 3.5.0 * @abstract * * @return true|WP_Error True if loaded; WP_Error on failure. */ public abstract function load(); /** * Saves current image to file. * * @since 3.5.0 * @since 6.0.0 The `$filesize` value was added to the returned array. * @abstract * * @param string $destfilename Optional. Destination filename. Default null. * @param string $mime_type Optional. The mime-type. Default null. * @return array|WP_Error { * Array on success or WP_Error if the file failed to save. * * @type string $path Path to the image file. * @type string $file Name of the image file. * @type int $width Image width. * @type int $height Image height. * @type string $mime-type The mime type of the image. * @type int $filesize File size of the image. * } * @phpstan-return \WP_Error|array{ * path: string, * file: string, * width: int, * height: int, * mime-type: string, * filesize: int, * } */ public abstract function save($destfilename = \null, $mime_type = \null); /** * Resizes current image. * * At minimum, either a height or width must be provided. * If one of the two is set to null, the resize will * maintain aspect ratio according to the provided dimension. * * @since 3.5.0 * @abstract * * @param int|null $max_w Image width. * @param int|null $max_h Image height. * @param bool|array $crop { * Optional. Image cropping behavior. If false, the image will be scaled (default). * If true, image will be cropped to the specified dimensions using center positions. * If an array, the image will be cropped using the array to specify the crop location: * * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. * } * @return true|WP_Error * @phpstan-param bool|array{ * 0: string, * 1: string, * } $crop */ public abstract function resize($max_w, $max_h, $crop = \false); /** * Resize multiple images from a single source. * * @since 3.5.0 * @abstract * * @param array $sizes { * An array of image size arrays. Default sizes are 'small', 'medium', 'large'. * * @type array ...$0 { * @type int $width Image width. * @type int $height Image height. * @type bool|array $crop Optional. Whether to crop the image. Default false. * } * } * @return array An array of resized images metadata by size. * @phpstan-param array<int|string, array{ * width: int, * height: int, * crop?: bool|array, * }> $sizes */ public abstract function multi_resize($sizes); /** * Crops Image. * * @since 3.5.0 * @abstract * * @param int $src_x The start x position to crop from. * @param int $src_y The start y position to crop from. * @param int $src_w The width to crop. * @param int $src_h The height to crop. * @param int $dst_w Optional. The destination width. * @param int $dst_h Optional. The destination height. * @param bool $src_abs Optional. If the source crop points are absolute. * @return true|WP_Error */ public abstract function crop($src_x, $src_y, $src_w, $src_h, $dst_w = \null, $dst_h = \null, $src_abs = \false); /** * Rotates current image counter-clockwise by $angle. * * @since 3.5.0 * @abstract * * @param float $angle * @return true|WP_Error */ public abstract function rotate($angle); /** * Flips current image. * * @since 3.5.0 * @abstract * * @param bool $horz Flip along Horizontal Axis * @param bool $vert Flip along Vertical Axis * @return true|WP_Error */ public abstract function flip($horz, $vert); /** * Streams current image to browser. * * @since 3.5.0 * @abstract * * @param string $mime_type The mime type of the image. * @return true|WP_Error True on success, WP_Error object on failure. */ public abstract function stream($mime_type = \null); /** * Gets dimensions of image. * * @since 3.5.0 * * @return int[] { * Dimensions of the image. * * @type int $width The image width. * @type int $height The image height. * } * @phpstan-return array{ * width: int, * height: int, * } */ public function get_size() { } /** * Sets current image size. * * @since 3.5.0 * * @param int $width * @param int $height * @return true */ protected function update_size($width = \null, $height = \null) { } /** * Gets the Image Compression quality on a 1-100% scale. * * @since 4.0.0 * * @return int Compression Quality. Range: [1,100] */ public function get_quality() { } /** * Sets Image Compression quality on a 1-100% scale. * * @since 3.5.0 * * @param int $quality Compression Quality. Range: [1,100] * @return true|WP_Error True if set successfully; WP_Error on failure. */ public function set_quality($quality = \null) { } /** * Returns the default compression quality setting for the mime type. * * @since 5.8.1 * * @param string $mime_type * @return int The default quality setting for the mime type. */ protected function get_default_quality($mime_type) { } /** * Returns preferred mime-type and extension based on provided * file's extension and mime, or current file's extension and mime. * * Will default to $this->default_mime_type if requested is not supported. * * Provides corrected filename only if filename is provided. * * @since 3.5.0 * * @param string $filename * @param string $mime_type * @return array { filename|null, extension, mime-type } */ protected function get_output_format($filename = \null, $mime_type = \null) { } /** * Builds an output filename based on current file, and adding proper suffix * * @since 3.5.0 * * @param string $suffix * @param string $dest_path * @param string $extension * @return string filename */ public function generate_filename($suffix = \null, $dest_path = \null, $extension = \null) { } /** * Builds and returns proper suffix for file based on height and width. * * @since 3.5.0 * * @return string|false suffix */ public function get_suffix() { } /** * Check if a JPEG image has EXIF Orientation tag and rotate it if needed. * * @since 5.3.0 * * @return bool|WP_Error True if the image was rotated. False if not rotated (no EXIF data or the image doesn't need to be rotated). * WP_Error if error while rotating. */ public function maybe_exif_rotate() { } /** * Either calls editor's save function or handles file as a stream. * * @since 3.5.0 * * @param string $filename * @param callable $callback * @param array $arguments * @return bool */ protected function make_image($filename, $callback, $arguments) { } /** * Returns first matched mime-type from extension, * as mapped from wp_get_mime_types() * * @since 3.5.0 * * @param string $extension * @return string|false */ protected static function get_mime_type($extension = \null) { } /** * Returns first matched extension from Mime-type, * as mapped from wp_get_mime_types() * * @since 3.5.0 * * @param string $mime_type * @return string|false */ protected static function get_extension($mime_type = \null) { } } /** * WordPress Image Editor Class for Image Manipulation through GD * * @since 3.5.0 * * @see WP_Image_Editor */ class WP_Image_Editor_GD extends \WP_Image_Editor { /** * GD Resource. * * @var resource|GdImage */ protected $image; public function __destruct() { } /** * Checks to see if current environment supports GD. * * @since 3.5.0 * * @param array $args * @return bool */ public static function test($args = array()) { } /** * Checks to see if editor supports the mime-type specified. * * @since 3.5.0 * * @param string $mime_type * @return bool */ public static function supports_mime_type($mime_type) { } /** * Loads image from $this->file into new GD Resource. * * @since 3.5.0 * * @return true|WP_Error True if loaded successfully; WP_Error on failure. */ public function load() { } /** * Sets or updates current image size. * * @since 3.5.0 * * @param int $width * @param int $height * @return true */ protected function update_size($width = \false, $height = \false) { } /** * Resizes current image. * * Wraps `::_resize()` which returns a GD resource or GdImage instance. * * At minimum, either a height or width must be provided. If one of the two is set * to null, the resize will maintain aspect ratio according to the provided dimension. * * @since 3.5.0 * * @param int|null $max_w Image width. * @param int|null $max_h Image height. * @param bool|array $crop { * Optional. Image cropping behavior. If false, the image will be scaled (default). * If true, image will be cropped to the specified dimensions using center positions. * If an array, the image will be cropped using the array to specify the crop location: * * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. * } * @return true|WP_Error * @phpstan-param bool|array{ * 0: string, * 1: string, * } $crop */ public function resize($max_w, $max_h, $crop = \false) { } /** * @param int $max_w * @param int $max_h * @param bool|array $crop { * Optional. Image cropping behavior. If false, the image will be scaled (default). * If true, image will be cropped to the specified dimensions using center positions. * If an array, the image will be cropped using the array to specify the crop location: * * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. * } * @return resource|GdImage|WP_Error * @phpstan-param bool|array{ * 0: string, * 1: string, * } $crop */ protected function _resize($max_w, $max_h, $crop = \false) { } /** * Create multiple smaller images from a single source. * * Attempts to create all sub-sizes and returns the meta data at the end. This * may result in the server running out of resources. When it fails there may be few * "orphaned" images left over as the meta data is never returned and saved. * * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates * the new images one at a time and allows for the meta data to be saved after * each new image is created. * * @since 3.5.0 * * @param array $sizes { * An array of image size data arrays. * * Either a height or width must be provided. * If one of the two is set to null, the resize will * maintain aspect ratio according to the source image. * * @type array ...$0 { * Array of height, width values, and whether to crop. * * @type int $width Image width. Optional if `$height` is specified. * @type int $height Image height. Optional if `$width` is specified. * @type bool|array $crop Optional. Whether to crop the image. Default false. * } * } * @return array An array of resized images' metadata by size. * @phpstan-param array<int|string, array{ * width?: int, * height?: int, * crop?: bool|array, * }> $sizes */ public function multi_resize($sizes) { } /** * Create an image sub-size and return the image meta data value for it. * * @since 5.3.0 * * @param array $size_data { * Array of size data. * * @type int $width The maximum width in pixels. * @type int $height The maximum height in pixels. * @type bool|array $crop Whether to crop the image to exact dimensions. * } * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, * WP_Error object on error. * @phpstan-param array{ * width?: int, * height?: int, * crop?: bool|array, * } $size_data */ public function make_subsize($size_data) { } /** * Crops Image. * * @since 3.5.0 * * @param int $src_x The start x position to crop from. * @param int $src_y The start y position to crop from. * @param int $src_w The width to crop. * @param int $src_h The height to crop. * @param int $dst_w Optional. The destination width. * @param int $dst_h Optional. The destination height. * @param bool $src_abs Optional. If the source crop points are absolute. * @return true|WP_Error */ public function crop($src_x, $src_y, $src_w, $src_h, $dst_w = \null, $dst_h = \null, $src_abs = \false) { } /** * Rotates current image counter-clockwise by $angle. * Ported from image-edit.php * * @since 3.5.0 * * @param float $angle * @return true|WP_Error */ public function rotate($angle) { } /** * Flips current image. * * @since 3.5.0 * * @param bool $horz Flip along Horizontal Axis. * @param bool $vert Flip along Vertical Axis. * @return true|WP_Error */ public function flip($horz, $vert) { } /** * Saves current in-memory image to file. * * @since 3.5.0 * @since 5.9.0 Renamed `$filename` to `$destfilename` to match parent class * for PHP 8 named parameter support. * @since 6.0.0 The `$filesize` value was added to the returned array. * * @param string|null $destfilename Optional. Destination filename. Default null. * @param string|null $mime_type Optional. The mime-type. Default null. * @return array|WP_Error { * Array on success or WP_Error if the file failed to save. * * @type string $path Path to the image file. * @type string $file Name of the image file. * @type int $width Image width. * @type int $height Image height. * @type string $mime-type The mime type of the image. * @type int $filesize File size of the image. * } * @phpstan-return \WP_Error|array{ * path: string, * file: string, * width: int, * height: int, * mime-type: string, * filesize: int, * } */ public function save($destfilename = \null, $mime_type = \null) { } /** * @since 3.5.0 * @since 6.0.0 The `$filesize` value was added to the returned array. * * @param resource|GdImage $image * @param string|null $filename * @param string|null $mime_type * @return array|WP_Error { * Array on success or WP_Error if the file failed to save. * * @type string $path Path to the image file. * @type string $file Name of the image file. * @type int $width Image width. * @type int $height Image height. * @type string $mime-type The mime type of the image. * @type int $filesize File size of the image. * } * @phpstan-return \WP_Error|array{ * path: string, * file: string, * width: int, * height: int, * mime-type: string, * filesize: int, * } */ protected function _save($image, $filename = \null, $mime_type = \null) { } /** * Sets Image Compression quality on a 1-100% scale. Handles WebP lossless images. * * @since 6.7.0 * * @param int $quality Compression Quality. Range: [1,100] * @return true|WP_Error True if set successfully; WP_Error on failure. */ public function set_quality($quality = \null) { } /** * Returns stream of current image. * * @since 3.5.0 * * @param string $mime_type The mime type of the image. * @return bool True on success, false on failure. */ public function stream($mime_type = \null) { } /** * Either calls editor's save function or handles file as a stream. * * @since 3.5.0 * * @param string $filename * @param callable $callback * @param array $arguments * @return bool */ protected function make_image($filename, $callback, $arguments) { } } /** * WordPress Image Editor Class for Image Manipulation through Imagick PHP Module * * @since 3.5.0 * * @see WP_Image_Editor */ class WP_Image_Editor_Imagick extends \WP_Image_Editor { /** * Imagick object. * * @var Imagick */ protected $image; public function __destruct() { } /** * Checks to see if current environment supports Imagick. * * We require Imagick 2.2.0 or greater, based on whether the queryFormats() * method can be called statically. * * @since 3.5.0 * * @param array $args * @return bool */ public static function test($args = array()) { } /** * Checks to see if editor supports the mime-type specified. * * @since 3.5.0 * * @param string $mime_type * @return bool */ public static function supports_mime_type($mime_type) { } /** * Loads image from $this->file into new Imagick Object. * * @since 3.5.0 * * @return true|WP_Error True if loaded; WP_Error on failure. */ public function load() { } /** * Sets Image Compression quality on a 1-100% scale. * * @since 3.5.0 * * @param int $quality Compression Quality. Range: [1,100] * @return true|WP_Error True if set successfully; WP_Error on failure. */ public function set_quality($quality = \null) { } /** * Sets or updates current image size. * * @since 3.5.0 * * @param int $width * @param int $height * @return true|WP_Error */ protected function update_size($width = \null, $height = \null) { } /** * Sets Imagick time limit. * * Depending on configuration, Imagick processing may take time. * * Multiple problems exist if PHP times out before ImageMagick completed: * 1. Temporary files aren't cleaned by ImageMagick garbage collection. * 2. No clear error is provided. * 3. The cause of such timeout can be hard to pinpoint. * * This function, which is expected to be run before heavy image routines, resolves * point 1 above by aligning Imagick's timeout with PHP's timeout, assuming it is set. * * However seems it introduces more problems than it fixes, * see https://core.trac.wordpress.org/ticket/58202. * * Note: * - Imagick resource exhaustion does not issue catchable exceptions (yet). * See https://github.com/Imagick/imagick/issues/333. * - The resource limit is not saved/restored. It applies to subsequent * image operations within the time of the HTTP request. * * @since 6.2.0 * @since 6.3.0 This method was deprecated. * * @return int|null The new limit on success, null on failure. */ public static function set_imagick_time_limit() { } /** * Resizes current image. * * At minimum, either a height or width must be provided. * If one of the two is set to null, the resize will * maintain aspect ratio according to the provided dimension. * * @since 3.5.0 * * @param int|null $max_w Image width. * @param int|null $max_h Image height. * @param bool|array $crop { * Optional. Image cropping behavior. If false, the image will be scaled (default). * If true, image will be cropped to the specified dimensions using center positions. * If an array, the image will be cropped using the array to specify the crop location: * * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. * } * @return true|WP_Error * @phpstan-param bool|array{ * 0: string, * 1: string, * } $crop */ public function resize($max_w, $max_h, $crop = \false) { } /** * Efficiently resize the current image * * This is a WordPress specific implementation of Imagick::thumbnailImage(), * which resizes an image to given dimensions and removes any associated profiles. * * @since 4.5.0 * * @param int $dst_w The destination width. * @param int $dst_h The destination height. * @param string $filter_name Optional. The Imagick filter to use when resizing. Default 'FILTER_TRIANGLE'. * @param bool $strip_meta Optional. Strip all profiles, excluding color profiles, from the image. Default true. * @return void|WP_Error */ protected function thumbnail_image($dst_w, $dst_h, $filter_name = 'FILTER_TRIANGLE', $strip_meta = \true) { } /** * Create multiple smaller images from a single source. * * Attempts to create all sub-sizes and returns the meta data at the end. This * may result in the server running out of resources. When it fails there may be few * "orphaned" images left over as the meta data is never returned and saved. * * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates * the new images one at a time and allows for the meta data to be saved after * each new image is created. * * @since 3.5.0 * * @param array $sizes { * An array of image size data arrays. * * Either a height or width must be provided. * If one of the two is set to null, the resize will * maintain aspect ratio according to the provided dimension. * * @type array ...$0 { * Array of height, width values, and whether to crop. * * @type int $width Image width. Optional if `$height` is specified. * @type int $height Image height. Optional if `$width` is specified. * @type bool|array $crop Optional. Whether to crop the image. Default false. * } * } * @return array An array of resized images' metadata by size. * @phpstan-param array<int|string, array{ * width?: int, * height?: int, * crop?: bool|array, * }> $sizes */ public function multi_resize($sizes) { } /** * Create an image sub-size and return the image meta data value for it. * * @since 5.3.0 * * @param array $size_data { * Array of size data. * * @type int $width The maximum width in pixels. * @type int $height The maximum height in pixels. * @type bool|array $crop Whether to crop the image to exact dimensions. * } * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, * WP_Error object on error. * @phpstan-param array{ * width?: int, * height?: int, * crop?: bool|array, * } $size_data */ public function make_subsize($size_data) { } /** * Crops Image. * * @since 3.5.0 * * @param int $src_x The start x position to crop from. * @param int $src_y The start y position to crop from. * @param int $src_w The width to crop. * @param int $src_h The height to crop. * @param int $dst_w Optional. The destination width. * @param int $dst_h Optional. The destination height. * @param bool $src_abs Optional. If the source crop points are absolute. * @return true|WP_Error */ public function crop($src_x, $src_y, $src_w, $src_h, $dst_w = \null, $dst_h = \null, $src_abs = \false) { } /** * Rotates current image counter-clockwise by $angle. * * @since 3.5.0 * * @param float $angle * @return true|WP_Error */ public function rotate($angle) { } /** * Flips current image. * * @since 3.5.0 * * @param bool $horz Flip along Horizontal Axis * @param bool $vert Flip along Vertical Axis * @return true|WP_Error */ public function flip($horz, $vert) { } /** * Check if a JPEG image has EXIF Orientation tag and rotate it if needed. * * As ImageMagick copies the EXIF data to the flipped/rotated image, proceed only * if EXIF Orientation can be reset afterwards. * * @since 5.3.0 * * @return bool|WP_Error True if the image was rotated. False if no EXIF data or if the image doesn't need rotation. * WP_Error if error while rotating. */ public function maybe_exif_rotate() { } /** * Saves current image to file. * * @since 3.5.0 * @since 6.0.0 The `$filesize` value was added to the returned array. * * @param string $destfilename Optional. Destination filename. Default null. * @param string $mime_type Optional. The mime-type. Default null. * @return array|WP_Error { * Array on success or WP_Error if the file failed to save. * * @type string $path Path to the image file. * @type string $file Name of the image file. * @type int $width Image width. * @type int $height Image height. * @type string $mime-type The mime type of the image. * @type int $filesize File size of the image. * } * @phpstan-return \WP_Error|array{ * path: string, * file: string, * width: int, * height: int, * mime-type: string, * filesize: int, * } */ public function save($destfilename = \null, $mime_type = \null) { } /** * Removes PDF alpha after it's been read. * * @since 6.4.0 */ protected function remove_pdf_alpha_channel() { } /** * @since 3.5.0 * @since 6.0.0 The `$filesize` value was added to the returned array. * * @param Imagick $image * @param string $filename * @param string $mime_type * @return array|WP_Error { * Array on success or WP_Error if the file failed to save. * * @type string $path Path to the image file. * @type string $file Name of the image file. * @type int $width Image width. * @type int $height Image height. * @type string $mime-type The mime type of the image. * @type int $filesize File size of the image. * } * @phpstan-return \WP_Error|array{ * path: string, * file: string, * width: int, * height: int, * mime-type: string, * filesize: int, * } */ protected function _save($image, $filename = \null, $mime_type = \null) { } /** * Streams current image to browser. * * @since 3.5.0 * * @param string $mime_type The mime type of the image. * @return true|WP_Error True on success, WP_Error object on failure. */ public function stream($mime_type = \null) { } /** * Strips all image meta except color profiles from an image. * * @since 4.5.0 * * @return true|WP_Error True if stripping metadata was successful. WP_Error object on error. */ protected function strip_meta() { } /** * Sets up Imagick for PDF processing. * Increases rendering DPI and only loads first page. * * @since 4.7.0 * * @return string|WP_Error File to load or WP_Error on failure. */ protected function pdf_setup() { } /** * Load the image produced by Ghostscript. * * Includes a workaround for a bug in Ghostscript 8.70 that prevents processing of some PDF files * when `use-cropbox` is set. * * @since 5.6.0 * * @return true|WP_Error */ protected function pdf_load_source() { } } /** * List utility. * * Utility class to handle operations on an array of objects or arrays. * * @since 4.7.0 */ #[\AllowDynamicProperties] class WP_List_Util { /** * Constructor. * * Sets the input array. * * @since 4.7.0 * * @param array $input Array to perform operations on. */ public function __construct($input) { } /** * Returns the original input array. * * @since 4.7.0 * * @return array The input array. */ public function get_input() { } /** * Returns the output array. * * @since 4.7.0 * * @return array The output array. */ public function get_output() { } /** * Filters the list, based on a set of key => value arguments. * * Retrieves the objects from the list that match the given arguments. * Key represents property name, and value represents property value. * * If an object has more properties than those specified in arguments, * that will not disqualify it. When using the 'AND' operator, * any missing properties will disqualify it. * * @since 4.7.0 * * @param array $args Optional. An array of key => value arguments to match * against each object. Default empty array. * @param string $operator Optional. The logical operation to perform. 'AND' means * all elements from the array must match. 'OR' means only * one element needs to match. 'NOT' means no elements may * match. Default 'AND'. * @return array Array of found values. */ public function filter($args = array(), $operator = 'AND') { } /** * Plucks a certain field out of each element in the input array. * * This has the same functionality and prototype of * array_column() (PHP 5.5) but also supports objects. * * @since 4.7.0 * * @param int|string $field Field to fetch from the object or array. * @param int|string $index_key Optional. Field from the element to use as keys for the new array. * Default null. * @return array Array of found values. If `$index_key` is set, an array of found values with keys * corresponding to `$index_key`. If `$index_key` is null, array keys from the original * `$list` will be preserved in the results. */ public function pluck($field, $index_key = \null) { } /** * Sorts the input array based on one or more orderby arguments. * * @since 4.7.0 * * @param string|array $orderby Optional. Either the field name to order by or an array * of multiple orderby fields as `$orderby => $order`. * Default empty array. * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby` * is a string. Default 'ASC'. * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. * @return array The sorted array. * @phpstan-param 'ASC'|'DESC' $order */ public function sort($orderby = array(), $order = 'ASC', $preserve_keys = \false) { } } /** * Core class used for switching locales. * * @since 4.7.0 */ #[\AllowDynamicProperties] class WP_Locale_Switcher { /** * Constructor. * * Stores the original locale as well as a list of all available languages. * * @since 4.7.0 */ public function __construct() { } /** * Initializes the locale switcher. * * Hooks into the {@see 'locale'} and {@see 'determine_locale'} filters * to change the locale on the fly. * * @since 4.7.0 */ public function init() { } /** * Switches the translations according to the given locale. * * @since 4.7.0 * * @param string $locale The locale to switch to. * @param int|false $user_id Optional. User ID as context. Default false. * @return bool True on success, false on failure. */ public function switch_to_locale($locale, $user_id = \false) { } /** * Switches the translations according to the given user's locale. * * @since 6.2.0 * * @param int $user_id User ID. * @return bool True on success, false on failure. */ public function switch_to_user_locale($user_id) { } /** * Restores the translations according to the previous locale. * * @since 4.7.0 * * @return string|false Locale on success, false on failure. */ public function restore_previous_locale() { } /** * Restores the translations according to the original locale. * * @since 4.7.0 * * @return string|false Locale on success, false on failure. */ public function restore_current_locale() { } /** * Whether switch_to_locale() is in effect. * * @since 4.7.0 * * @return bool True if the locale has been switched, false otherwise. */ public function is_switched() { } /** * Returns the locale currently switched to. * * @since 6.2.0 * * @return string|false Locale if the locale has been switched, false otherwise. */ public function get_switched_locale() { } /** * Returns the user ID related to the currently switched locale. * * @since 6.2.0 * * @return int|false User ID if set and if the locale has been switched, false otherwise. */ public function get_switched_user_id() { } /** * Filters the locale of the WordPress installation. * * @since 4.7.0 * * @param string $locale The locale of the WordPress installation. * @return string The locale currently being switched to. */ public function filter_locale($locale) { } } /** * Core class used to store translated data for a locale. * * @since 2.1.0 * @since 4.6.0 Moved to its own file from wp-includes/locale.php. */ #[\AllowDynamicProperties] class WP_Locale { /** * Stores the translated strings for the full weekday names. * * @since 2.1.0 * @since 6.2.0 Initialized to an empty array. * @var string[] */ public $weekday = array(); /** * Stores the translated strings for the one character weekday names. * * There is a hack to make sure that Tuesday and Thursday, as well * as Sunday and Saturday, don't conflict. See init() method for more. * * @see WP_Locale::init() for how to handle the hack. * * @since 2.1.0 * @since 6.2.0 Initialized to an empty array. * @var string[] */ public $weekday_initial = array(); /** * Stores the translated strings for the abbreviated weekday names. * * @since 2.1.0 * @since 6.2.0 Initialized to an empty array. * @var string[] */ public $weekday_abbrev = array(); /** * Stores the translated strings for the full month names. * * @since 2.1.0 * @since 6.2.0 Initialized to an empty array. * @var string[] */ public $month = array(); /** * Stores the translated strings for the month names in genitive case, if the locale specifies. * * @since 4.4.0 * @since 6.2.0 Initialized to an empty array. * @var string[] */ public $month_genitive = array(); /** * Stores the translated strings for the abbreviated month names. * * @since 2.1.0 * @since 6.2.0 Initialized to an empty array. * @var string[] */ public $month_abbrev = array(); /** * Stores the translated strings for 'am' and 'pm'. * * Also the capitalized versions. * * @since 2.1.0 * @since 6.2.0 Initialized to an empty array. * @var string[] */ public $meridiem = array(); /** * The text direction of the locale language. * * Default is left to right 'ltr'. * * @since 2.1.0 * @var string */ public $text_direction = 'ltr'; /** * The thousands separator and decimal point values used for localizing numbers. * * @since 2.3.0 * @since 6.2.0 Initialized to an empty array. * @var array */ public $number_format = array(); /** * The separator string used for localizing list item separator. * * @since 6.0.0 * @var string */ public $list_item_separator; /** * The word count type of the locale language. * * Default is 'words'. * * @since 6.2.0 * @var string */ public $word_count_type; /** * Constructor which calls helper methods to set up object variables. * * @since 2.1.0 */ public function __construct() { } /** * Sets up the translated strings and object properties. * * The method creates the translatable strings for various * calendar elements. Which allows for specifying locale * specific calendar names and text direction. * * @since 2.1.0 * * @global string $text_direction */ public function init() { } /** * Retrieves the full translated weekday word. * * Week starts on translated Sunday and can be fetched * by using 0 (zero). So the week starts with 0 (zero) * and ends on Saturday with is fetched by using 6 (six). * * @since 2.1.0 * * @param int $weekday_number 0 for Sunday through 6 Saturday. * @return string Full translated weekday. */ public function get_weekday($weekday_number) { } /** * Retrieves the translated weekday initial. * * The weekday initial is retrieved by the translated * full weekday word. When translating the weekday initial * pay attention to make sure that the starting letter does * not conflict. * * @since 2.1.0 * * @param string $weekday_name Full translated weekday word. * @return string Translated weekday initial. */ public function get_weekday_initial($weekday_name) { } /** * Retrieves the translated weekday abbreviation. * * The weekday abbreviation is retrieved by the translated * full weekday word. * * @since 2.1.0 * * @param string $weekday_name Full translated weekday word. * @return string Translated weekday abbreviation. */ public function get_weekday_abbrev($weekday_name) { } /** * Retrieves the full translated month by month number. * * The $month_number parameter has to be a string * because it must have the '0' in front of any number * that is less than 10. Starts from '01' and ends at * '12'. * * You can use an integer instead and it will add the * '0' before the numbers less than 10 for you. * * @since 2.1.0 * * @param string|int $month_number '01' through '12'. * @return string Translated full month name. */ public function get_month($month_number) { } /** * Retrieves translated version of month abbreviation string. * * The $month_name parameter is expected to be the translated or * translatable version of the month. * * @since 2.1.0 * * @param string $month_name Translated month to get abbreviated version. * @return string Translated abbreviated month. */ public function get_month_abbrev($month_name) { } /** * Retrieves translated version of meridiem string. * * The $meridiem parameter is expected to not be translated. * * @since 2.1.0 * * @param string $meridiem Either 'am', 'pm', 'AM', or 'PM'. Not translated version. * @return string Translated version * @phpstan-param 'am'|'pm'|'AM'|'PM' $meridiem */ public function get_meridiem($meridiem) { } /** * Global variables are deprecated. * * For backward compatibility only. * * @since 2.1.0 * @deprecated For backward compatibility only. * * @global array $weekday * @global array $weekday_initial * @global array $weekday_abbrev * @global array $month * @global array $month_abbrev */ public function register_globals() { } /** * Checks if current locale is RTL. * * @since 3.0.0 * @return bool Whether locale is RTL. */ public function is_rtl() { } /** * Registers date/time format strings for general POT. * * Private, unused method to add some date/time formats translated * on wp-admin/options-general.php to the general POT that would * otherwise be added to the admin POT. * * @since 3.6.0 */ public function _strings_for_pot() { } /** * Retrieves the localized list item separator. * * @since 6.0.0 * * @return string Localized list item separator. */ public function get_list_item_separator() { } /** * Retrieves the localized word count type. * * @since 6.2.0 * * @return string Localized word count type. Possible values are `characters_excluding_spaces`, * `characters_including_spaces`, or `words`. Defaults to `words`. */ public function get_word_count_type() { } } /** * Helper class to remove the need to use eval to replace $matches[] in query strings. * * @since 2.9.0 */ #[\AllowDynamicProperties] class WP_MatchesMapRegex { /** * store for mapping result * * @var string */ public $output; /** * regexp pattern to match $matches[] references * * @var string */ public $_pattern = '(\\$matches\\[[1-9]+[0-9]*\\])'; /** * constructor * * @param string $subject subject if regex * @param array $matches data to use in map */ public function __construct($subject, $matches) { } /** * Substitute substring matches in subject. * * static helper function to ease use * * @param string $subject subject * @param array $matches data used for substitution * @return string */ public static function apply($subject, $matches) { } /** * preg_replace_callback hook * * @param array $matches preg_replace regexp matches * @return string */ public function callback($matches) { } } /** * Core class used to implement meta queries for the Meta API. * * Used for generating SQL clauses that filter a primary query according to metadata keys and values. * * WP_Meta_Query is a helper that allows primary query classes, such as WP_Query and WP_User_Query, * * to filter their results by object metadata, by generating `JOIN` and `WHERE` subclauses to be attached * to the primary SQL query string. * * @since 3.2.0 */ #[\AllowDynamicProperties] class WP_Meta_Query { /** * Array of metadata queries. * * See WP_Meta_Query::__construct() for information on meta query arguments. * * @since 3.2.0 * @var array */ public $queries = array(); /** * The relation between the queries. Can be one of 'AND' or 'OR'. * * @since 3.2.0 * @var string */ public $relation; /** * Database table to query for the metadata. * * @since 4.1.0 * @var string */ public $meta_table; /** * Column in meta_table that represents the ID of the object the metadata belongs to. * * @since 4.1.0 * @var string */ public $meta_id_column; /** * Database table that where the metadata's objects are stored (eg $wpdb->users). * * @since 4.1.0 * @var string */ public $primary_table; /** * Column in primary_table that represents the ID of the object. * * @since 4.1.0 * @var string */ public $primary_id_column; /** * A flat list of table aliases used in JOIN clauses. * * @since 4.1.0 * @var array */ protected $table_aliases = array(); /** * A flat list of clauses, keyed by clause 'name'. * * @since 4.2.0 * @var array */ protected $clauses = array(); /** * Whether the query contains any OR relations. * * @since 4.3.0 * @var bool */ protected $has_or_relation = \false; /** * Constructor. * * @since 3.2.0 * @since 4.2.0 Introduced support for naming query clauses by associative array keys. * @since 5.1.0 Introduced `$compare_key` clause parameter, which enables LIKE key matches. * @since 5.3.0 Increased the number of operators available to `$compare_key`. Introduced `$type_key`, * which enables the `$key` to be cast to a new data type for comparisons. * * @param array $meta_query { * Array of meta query clauses. When first-order clauses or sub-clauses use strings as * their array keys, they may be referenced in the 'orderby' parameter of the parent query. * * @type string $relation Optional. The MySQL keyword used to join the clauses of the query. * Accepts 'AND' or 'OR'. Default 'AND'. * @type array ...$0 { * Optional. An array of first-order clause parameters, or another fully-formed meta query. * * @type string|string[] $key Meta key or keys to filter by. * @type string $compare_key MySQL operator used for comparing the $key. Accepts: * - '=' * - '!=' * - 'LIKE' * - 'NOT LIKE' * - 'IN' * - 'NOT IN' * - 'REGEXP' * - 'NOT REGEXP' * - 'RLIKE' * - 'EXISTS' (alias of '=') * - 'NOT EXISTS' (alias of '!=') * Default is 'IN' when `$key` is an array, '=' otherwise. * @type string $type_key MySQL data type that the meta_key column will be CAST to for * comparisons. Accepts 'BINARY' for case-sensitive regular expression * comparisons. Default is ''. * @type string|string[] $value Meta value or values to filter by. * @type string $compare MySQL operator used for comparing the $value. Accepts: * - '=' * - '!=' * - '>' * - '>=' * - '<' * - '<=' * - 'LIKE' * - 'NOT LIKE' * - 'IN' * - 'NOT IN' * - 'BETWEEN' * - 'NOT BETWEEN' * - 'REGEXP' * - 'NOT REGEXP' * - 'RLIKE' * - 'EXISTS' * - 'NOT EXISTS' * Default is 'IN' when `$value` is an array, '=' otherwise. * @type string $type MySQL data type that the meta_value column will be CAST to for * comparisons. Accepts: * - 'NUMERIC' * - 'BINARY' * - 'CHAR' * - 'DATE' * - 'DATETIME' * - 'DECIMAL' * - 'SIGNED' * - 'TIME' * - 'UNSIGNED' * Default is 'CHAR'. * } * } * @phpstan-return void */ public function __construct($meta_query = \false) { } /** * Ensures the 'meta_query' argument passed to the class constructor is well-formed. * * Eliminates empty items and ensures that a 'relation' is set. * * @since 4.1.0 * * @param array $queries Array of query clauses. * @return array Sanitized array of query clauses. */ public function sanitize_query($queries) { } /** * Determines whether a query clause is first-order. * * A first-order meta query clause is one that has either a 'key' or * a 'value' array key. * * @since 4.1.0 * * @param array $query Meta query arguments. * @return bool Whether the query clause is a first-order clause. */ protected function is_first_order_clause($query) { } /** * Constructs a meta query based on 'meta_*' query vars * * @since 3.2.0 * * @param array $qv The query variables. */ public function parse_query_vars($qv) { } /** * Returns the appropriate alias for the given meta type if applicable. * * @since 3.7.0 * * @param string $type MySQL type to cast meta_value. * @return string MySQL type. */ public function get_cast_for_type($type = '') { } /** * Generates SQL clauses to be appended to a main query. * * @since 3.2.0 * * @param string $type Type of meta. Possible values include but are not limited * to 'post', 'comment', 'blog', 'term', and 'user'. * @param string $primary_table Database table where the object being filtered is stored (eg wp_users). * @param string $primary_id_column ID column for the filtered object in $primary_table. * @param object $context Optional. The main query object that corresponds to the type, for * example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`. * Default null. * @return string[]|false { * Array containing JOIN and WHERE SQL clauses to append to the main query, * or false if no table exists for the requested meta type. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return false|array{ * join: string, * where: string, * } */ public function get_sql($type, $primary_table, $primary_id_column, $context = \null) { } /** * Generates SQL clauses to be appended to a main query. * * Called by the public WP_Meta_Query::get_sql(), this method is abstracted * out to maintain parity with the other Query classes. * * @since 4.1.0 * * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return array{ * join: string, * where: string, * } */ protected function get_sql_clauses() { } /** * Generates SQL clauses for a single query array. * * If nested subqueries are found, this method recurses the tree to * produce the properly nested SQL. * * @since 4.1.0 * * @param array $query Query to parse (passed by reference). * @param int $depth Optional. Number of tree levels deep we currently are. * Used to calculate indentation. Default 0. * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to a single query array. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return array{ * join: string, * where: string, * } */ protected function get_sql_for_query(&$query, $depth = 0) { } /** * Generates SQL JOIN and WHERE clauses for a first-order query clause. * * "First-order" means that it's an array with a 'key' or 'value'. * * @since 4.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $clause Query clause (passed by reference). * @param array $parent_query Parent query array. * @param string $clause_key Optional. The array key used to name the clause in the original `$meta_query` * parameters. If not provided, a key will be generated automatically. * Default empty string. * @return array { * Array containing JOIN and WHERE SQL clauses to append to a first-order query. * * @type string[] $join Array of SQL fragments to append to the main JOIN clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause. * } * @phpstan-return array{ * join: string[], * where: string[], * } */ public function get_sql_for_clause(&$clause, $parent_query, $clause_key = '') { } /** * Gets a flattened list of sanitized meta clauses. * * This array should be used for clause lookup, as when the table alias and CAST type must be determined for * a value of 'orderby' corresponding to a meta clause. * * @since 4.2.0 * * @return array Meta clauses. */ public function get_clauses() { } /** * Identifies an existing table alias that is compatible with the current * query clause. * * We avoid unnecessary table joins by allowing each clause to look for * an existing table alias that is compatible with the query that it * needs to perform. * * An existing alias is compatible if (a) it is a sibling of `$clause` * (ie, it's under the scope of the same relation), and (b) the combination * of operator and relation between the clauses allows for a shared table join. * In the case of WP_Meta_Query, this only applies to 'IN' clauses that are * connected by the relation 'OR'. * * @since 4.1.0 * * @param array $clause Query clause. * @param array $parent_query Parent query of $clause. * @return string|false Table alias if found, otherwise false. */ protected function find_compatible_table_alias($clause, $parent_query) { } /** * Checks whether the current query has any OR relations. * * In some cases, the presence of an OR relation somewhere in the query will require * the use of a `DISTINCT` or `GROUP BY` keyword in the `SELECT` clause. The current * method can be used in these cases to determine whether such a clause is necessary. * * @since 4.3.0 * * @return bool True if the query contains any `OR` relations, otherwise false. */ public function has_or_relation() { } } /** * Core class used for lazy-loading object metadata. * * When loading many objects of a given type, such as posts in a WP_Query loop, it often makes * sense to prime various metadata caches at the beginning of the loop. This means fetching all * relevant metadata with a single database query, a technique that has the potential to improve * performance dramatically in some cases. * * In cases where the given metadata may not even be used in the loop, we can improve performance * even more by only priming the metadata cache for affected items the first time a piece of metadata * is requested - ie, by lazy-loading it. So, for example, comment meta may not be loaded into the * cache in the comments section of a post until the first time get_comment_meta() is called in the * context of the comment loop. * * WP uses the WP_Metadata_Lazyloader class to queue objects for metadata cache priming. The class * then detects the relevant get_*_meta() function call, and queries the metadata of all queued objects. * * Do not access this class directly. Use the wp_metadata_lazyloader() function. * * @since 4.5.0 */ #[\AllowDynamicProperties] class WP_Metadata_Lazyloader { /** * Pending objects queue. * * @since 4.5.0 * @var array */ protected $pending_objects; /** * Settings for supported object types. * * @since 4.5.0 * @var array */ protected $settings = array(); /** * Constructor. * * @since 4.5.0 */ public function __construct() { } /** * Adds objects to the metadata lazy-load queue. * * @since 4.5.0 * * @param string $object_type Type of object whose meta is to be lazy-loaded. Accepts 'term' or 'comment'. * @param array $object_ids Array of object IDs. * @return void|WP_Error WP_Error on failure. * @phpstan-param 'term'|'comment' $object_type */ public function queue_objects($object_type, $object_ids) { } /** * Resets lazy-load queue for a given object type. * * @since 4.5.0 * * @param string $object_type Object type. Accepts 'comment' or 'term'. * @return void|WP_Error WP_Error on failure. * @phpstan-param 'comment'|'term' $object_type */ public function reset_queue($object_type) { } /** * Lazy-loads term meta for queued terms. * * This method is public so that it can be used as a filter callback. As a rule, there * is no need to invoke it directly. * * @since 4.5.0 * @deprecated 6.3.0 Use WP_Metadata_Lazyloader::lazyload_meta_callback() instead. * * @param mixed $check The `$check` param passed from the 'get_term_metadata' hook. * @return mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be * another value if filtered by a plugin. */ public function lazyload_term_meta($check) { } /** * Lazy-loads comment meta for queued comments. * * This method is public so that it can be used as a filter callback. As a rule, there is no need to invoke it * directly, from either inside or outside the `WP_Query` object. * * @since 4.5.0 * @deprecated 6.3.0 Use WP_Metadata_Lazyloader::lazyload_meta_callback() instead. * * @param mixed $check The `$check` param passed from the {@see 'get_comment_metadata'} hook. * @return mixed The original value of `$check`, so as not to short-circuit `get_comment_metadata()`. */ public function lazyload_comment_meta($check) { } /** * Lazy-loads meta for queued objects. * * This method is public so that it can be used as a filter callback. As a rule, there * is no need to invoke it directly. * * @since 6.3.0 * * @param mixed $check The `$check` param passed from the 'get_*_metadata' hook. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Unused. * @param bool $single Unused. * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * or any other object type with an associated meta table. * @return mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be * another value if filtered by a plugin. */ public function lazyload_meta_callback($check, $object_id, $meta_key, $single, $meta_type) { } } /** * Manages fallback behavior for Navigation menus. * * @access public * @since 6.3.0 */ class WP_Navigation_Fallback { /** * Updates the wp_navigation custom post type schema, in order to expose * additional fields in the embeddable links of WP_REST_Navigation_Fallback_Controller. * * The Navigation Fallback endpoint may embed the full Navigation Menu object * into the response as the `self` link. By default, the Posts Controller * will only expose a limited subset of fields but the editor requires * additional fields to be available in order to utilize the menu. * * Used with the `rest_wp_navigation_item_schema` hook. * * @since 6.4.0 * * @param array $schema The schema for the `wp_navigation` post. * @return array The modified schema. */ public static function update_wp_navigation_post_schema($schema) { } /** * Gets (and/or creates) an appropriate fallback Navigation Menu. * * @since 6.3.0 * * @return WP_Post|null the fallback Navigation Post or null. */ public static function get_fallback() { } } /** * Core class used for querying networks. * * @since 4.6.0 * * @see WP_Network_Query::__construct() for accepted arguments. */ #[\AllowDynamicProperties] class WP_Network_Query { /** * SQL for database query. * * @since 4.6.0 * @var string */ public $request; /** * SQL query clauses. * * @since 4.6.0 * @var array */ protected $sql_clauses = array('select' => '', 'from' => '', 'where' => array(), 'groupby' => '', 'orderby' => '', 'limits' => ''); /** * Query vars set by the user. * * @since 4.6.0 * @var array */ public $query_vars; /** * Default values for query vars. * * @since 4.6.0 * @var array */ public $query_var_defaults; /** * List of networks located by the query. * * @since 4.6.0 * @var array */ public $networks; /** * The amount of found networks for the current query. * * @since 4.6.0 * @var int */ public $found_networks = 0; /** * The number of pages. * * @since 4.6.0 * @var int */ public $max_num_pages = 0; /** * Constructor. * * Sets up the network query, based on the query vars passed. * * @since 4.6.0 * * @param string|array $query { * Optional. Array or query string of network query parameters. Default empty. * * @type int[] $network__in Array of network IDs to include. Default empty. * @type int[] $network__not_in Array of network IDs to exclude. Default empty. * @type bool $count Whether to return a network count (true) or array of network objects. * Default false. * @type string $fields Network fields to return. Accepts 'ids' (returns an array of network IDs) * or empty (returns an array of complete network objects). Default empty. * @type int $number Maximum number of networks to retrieve. Default empty (no limit). * @type int $offset Number of networks to offset the query. Used to build LIMIT clause. * Default 0. * @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true. * @type string|array $orderby Network status or array of statuses. Accepts 'id', 'domain', 'path', * 'domain_length', 'path_length' and 'network__in'. Also accepts false, * an empty array, or 'none' to disable `ORDER BY` clause. Default 'id'. * @type string $order How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'. * @type string $domain Limit results to those affiliated with a given domain. Default empty. * @type string[] $domain__in Array of domains to include affiliated networks for. Default empty. * @type string[] $domain__not_in Array of domains to exclude affiliated networks for. Default empty. * @type string $path Limit results to those affiliated with a given path. Default empty. * @type string[] $path__in Array of paths to include affiliated networks for. Default empty. * @type string[] $path__not_in Array of paths to exclude affiliated networks for. Default empty. * @type string $search Search term(s) to retrieve matching networks for. Default empty. * @type bool $update_network_cache Whether to prime the cache for found networks. Default true. * } * @phpstan-param array{ * network__in?: int[], * network__not_in?: int[], * count?: bool, * fields?: string, * number?: int, * offset?: int, * no_found_rows?: bool, * orderby?: string|array, * order?: string, * domain?: string, * domain__in?: string[], * domain__not_in?: string[], * path?: string, * path__in?: string[], * path__not_in?: string[], * search?: string, * update_network_cache?: bool, * } $query */ public function __construct($query = '') { } /** * Parses arguments passed to the network query with default query parameters. * * @since 4.6.0 * * @param string|array $query WP_Network_Query arguments. See WP_Network_Query::__construct() for accepted arguments. * @phpstan-param array{ * network__in?: int[], * network__not_in?: int[], * count?: bool, * fields?: string, * number?: int, * offset?: int, * no_found_rows?: bool, * orderby?: string|array, * order?: string, * domain?: string, * domain__in?: string[], * domain__not_in?: string[], * path?: string, * path__in?: string[], * path__not_in?: string[], * search?: string, * update_network_cache?: bool, * } $query See WP_Network_Query::__construct() */ public function parse_query($query = '') { } /** * Sets up the WordPress query for retrieving networks. * * @since 4.6.0 * * @param string|array $query Array or URL query string of parameters. * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids', * or the number of networks when 'count' is passed as a query var. */ public function query($query) { } /** * Gets a list of networks matching the query vars. * * @since 4.6.0 * * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids', * or the number of networks when 'count' is passed as a query var. */ public function get_networks() { } /** * Used internally to get a list of network IDs matching the query vars. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int|array A single count of network IDs if a count query. An array of network IDs if a full query. */ protected function get_network_ids() { } /** * Used internally to generate an SQL string for searching across multiple columns. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $search Search string. * @param string[] $columns Array of columns to search. * @return string Search SQL. */ protected function get_search_sql($search, $columns) { } /** * Parses and sanitizes 'orderby' keys passed to the network query. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $orderby Alias for the field to order by. * @return string|false Value to used in the ORDER clause. False otherwise. */ protected function parse_orderby($orderby) { } /** * Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary. * * @since 4.6.0 * * @param string $order The 'order' query variable. * @return string The sanitized 'order' query variable. */ protected function parse_order($order) { } } /** * Core class used for interacting with a multisite network. * * This class is used during load to populate the `$current_site` global and * setup the current network. * * This class is most useful in WordPress multi-network installations where the * ability to interact with any network of sites is required. * * @since 4.4.0 * * @property int $id * @property int $site_id */ #[\AllowDynamicProperties] class WP_Network { /** * Domain of the network. * * @since 4.4.0 * @var string */ public $domain = ''; /** * Path of the network. * * @since 4.4.0 * @var string */ public $path = ''; /** * Domain used to set cookies for this network. * * @since 4.4.0 * @var string */ public $cookie_domain = ''; /** * Name of this network. * * Named "site" vs. "network" for legacy reasons. * * @since 4.4.0 * @var string */ public $site_name = ''; /** * Retrieves a network from the database by its ID. * * @since 4.4.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $network_id The ID of the network to retrieve. * @return WP_Network|false The network's object if found. False if not. */ public static function get_instance($network_id) { } /** * Creates a new WP_Network object. * * Will populate object properties from the object provided and assign other * default properties based on that information. * * @since 4.4.0 * * @param WP_Network|object $network A network object. */ public function __construct($network) { } /** * Getter. * * Allows current multisite naming conventions when getting properties. * * @since 4.6.0 * * @param string $key Property to get. * @return mixed Value of the property. Null if not available. */ public function __get($key) { } /** * Isset-er. * * Allows current multisite naming conventions when checking for properties. * * @since 4.6.0 * * @param string $key Property to check if set. * @return bool Whether the property is set. */ public function __isset($key) { } /** * Setter. * * Allows current multisite naming conventions while setting properties. * * @since 4.6.0 * * @param string $key Property to set. * @param mixed $value Value to assign to the property. */ public function __set($key, $value) { } /** * Retrieves the closest matching network for a domain and path. * * This will not necessarily return an exact match for a domain and path. Instead, it * breaks the domain and path into pieces that are then used to match the closest * possibility from a query. * * The intent of this method is to match a network during bootstrap for a * requested site address. * * @since 4.4.0 * * @param string $domain Domain to check. * @param string $path Path to check. * @param int|null $segments Path segments to use. Defaults to null, or the full path. * @return WP_Network|false Network object if successful. False when no network is found. */ public static function get_by_path($domain = '', $path = '', $segments = \null) { } } /** * Core class that implements an object cache. * * The WordPress Object Cache is used to save on trips to the database. The * Object Cache stores all of the cache data to memory and makes the cache * contents available by using a key, which is used to name and later retrieve * the cache contents. * * The Object Cache can be replaced by other caching mechanisms by placing files * in the wp-content folder which is looked at in wp-settings. If that file * exists, then this file will not be included. * * @since 2.0.0 */ #[\AllowDynamicProperties] class WP_Object_Cache { /** * The amount of times the cache data was already stored in the cache. * * @since 2.5.0 * @var int */ public $cache_hits = 0; /** * Amount of times the cache did not have the request in cache. * * @since 2.0.0 * @var int */ public $cache_misses = 0; /** * List of global cache groups. * * @since 3.0.0 * @var string[] */ protected $global_groups = array(); /** * Sets up object properties. * * @since 2.0.8 */ public function __construct() { } /** * Makes private properties readable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to get. * @return mixed Property. */ public function __get($name) { } /** * Makes private properties settable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to set. * @param mixed $value Property value. */ public function __set($name, $value) { } /** * Makes private properties checkable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to check if set. * @return bool Whether the property is set. */ public function __isset($name) { } /** * Makes private properties un-settable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to unset. */ public function __unset($name) { } /** * Serves as a utility function to determine whether a key is valid. * * @since 6.1.0 * * @param int|string $key Cache key to check for validity. * @return bool Whether the key is valid. */ protected function is_valid_key($key) { } /** * Serves as a utility function to determine whether a key exists in the cache. * * @since 3.4.0 * * @param int|string $key Cache key to check for existence. * @param string $group Cache group for the key existence check. * @return bool Whether the key exists in the cache for the given group. */ protected function _exists($key, $group) { } /** * Adds data to the cache if it doesn't already exist. * * @since 2.0.0 * * @uses WP_Object_Cache::_exists() Checks to see if the cache already has data. * @uses WP_Object_Cache::set() Sets the data after the checking the cache * contents existence. * * @param int|string $key What to call the contents in the cache. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Default 'default'. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True on success, false if cache key and group already exist. */ public function add($key, $data, $group = 'default', $expire = 0) { } /** * Adds multiple values to the cache in one call. * * @since 6.0.0 * * @param array $data Array of keys and values to be added. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if cache key and group already exist. */ public function add_multiple(array $data, $group = '', $expire = 0) { } /** * Replaces the contents in the cache, if contents already exist. * * @since 2.0.0 * * @see WP_Object_Cache::set() * * @param int|string $key What to call the contents in the cache. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Default 'default'. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True if contents were replaced, false if original value does not exist. */ public function replace($key, $data, $group = 'default', $expire = 0) { } /** * Sets the data contents into the cache. * * The cache contents are grouped by the $group parameter followed by the * $key. This allows for duplicate IDs in unique groups. Therefore, naming of * the group should be used with care and should follow normal function * naming guidelines outside of core WordPress usage. * * The $expire parameter is not used, because the cache will automatically * expire for each time a page is accessed and PHP finishes. The method is * more for cache plugins which use files. * * @since 2.0.0 * @since 6.1.0 Returns false if cache key is invalid. * * @param int|string $key What to call the contents in the cache. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Default 'default'. * @param int $expire Optional. Not used. * @return bool True if contents were set, false if key is invalid. */ public function set($key, $data, $group = 'default', $expire = 0) { } /** * Sets multiple values to the cache in one call. * * @since 6.0.0 * * @param array $data Array of key and value to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is always true. */ public function set_multiple(array $data, $group = '', $expire = 0) { } /** * Retrieves the cache contents, if it exists. * * The contents will be first attempted to be retrieved by searching by the * key in the cache group. If the cache is hit (success) then the contents * are returned. * * On failure, the number of cache misses will be incremented. * * @since 2.0.0 * * @param int|string $key The key under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default 'default'. * @param bool $force Optional. Unused. Whether to force an update of the local cache * from the persistent cache. Default false. * @param bool $found Optional. Whether the key was found in the cache (passed by reference). * Disambiguates a return of false, a storable value. Default null. * @return mixed|false The cache contents on success, false on failure to retrieve contents. */ public function get($key, $group = 'default', $force = \false, &$found = \null) { } /** * Retrieves multiple values from the cache in one call. * * @since 5.5.0 * * @param array $keys Array of keys under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default 'default'. * @param bool $force Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @return array Array of return values, grouped by key. Each value is either * the cache contents on success, or false on failure. */ public function get_multiple($keys, $group = 'default', $force = \false) { } /** * Removes the contents of the cache key in the group. * * If the cache key does not exist in the group, then nothing will happen. * * @since 2.0.0 * * @param int|string $key What the contents in the cache are called. * @param string $group Optional. Where the cache contents are grouped. Default 'default'. * @param bool $deprecated Optional. Unused. Default false. * @return bool True on success, false if the contents were not deleted. */ public function delete($key, $group = 'default', $deprecated = \false) { } /** * Deletes multiple values from the cache in one call. * * @since 6.0.0 * * @param array $keys Array of keys to be deleted. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if the contents were not deleted. */ public function delete_multiple(array $keys, $group = '') { } /** * Increments numeric cache item's value. * * @since 3.3.0 * * @param int|string $key The cache key to increment. * @param int $offset Optional. The amount by which to increment the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default 'default'. * @return int|false The item's new value on success, false on failure. */ public function incr($key, $offset = 1, $group = 'default') { } /** * Decrements numeric cache item's value. * * @since 3.3.0 * * @param int|string $key The cache key to decrement. * @param int $offset Optional. The amount by which to decrement the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default 'default'. * @return int|false The item's new value on success, false on failure. */ public function decr($key, $offset = 1, $group = 'default') { } /** * Clears the object cache of all data. * * @since 2.0.0 * * @return true Always returns true. */ public function flush() { } /** * Removes all cache items in a group. * * @since 6.1.0 * * @param string $group Name of group to remove from cache. * @return true Always returns true. */ public function flush_group($group) { } /** * Sets the list of global cache groups. * * @since 3.0.0 * * @param string|string[] $groups List of groups that are global. */ public function add_global_groups($groups) { } /** * Switches the internal blog ID. * * This changes the blog ID used to create keys in blog specific groups. * * @since 3.5.0 * * @param int $blog_id Blog ID. */ public function switch_to_blog($blog_id) { } /** * Resets cache keys. * * @since 3.0.0 * * @deprecated 3.5.0 Use WP_Object_Cache::switch_to_blog() * @see switch_to_blog() */ public function reset() { } /** * Echoes the stats of the caching. * * Gives the cache hits, and cache misses. Also prints every cached group, * key and the data. * * @since 2.0.0 */ public function stats() { } } /** * oEmbed API endpoint controller. * * Registers the REST API route and delivers the response data. * The output format (XML or JSON) is handled by the REST API. * * @since 4.4.0 */ #[\AllowDynamicProperties] final class WP_oEmbed_Controller { /** * Register the oEmbed REST API route. * * @since 4.4.0 */ public function register_routes() { } /** * Callback for the embed API endpoint. * * Returns the JSON object for the post. * * @since 4.4.0 * * @param WP_REST_Request $request Full data about the request. * @return array|WP_Error oEmbed response data or WP_Error on failure. */ public function get_item($request) { } /** * Checks if current user can make a proxy oEmbed request. * * @since 4.8.0 * * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_proxy_item_permissions_check() { } /** * Callback for the proxy API endpoint. * * Returns the JSON object for the proxied item. * * @since 4.8.0 * * @see WP_oEmbed::get_html() * @global WP_Embed $wp_embed WordPress Embed object. * @global WP_Scripts $wp_scripts * * @param WP_REST_Request $request Full data about the request. * @return object|WP_Error oEmbed response data or WP_Error on failure. */ public function get_proxy_item($request) { } } /** * Core class used to implement oEmbed functionality. * * @since 2.9.0 */ #[\AllowDynamicProperties] class WP_oEmbed { /** * A list of oEmbed providers. * * @since 2.9.0 * @var array */ public $providers = array(); /** * A list of an early oEmbed providers. * * @since 4.0.0 * @var array */ public static $early_providers = array(); /** * Constructor. * * @since 2.9.0 */ public function __construct() { } /** * Exposes private/protected methods for backward compatibility. * * @since 4.0.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed|false Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } /** * Takes a URL and returns the corresponding oEmbed provider's URL, if there is one. * * @since 4.0.0 * * @see WP_oEmbed::discover() * * @param string $url The URL to the content. * @param string|array $args { * Optional. Additional provider arguments. Default empty. * * @type bool $discover Optional. Determines whether to attempt to discover link tags * at the given URL for an oEmbed provider when the provider URL * is not found in the built-in providers list. Default true. * } * @return string|false The oEmbed provider URL on success, false on failure. * @phpstan-param array{ * discover?: bool, * } $args */ public function get_provider($url, $args = '') { } /** * Adds an oEmbed provider. * * The provider is added just-in-time when wp_oembed_add_provider() is called before * the {@see 'plugins_loaded'} hook. * * The just-in-time addition is for the benefit of the {@see 'oembed_providers'} filter. * * @since 4.0.0 * * @see wp_oembed_add_provider() * * @param string $format Format of URL that this provider can handle. You can use * asterisks as wildcards. * @param string $provider The URL to the oEmbed provider.. * @param bool $regex Optional. Whether the $format parameter is in a regex format. * Default false. */ public static function _add_provider_early($format, $provider, $regex = \false) { } /** * Removes an oEmbed provider. * * The provider is removed just-in-time when wp_oembed_remove_provider() is called before * the {@see 'plugins_loaded'} hook. * * The just-in-time removal is for the benefit of the {@see 'oembed_providers'} filter. * * @since 4.0.0 * * @see wp_oembed_remove_provider() * * @param string $format The format of URL that this provider can handle. You can use * asterisks as wildcards. */ public static function _remove_provider_early($format) { } /** * Takes a URL and attempts to return the oEmbed data. * * @see WP_oEmbed::fetch() * * @since 4.8.0 * * @param string $url The URL to the content that should be attempted to be embedded. * @param string|array $args Optional. Additional arguments for retrieving embed HTML. * See wp_oembed_get() for accepted arguments. Default empty. * @return object|false The result in the form of an object on success, false on failure. * @phpstan-param array{ * width?: int|string, * height?: int|string, * discover?: bool, * } $args See wp_oembed_get() */ public function get_data($url, $args = '') { } /** * The do-it-all function that takes a URL and attempts to return the HTML. * * @see WP_oEmbed::fetch() * @see WP_oEmbed::data2html() * * @since 2.9.0 * * @param string $url The URL to the content that should be attempted to be embedded. * @param string|array $args Optional. Additional arguments for retrieving embed HTML. * See wp_oembed_get() for accepted arguments. Default empty. * @return string|false The UNSANITIZED (and potentially unsafe) HTML that should be used to embed * on success, false on failure. * @phpstan-param array{ * width?: int|string, * height?: int|string, * discover?: bool, * } $args See wp_oembed_get() */ public function get_html($url, $args = '') { } /** * Attempts to discover link tags at the given URL for an oEmbed provider. * * @since 2.9.0 * * @param string $url The URL that should be inspected for discovery `<link>` tags. * @return string|false The oEmbed provider URL on success, false on failure. */ public function discover($url) { } /** * Connects to an oEmbed provider and returns the result. * * @since 2.9.0 * * @param string $provider The URL to the oEmbed provider. * @param string $url The URL to the content that is desired to be embedded. * @param string|array $args Optional. Additional arguments for retrieving embed HTML. * See wp_oembed_get() for accepted arguments. Default empty. * @return object|false The result in the form of an object on success, false on failure. * @phpstan-param array{ * width?: int|string, * height?: int|string, * discover?: bool, * } $args See wp_oembed_get() */ public function fetch($provider, $url, $args = '') { } /** * Converts a data object from WP_oEmbed::fetch() and returns the HTML. * * @since 2.9.0 * * @param object $data A data object result from an oEmbed provider. * @param string $url The URL to the content that is desired to be embedded. * @return string|false The HTML needed to embed on success, false on failure. */ public function data2html($data, $url) { } /** * Strips any new lines from the HTML. * * @since 2.9.0 as strip_scribd_newlines() * @since 3.0.0 * * @param string $html Existing HTML. * @param object $data Data object from WP_oEmbed::data2html() * @param string $url The original URL passed to oEmbed. * @return string Possibly modified $html */ public function _strip_newlines($html, $data, $url) { } } /** * Core class used for storing paused extensions. * * @since 5.2.0 */ #[\AllowDynamicProperties] class WP_Paused_Extensions_Storage { /** * Type of extension. Used to key extension storage. Either 'plugin' or 'theme'. * * @since 5.2.0 * @var string */ protected $type; /** * Constructor. * * @since 5.2.0 * * @param string $extension_type Extension type. Either 'plugin' or 'theme'. * @phpstan-param 'plugin'|'theme' $extension_type */ public function __construct($extension_type) { } /** * Records an extension error. * * Only one error is stored per extension, with subsequent errors for the same extension overriding the * previously stored error. * * @since 5.2.0 * * @param string $extension Plugin or theme directory name. * @param array $error { * Error information returned by `error_get_last()`. * * @type int $type The error type. * @type string $file The name of the file in which the error occurred. * @type int $line The line number in which the error occurred. * @type string $message The error message. * } * @return bool True on success, false on failure. * @phpstan-param array{ * type?: int, * file?: string, * line?: int, * message?: string, * } $error */ public function set($extension, $error) { } /** * Forgets a previously recorded extension error. * * @since 5.2.0 * * @param string $extension Plugin or theme directory name. * @return bool True on success, false on failure. */ public function delete($extension) { } /** * Gets the error for an extension, if paused. * * @since 5.2.0 * * @param string $extension Plugin or theme directory name. * @return array|null Error that is stored, or null if the extension is not paused. */ public function get($extension) { } /** * Gets the paused extensions with their errors. * * @since 5.2.0 * * @return array { * Associative array of errors keyed by extension slug. * * @type array ...$0 Error information returned by `error_get_last()`. * } * @phpstan-return array<int|string, array> */ public function get_all() { } /** * Remove all paused extensions. * * @since 5.2.0 * * @return bool */ public function delete_all() { } /** * Checks whether the underlying API to store paused extensions is loaded. * * @since 5.2.0 * * @return bool True if the API is loaded, false otherwise. */ protected function is_api_loaded() { } /** * Get the option name for storing paused extensions. * * @since 5.2.0 * * @return string */ protected function get_option_name() { } } /** * Core class for installing plugin dependencies. * * It is designed to add plugin dependencies as designated in the * `Requires Plugins` header to a new view in the plugins install page. */ class WP_Plugin_Dependencies { /** * Holds 'get_plugins()'. * * @since 6.5.0 * * @var array */ protected static $plugins; /** * Holds plugin directory names to compare with cache. * * @since 6.5.0 * * @var array */ protected static $plugin_dirnames; /** * Holds sanitized plugin dependency slugs. * * Keyed on the dependent plugin's filepath, * relative to the plugins directory. * * @since 6.5.0 * * @var array */ protected static $dependencies; /** * Holds an array of sanitized plugin dependency slugs. * * @since 6.5.0 * * @var array */ protected static $dependency_slugs; /** * Holds an array of dependent plugin slugs. * * Keyed on the dependent plugin's filepath, * relative to the plugins directory. * * @since 6.5.0 * * @var array */ protected static $dependent_slugs; /** * Holds 'plugins_api()' data for plugin dependencies. * * @since 6.5.0 * * @var array */ protected static $dependency_api_data; /** * Holds plugin dependency filepaths, relative to the plugins directory. * * Keyed on the dependency's slug. * * @since 6.5.0 * * @var string[] */ protected static $dependency_filepaths; /** * An array of circular dependency pairings. * * @since 6.5.0 * * @var array[] */ protected static $circular_dependencies_pairs; /** * An array of circular dependency slugs. * * @since 6.5.0 * * @var string[] */ protected static $circular_dependencies_slugs; /** * Whether Plugin Dependencies have been initialized. * * @since 6.5.0 * * @var bool */ protected static $initialized = \false; /** * Initializes by fetching plugin header and plugin API data. * * @since 6.5.0 */ public static function initialize() { } /** * Determines whether the plugin has plugins that depend on it. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return bool Whether the plugin has plugins that depend on it. */ public static function has_dependents($plugin_file) { } /** * Determines whether the plugin has plugin dependencies. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return bool Whether a plugin has plugin dependencies. */ public static function has_dependencies($plugin_file) { } /** * Determines whether the plugin has active dependents. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return bool Whether the plugin has active dependents. */ public static function has_active_dependents($plugin_file) { } /** * Gets filepaths of plugins that require the dependency. * * @since 6.5.0 * * @param string $slug The dependency's slug. * @return array An array of dependent plugin filepaths, relative to the plugins directory. */ public static function get_dependents($slug) { } /** * Gets the slugs of plugins that the dependent requires. * * @since 6.5.0 * * @param string $plugin_file The dependent plugin's filepath, relative to the plugins directory. * @return array An array of dependency plugin slugs. */ public static function get_dependencies($plugin_file) { } /** * Gets a dependent plugin's filepath. * * @since 6.5.0 * * @param string $slug The dependent plugin's slug. * @return string|false The dependent plugin's filepath, relative to the plugins directory, * or false if the plugin has no dependencies. */ public static function get_dependent_filepath($slug) { } /** * Determines whether the plugin has unmet dependencies. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return bool Whether the plugin has unmet dependencies. */ public static function has_unmet_dependencies($plugin_file) { } /** * Determines whether the plugin has a circular dependency. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return bool Whether the plugin has a circular dependency. */ public static function has_circular_dependency($plugin_file) { } /** * Gets the names of plugins that require the plugin. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return array An array of dependent names. */ public static function get_dependent_names($plugin_file) { } /** * Gets the names of plugins required by the plugin. * * @since 6.5.0 * * @param string $plugin_file The dependent plugin's filepath, relative to the plugins directory. * @return array An array of dependency names. */ public static function get_dependency_names($plugin_file) { } /** * Gets the filepath for a dependency, relative to the plugin's directory. * * @since 6.5.0 * * @param string $slug The dependency's slug. * @return string|false If installed, the dependency's filepath relative to the plugins directory, otherwise false. */ public static function get_dependency_filepath($slug) { } /** * Returns API data for the dependency. * * @since 6.5.0 * * @param string $slug The dependency's slug. * @return array|false The dependency's API data on success, otherwise false. */ public static function get_dependency_data($slug) { } /** * Displays an admin notice if dependencies are not installed. * * @since 6.5.0 */ public static function display_admin_notice_for_unmet_dependencies() { } /** * Displays an admin notice if circular dependencies are installed. * * @since 6.5.0 */ public static function display_admin_notice_for_circular_dependencies() { } /** * Checks plugin dependencies after a plugin is installed via AJAX. * * @since 6.5.0 */ public static function check_plugin_dependencies_during_ajax() { } /** * Gets data for installed plugins. * * @since 6.5.0 * * @return array An array of plugin data. */ protected static function get_plugins() { } /** * Reads and stores dependency slugs from a plugin's 'Requires Plugins' header. * * @since 6.5.0 */ protected static function read_dependencies_from_plugin_headers() { } /** * Sanitizes slugs. * * @since 6.5.0 * * @param string $slugs A comma-separated string of plugin dependency slugs. * @return array An array of sanitized plugin dependency slugs. */ protected static function sanitize_dependency_slugs($slugs) { } /** * Gets the filepath of installed dependencies. * If a dependency is not installed, the filepath defaults to false. * * @since 6.5.0 * * @return array An array of install dependencies filepaths, relative to the plugins directory. */ protected static function get_dependency_filepaths() { } /** * Retrieves and stores dependency plugin data from the WordPress.org Plugin API. * * @since 6.5.0 * * @global string $pagenow The filename of the current screen. * * @return array|void An array of dependency API data, or void on early exit. */ protected static function get_dependency_api_data() { } /** * Gets plugin directory names. * * @since 6.5.0 * * @return array An array of plugin directory names. */ protected static function get_plugin_dirnames() { } /** * Gets circular dependency data. * * @since 6.5.0 * * @return array[] An array of circular dependency pairings. */ protected static function get_circular_dependencies() { } /** * Checks for circular dependencies. * * @since 6.5.0 * * @param array $dependents Array of dependent plugins. * @param array $dependencies Array of plugins dependencies. * @return array A circular dependency pairing, or an empty array if none exists. */ protected static function check_for_circular_dependencies($dependents, $dependencies) { } /** * Converts a plugin filepath to a slug. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return string The plugin's slug. */ protected static function convert_to_slug($plugin_file) { } } /** * Core class used for interacting with post types. * * @since 4.6.0 * * @see register_post_type() */ #[\AllowDynamicProperties] final class WP_Post_Type { /** * Post type key. * * @since 4.6.0 * @var string $name */ public $name; /** * Name of the post type shown in the menu. Usually plural. * * @since 4.6.0 * @var string $label */ public $label; /** * Labels object for this post type. * * If not set, post labels are inherited for non-hierarchical types * and page labels for hierarchical ones. * * @see get_post_type_labels() * * @since 4.6.0 * @var stdClass $labels */ public $labels; /** * A short descriptive summary of what the post type is. * * Default empty. * * @since 4.6.0 * @var string $description */ public $description = ''; /** * Whether a post type is intended for use publicly either via the admin interface or by front-end users. * * While the default settings of $exclude_from_search, $publicly_queryable, $show_ui, and $show_in_nav_menus * are inherited from public, each does not rely on this relationship and controls a very specific intention. * * Default false. * * @since 4.6.0 * @var bool $public */ public $public = \false; /** * Whether the post type is hierarchical (e.g. page). * * Default false. * * @since 4.6.0 * @var bool $hierarchical */ public $hierarchical = \false; /** * Whether to exclude posts with this post type from front end search * results. * * Default is the opposite value of $public. * * @since 4.6.0 * @var bool $exclude_from_search */ public $exclude_from_search = \null; /** * Whether queries can be performed on the front end for the post type as part of `parse_request()`. * * Endpoints would include: * * - `?post_type={post_type_key}` * - `?{post_type_key}={single_post_slug}` * - `?{post_type_query_var}={single_post_slug}` * * Default is the value of $public. * * @since 4.6.0 * @var bool $publicly_queryable */ public $publicly_queryable = \null; /** * Whether to generate and allow a UI for managing this post type in the admin. * * Default is the value of $public. * * @since 4.6.0 * @var bool $show_ui */ public $show_ui = \null; /** * Where to show the post type in the admin menu. * * To work, $show_ui must be true. If true, the post type is shown in its own top level menu. If false, no menu is * shown. If a string of an existing top level menu ('tools.php' or 'edit.php?post_type=page', for example), the * post type will be placed as a sub-menu of that. * * Default is the value of $show_ui. * * @since 4.6.0 * @var bool|string $show_in_menu */ public $show_in_menu = \null; /** * Makes this post type available for selection in navigation menus. * * Default is the value $public. * * @since 4.6.0 * @var bool $show_in_nav_menus */ public $show_in_nav_menus = \null; /** * Makes this post type available via the admin bar. * * Default is the value of $show_in_menu. * * @since 4.6.0 * @var bool $show_in_admin_bar */ public $show_in_admin_bar = \null; /** * The position in the menu order the post type should appear. * * To work, $show_in_menu must be true. Default null (at the bottom). * * @since 4.6.0 * @var int $menu_position */ public $menu_position = \null; /** * The URL or reference to the icon to be used for this menu. * * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme. * This should begin with 'data:image/svg+xml;base64,'. Pass the name of a Dashicons helper class * to use a font icon, e.g. 'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty * so an icon can be added via CSS. * * Defaults to use the posts icon. * * @since 4.6.0 * @var string $menu_icon */ public $menu_icon = \null; /** * The string to use to build the read, edit, and delete capabilities. * * May be passed as an array to allow for alternative plurals when using * this argument as a base to construct the capabilities, e.g. * array( 'story', 'stories' ). Default 'post'. * * @since 4.6.0 * @var string $capability_type */ public $capability_type = 'post'; /** * Whether to use the internal default meta capability handling. * * Default false. * * @since 4.6.0 * @var bool $map_meta_cap */ public $map_meta_cap = \false; /** * Provide a callback function that sets up the meta boxes for the edit form. * * Do `remove_meta_box()` and `add_meta_box()` calls in the callback. Default null. * * @since 4.6.0 * @var callable $register_meta_box_cb */ public $register_meta_box_cb = \null; /** * An array of taxonomy identifiers that will be registered for the post type. * * Taxonomies can be registered later with `register_taxonomy()` or `register_taxonomy_for_object_type()`. * * Default empty array. * * @since 4.6.0 * @var string[] $taxonomies */ public $taxonomies = array(); /** * Whether there should be post type archives, or if a string, the archive slug to use. * * Will generate the proper rewrite rules if $rewrite is enabled. Default false. * * @since 4.6.0 * @var bool|string $has_archive */ public $has_archive = \false; /** * Sets the query_var key for this post type. * * Defaults to $post_type key. If false, a post type cannot be loaded at `?{query_var}={post_slug}`. * If specified as a string, the query `?{query_var_string}={post_slug}` will be valid. * * @since 4.6.0 * @var string|bool $query_var */ public $query_var; /** * Whether to allow this post type to be exported. * * Default true. * * @since 4.6.0 * @var bool $can_export */ public $can_export = \true; /** * Whether to delete posts of this type when deleting a user. * * - If true, posts of this type belonging to the user will be moved to Trash when the user is deleted. * - If false, posts of this type belonging to the user will *not* be trashed or deleted. * - If not set (the default), posts are trashed if post type supports the 'author' feature. * Otherwise posts are not trashed or deleted. * * Default null. * * @since 4.6.0 * @var bool $delete_with_user */ public $delete_with_user = \null; /** * Array of blocks to use as the default initial state for an editor session. * * Each item should be an array containing block name and optional attributes. * * Default empty array. * * @link https://developer.wordpress.org/block-editor/developers/block-api/block-templates/ * * @since 5.0.0 * @var array[] $template */ public $template = array(); /** * Whether the block template should be locked if $template is set. * * - If set to 'all', the user is unable to insert new blocks, move existing blocks * and delete blocks. * - If set to 'insert', the user is able to move existing blocks but is unable to insert * new blocks and delete blocks. * * Default false. * * @link https://developer.wordpress.org/block-editor/developers/block-api/block-templates/ * * @since 5.0.0 * @var string|false $template_lock */ public $template_lock = \false; /** * Whether this post type is a native or "built-in" post_type. * * Default false. * * @since 4.6.0 * @var bool $_builtin */ public $_builtin = \false; /** * URL segment to use for edit link of this post type. * * Default 'post.php?post=%d'. * * @since 4.6.0 * @var string $_edit_link */ public $_edit_link = 'post.php?post=%d'; /** * Post type capabilities. * * @since 4.6.0 * @var stdClass $cap */ public $cap; /** * Triggers the handling of rewrites for this post type. * * Defaults to true, using $post_type as slug. * * @since 4.6.0 * @var array|false $rewrite */ public $rewrite; /** * The features supported by the post type. * * @since 4.6.0 * @var array|bool $supports */ public $supports; /** * Whether this post type should appear in the REST API. * * Default false. If true, standard endpoints will be registered with * respect to $rest_base and $rest_controller_class. * * @since 4.7.4 * @var bool $show_in_rest */ public $show_in_rest; /** * The base path for this post type's REST API endpoints. * * @since 4.7.4 * @var string|bool $rest_base */ public $rest_base; /** * The namespace for this post type's REST API endpoints. * * @since 5.9.0 * @var string|bool $rest_namespace */ public $rest_namespace; /** * The controller for this post type's REST API endpoints. * * Custom controllers must extend WP_REST_Controller. * * @since 4.7.4 * @var string|bool $rest_controller_class */ public $rest_controller_class; /** * The controller instance for this post type's REST API endpoints. * * Lazily computed. Should be accessed using {@see WP_Post_Type::get_rest_controller()}. * * @since 5.3.0 * @var WP_REST_Controller $rest_controller */ public $rest_controller; /** * The controller for this post type's revisions REST API endpoints. * * Custom controllers must extend WP_REST_Controller. * * @since 6.4.0 * @var string|bool $revisions_rest_controller_class */ public $revisions_rest_controller_class; /** * The controller instance for this post type's revisions REST API endpoints. * * Lazily computed. Should be accessed using {@see WP_Post_Type::get_revisions_rest_controller()}. * * @since 6.4.0 * @var WP_REST_Controller $revisions_rest_controller */ public $revisions_rest_controller; /** * The controller for this post type's autosave REST API endpoints. * * Custom controllers must extend WP_REST_Controller. * * @since 6.4.0 * @var string|bool $autosave_rest_controller_class */ public $autosave_rest_controller_class; /** * The controller instance for this post type's autosave REST API endpoints. * * Lazily computed. Should be accessed using {@see WP_Post_Type::get_autosave_rest_controller()}. * * @since 6.4.0 * @var WP_REST_Controller $autosave_rest_controller */ public $autosave_rest_controller; /** * A flag to register the post type REST API controller after its associated autosave / revisions controllers, instead of before. Registration order affects route matching priority. * * @since 6.4.0 * @var bool $late_route_registration */ public $late_route_registration; /** * Constructor. * * See the register_post_type() function for accepted arguments for `$args`. * * Will populate object properties from the provided arguments and assign other * default properties based on that information. * * @since 4.6.0 * * @see register_post_type() * * @param string $post_type Post type key. * @param array|string $args Optional. Array or string of arguments for registering a post type. * See register_post_type() for information on accepted arguments. * Default empty array. * @phpstan-param array{ * label?: string, * labels?: string[], * description?: string, * public?: bool, * hierarchical?: bool, * exclude_from_search?: bool, * publicly_queryable?: bool, * show_ui?: bool, * show_in_menu?: bool|string, * show_in_nav_menus?: bool, * show_in_admin_bar?: bool, * show_in_rest?: bool, * rest_base?: string, * rest_namespace?: string, * rest_controller_class?: string, * autosave_rest_controller_class?: string|bool, * revisions_rest_controller_class?: string|bool, * late_route_registration?: bool, * menu_position?: int, * menu_icon?: string, * capability_type?: string|array, * capabilities?: string[], * map_meta_cap?: bool, * supports?: array|false, * register_meta_box_cb?: callable, * taxonomies?: string[], * has_archive?: bool|string, * rewrite?: bool|array{ * slug?: string, * with_front?: bool, * feeds?: bool, * pages?: bool, * ep_mask?: int, * }, * query_var?: string|bool, * can_export?: bool, * delete_with_user?: bool, * template?: array, * template_lock?: string|false, * _builtin?: bool, * _edit_link?: string, * } $args See register_post_type() */ public function __construct($post_type, $args = array()) { } /** * Sets post type properties. * * See the register_post_type() function for accepted arguments for `$args`. * * @since 4.6.0 * * @param array|string $args Array or string of arguments for registering a post type. */ public function set_props($args) { } /** * Sets the features support for the post type. * * @since 4.6.0 */ public function add_supports() { } /** * Adds the necessary rewrite rules for the post type. * * @since 4.6.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * @global WP $wp Current WordPress environment instance. */ public function add_rewrite_rules() { } /** * Registers the post type meta box if a custom callback was specified. * * @since 4.6.0 */ public function register_meta_boxes() { } /** * Adds the future post hook action for the post type. * * @since 4.6.0 */ public function add_hooks() { } /** * Registers the taxonomies for the post type. * * @since 4.6.0 */ public function register_taxonomies() { } /** * Removes the features support for the post type. * * @since 4.6.0 * * @global array $_wp_post_type_features Post type features. */ public function remove_supports() { } /** * Removes any rewrite rules, permastructs, and rules for the post type. * * @since 4.6.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * @global WP $wp Current WordPress environment instance. * @global array $post_type_meta_caps Used to remove meta capabilities. */ public function remove_rewrite_rules() { } /** * Unregisters the post type meta box if a custom callback was specified. * * @since 4.6.0 */ public function unregister_meta_boxes() { } /** * Removes the post type from all taxonomies. * * @since 4.6.0 */ public function unregister_taxonomies() { } /** * Removes the future post hook action for the post type. * * @since 4.6.0 */ public function remove_hooks() { } /** * Gets the REST API controller for this post type. * * Will only instantiate the controller class once per request. * * @since 5.3.0 * * @return WP_REST_Controller|null The controller instance, or null if the post type * is set not to show in rest. */ public function get_rest_controller() { } /** * Gets the REST API revisions controller for this post type. * * Will only instantiate the controller class once per request. * * @since 6.4.0 * * @return WP_REST_Controller|null The controller instance, or null if the post type * is set not to show in rest. */ public function get_revisions_rest_controller() { } /** * Gets the REST API autosave controller for this post type. * * Will only instantiate the controller class once per request. * * @since 6.4.0 * * @return WP_REST_Controller|null The controller instance, or null if the post type * is set not to show in rest. */ public function get_autosave_rest_controller() { } /** * Returns the default labels for post types. * * @since 6.0.0 * * @return (string|null)[][] The default labels for post types. */ public static function get_default_labels() { } /** * Resets the cache for the default labels. * * @since 6.0.0 */ public static function reset_default_labels() { } } /** * Core class used to implement the WP_Post object. * * @since 3.5.0 * * @property string $page_template * * @property-read int[] $ancestors * @property-read int[] $post_category * @property-read string[] $tags_input */ #[\AllowDynamicProperties] final class WP_Post { /** * Post ID. * * @since 3.5.0 * @var int */ public $ID; /** * ID of post author. * * A numeric string, for compatibility reasons. * * @since 3.5.0 * @var string */ public $post_author = 0; /** * The post's local publication time. * * @since 3.5.0 * @var string */ public $post_date = '0000-00-00 00:00:00'; /** * The post's GMT publication time. * * @since 3.5.0 * @var string */ public $post_date_gmt = '0000-00-00 00:00:00'; /** * The post's content. * * @since 3.5.0 * @var string */ public $post_content = ''; /** * The post's title. * * @since 3.5.0 * @var string */ public $post_title = ''; /** * The post's excerpt. * * @since 3.5.0 * @var string */ public $post_excerpt = ''; /** * The post's status. * * @since 3.5.0 * @var string */ public $post_status = 'publish'; /** * Whether comments are allowed. * * @since 3.5.0 * @var string */ public $comment_status = 'open'; /** * Whether pings are allowed. * * @since 3.5.0 * @var string */ public $ping_status = 'open'; /** * The post's password in plain text. * * @since 3.5.0 * @var string */ public $post_password = ''; /** * The post's slug. * * @since 3.5.0 * @var string */ public $post_name = ''; /** * URLs queued to be pinged. * * @since 3.5.0 * @var string */ public $to_ping = ''; /** * URLs that have been pinged. * * @since 3.5.0 * @var string */ public $pinged = ''; /** * The post's local modified time. * * @since 3.5.0 * @var string */ public $post_modified = '0000-00-00 00:00:00'; /** * The post's GMT modified time. * * @since 3.5.0 * @var string */ public $post_modified_gmt = '0000-00-00 00:00:00'; /** * A utility DB field for post content. * * @since 3.5.0 * @var string */ public $post_content_filtered = ''; /** * ID of a post's parent post. * * @since 3.5.0 * @var int */ public $post_parent = 0; /** * The unique identifier for a post, not necessarily a URL, used as the feed GUID. * * @since 3.5.0 * @var string */ public $guid = ''; /** * A field used for ordering posts. * * @since 3.5.0 * @var int */ public $menu_order = 0; /** * The post's type, like post or page. * * @since 3.5.0 * @var string */ public $post_type = 'post'; /** * An attachment's mime type. * * @since 3.5.0 * @var string */ public $post_mime_type = ''; /** * Cached comment count. * * A numeric string, for compatibility reasons. * * @since 3.5.0 * @var string */ public $comment_count = 0; /** * Stores the post object's sanitization level. * * Does not correspond to a DB field. * * @since 3.5.0 * @var string */ public $filter; /** * Retrieve WP_Post instance. * * @since 3.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $post_id Post ID. * @return WP_Post|false Post object, false otherwise. */ public static function get_instance($post_id) { } /** * Constructor. * * @since 3.5.0 * * @param WP_Post|object $post Post object. */ public function __construct($post) { } /** * Isset-er. * * @since 3.5.0 * * @param string $key Property to check if set. * @return bool */ public function __isset($key) { } /** * Getter. * * @since 3.5.0 * * @param string $key Key to get. * @return mixed */ public function __get($key) { } /** * {@Missing Summary} * * @since 3.5.0 * * @param string $filter Filter. * @return WP_Post */ public function filter($filter) { } /** * Convert object to array. * * @since 3.5.0 * * @return array Object as array. */ public function to_array() { } } /** * The WordPress Query class. * * @link https://developer.wordpress.org/reference/classes/wp_query/ * * @since 1.5.0 * @since 4.5.0 Removed the `$comments_popup` property. * @phpstan-property-read bool $query_vars_changed * @phpstan-property-read bool|string $query_vars_hash * @phpstan-method void init_query_flags() */ #[\AllowDynamicProperties] class WP_Query { /** * Query vars set by the user. * * @since 1.5.0 * @var array */ public $query; /** * Query vars, after parsing. * * @since 1.5.0 * @var array */ public $query_vars = array(); /** * Taxonomy query, as passed to get_tax_sql(). * * @since 3.1.0 * @var WP_Tax_Query|null A taxonomy query instance. */ public $tax_query; /** * Metadata query container. * * @since 3.2.0 * @var WP_Meta_Query A meta query instance. */ public $meta_query = \false; /** * Date query container. * * @since 3.7.0 * @var WP_Date_Query A date query instance. */ public $date_query = \false; /** * Holds the data for a single object that is queried. * * Holds the contents of a post, page, category, attachment. * * @since 1.5.0 * @var WP_Term|WP_Post_Type|WP_Post|WP_User|null */ public $queried_object; /** * The ID of the queried object. * * @since 1.5.0 * @var int */ public $queried_object_id; /** * SQL for the database query. * * @since 2.0.1 * @var string */ public $request; /** * Array of post objects or post IDs. * * @since 1.5.0 * @var WP_Post[]|int[] */ public $posts; /** * The number of posts for the current query. * * @since 1.5.0 * @var int */ public $post_count = 0; /** * Index of the current item in the loop. * * @since 1.5.0 * @var int */ public $current_post = -1; /** * Whether the caller is before the loop. * * @since 6.3.0 * @var bool */ public $before_loop = \true; /** * Whether the loop has started and the caller is in the loop. * * @since 2.0.0 * @var bool */ public $in_the_loop = \false; /** * The current post. * * This property does not get populated when the `fields` argument is set to * `ids` or `id=>parent`. * * @since 1.5.0 * @var WP_Post|null */ public $post; /** * The list of comments for current post. * * @since 2.2.0 * @var WP_Comment[] */ public $comments; /** * The number of comments for the posts. * * @since 2.2.0 * @var int */ public $comment_count = 0; /** * The index of the comment in the comment loop. * * @since 2.2.0 * @var int */ public $current_comment = -1; /** * Current comment object. * * @since 2.2.0 * @var WP_Comment */ public $comment; /** * The number of found posts for the current query. * * If limit clause was not used, equals $post_count. * * @since 2.1.0 * @var int */ public $found_posts = 0; /** * The number of pages. * * @since 2.1.0 * @var int */ public $max_num_pages = 0; /** * The number of comment pages. * * @since 2.7.0 * @var int */ public $max_num_comment_pages = 0; /** * Signifies whether the current query is for a single post. * * @since 1.5.0 * @var bool */ public $is_single = \false; /** * Signifies whether the current query is for a preview. * * @since 2.0.0 * @var bool */ public $is_preview = \false; /** * Signifies whether the current query is for a page. * * @since 1.5.0 * @var bool */ public $is_page = \false; /** * Signifies whether the current query is for an archive. * * @since 1.5.0 * @var bool */ public $is_archive = \false; /** * Signifies whether the current query is for a date archive. * * @since 1.5.0 * @var bool */ public $is_date = \false; /** * Signifies whether the current query is for a year archive. * * @since 1.5.0 * @var bool */ public $is_year = \false; /** * Signifies whether the current query is for a month archive. * * @since 1.5.0 * @var bool */ public $is_month = \false; /** * Signifies whether the current query is for a day archive. * * @since 1.5.0 * @var bool */ public $is_day = \false; /** * Signifies whether the current query is for a specific time. * * @since 1.5.0 * @var bool */ public $is_time = \false; /** * Signifies whether the current query is for an author archive. * * @since 1.5.0 * @var bool */ public $is_author = \false; /** * Signifies whether the current query is for a category archive. * * @since 1.5.0 * @var bool */ public $is_category = \false; /** * Signifies whether the current query is for a tag archive. * * @since 2.3.0 * @var bool */ public $is_tag = \false; /** * Signifies whether the current query is for a taxonomy archive. * * @since 2.5.0 * @var bool */ public $is_tax = \false; /** * Signifies whether the current query is for a search. * * @since 1.5.0 * @var bool */ public $is_search = \false; /** * Signifies whether the current query is for a feed. * * @since 1.5.0 * @var bool */ public $is_feed = \false; /** * Signifies whether the current query is for a comment feed. * * @since 2.2.0 * @var bool */ public $is_comment_feed = \false; /** * Signifies whether the current query is for trackback endpoint call. * * @since 1.5.0 * @var bool */ public $is_trackback = \false; /** * Signifies whether the current query is for the site homepage. * * @since 1.5.0 * @var bool */ public $is_home = \false; /** * Signifies whether the current query is for the Privacy Policy page. * * @since 5.2.0 * @var bool */ public $is_privacy_policy = \false; /** * Signifies whether the current query couldn't find anything. * * @since 1.5.0 * @var bool */ public $is_404 = \false; /** * Signifies whether the current query is for an embed. * * @since 4.4.0 * @var bool */ public $is_embed = \false; /** * Signifies whether the current query is for a paged result and not for the first page. * * @since 1.5.0 * @var bool */ public $is_paged = \false; /** * Signifies whether the current query is for an administrative interface page. * * @since 1.5.0 * @var bool */ public $is_admin = \false; /** * Signifies whether the current query is for an attachment page. * * @since 2.0.0 * @var bool */ public $is_attachment = \false; /** * Signifies whether the current query is for an existing single post of any post type * (post, attachment, page, custom post types). * * @since 2.1.0 * @var bool */ public $is_singular = \false; /** * Signifies whether the current query is for the robots.txt file. * * @since 2.1.0 * @var bool */ public $is_robots = \false; /** * Signifies whether the current query is for the favicon.ico file. * * @since 5.4.0 * @var bool */ public $is_favicon = \false; /** * Signifies whether the current query is for the page_for_posts page. * * Basically, the homepage if the option isn't set for the static homepage. * * @since 2.1.0 * @var bool */ public $is_posts_page = \false; /** * Signifies whether the current query is for a post type archive. * * @since 3.1.0 * @var bool */ public $is_post_type_archive = \false; /** * Set if post thumbnails are cached * * @since 3.2.0 * @var bool */ public $thumbnails_cached = \false; /** * Controls whether an attachment query should include filenames or not. * * @since 6.0.3 * @var bool */ protected $allow_query_attachment_by_filename = \false; /** * Initiates object properties and sets default values. * * @since 1.5.0 */ public function init() { } /** * Reparses the query vars. * * @since 1.5.0 */ public function parse_query_vars() { } /** * Fills in the query variables, which do not exist within the parameter. * * @since 2.1.0 * @since 4.5.0 Removed the `comments_popup` public query variable. * * @param array $query_vars Defined query variables. * @return array Complete query variables with undefined ones filled in empty. */ public function fill_query_vars($query_vars) { } /** * Parses a query string and sets query type booleans. * * @since 1.5.0 * @since 4.2.0 Introduced the ability to order by specific clauses of a `$meta_query`, by passing the clause's * array key to `$orderby`. * @since 4.4.0 Introduced `$post_name__in` and `$title` parameters. `$s` was updated to support excluded * search terms, by prepending a hyphen. * @since 4.5.0 Removed the `$comments_popup` parameter. * Introduced the `$comment_status` and `$ping_status` parameters. * Introduced `RAND(x)` syntax for `$orderby`, which allows an integer seed value to random sorts. * @since 4.6.0 Added 'post_name__in' support for `$orderby`. Introduced the `$lazy_load_term_meta` argument. * @since 4.9.0 Introduced the `$comment_count` parameter. * @since 5.1.0 Introduced the `$meta_compare_key` parameter. * @since 5.3.0 Introduced the `$meta_type_key` parameter. * @since 6.1.0 Introduced the `$update_menu_item_cache` parameter. * @since 6.2.0 Introduced the `$search_columns` parameter. * * @param string|array $query { * Optional. Array or string of Query parameters. * * @type int $attachment_id Attachment post ID. Used for 'attachment' post_type. * @type int|string $author Author ID, or comma-separated list of IDs. * @type string $author_name User 'user_nicename'. * @type int[] $author__in An array of author IDs to query from. * @type int[] $author__not_in An array of author IDs not to query from. * @type bool $cache_results Whether to cache post information. Default true. * @type int|string $cat Category ID or comma-separated list of IDs (this or any children). * @type int[] $category__and An array of category IDs (AND in). * @type int[] $category__in An array of category IDs (OR in, no children). * @type int[] $category__not_in An array of category IDs (NOT in). * @type string $category_name Use category slug (not name, this or any children). * @type array|int $comment_count Filter results by comment count. Provide an integer to match * comment count exactly. Provide an array with integer 'value' * and 'compare' operator ('=', '!=', '>', '>=', '<', '<=' ) to * compare against comment_count in a specific way. * @type string $comment_status Comment status. * @type int $comments_per_page The number of comments to return per page. * Default 'comments_per_page' option. * @type array $date_query An associative array of WP_Date_Query arguments. * See WP_Date_Query::__construct(). * @type int $day Day of the month. Default empty. Accepts numbers 1-31. * @type bool $exact Whether to search by exact keyword. Default false. * @type string $fields Post fields to query for. Accepts: * - '' Returns an array of complete post objects (`WP_Post[]`). * - 'ids' Returns an array of post IDs (`int[]`). * - 'id=>parent' Returns an associative array of parent post IDs, * keyed by post ID (`int[]`). * Default ''. * @type int $hour Hour of the day. Default empty. Accepts numbers 0-23. * @type int|bool $ignore_sticky_posts Whether to ignore sticky posts or not. Setting this to false * excludes stickies from 'post__in'. Accepts 1|true, 0|false. * Default false. * @type int $m Combination YearMonth. Accepts any four-digit year and month * numbers 01-12. Default empty. * @type string|string[] $meta_key Meta key or keys to filter by. * @type string|string[] $meta_value Meta value or values to filter by. * @type string $meta_compare MySQL operator used for comparing the meta value. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_compare_key MySQL operator used for comparing the meta key. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type array $meta_query An associative array of WP_Meta_Query arguments. * See WP_Meta_Query::__construct() for accepted values. * @type int $menu_order The menu order of the posts. * @type int $minute Minute of the hour. Default empty. Accepts numbers 0-59. * @type int $monthnum The two-digit month. Default empty. Accepts numbers 1-12. * @type string $name Post slug. * @type bool $nopaging Show all posts (true) or paginate (false). Default false. * @type bool $no_found_rows Whether to skip counting the total rows found. Enabling can improve * performance. Default false. * @type int $offset The number of posts to offset before retrieval. * @type string $order Designates ascending or descending order of posts. Default 'DESC'. * Accepts 'ASC', 'DESC'. * @type string|array $orderby Sort retrieved posts by parameter. One or more options may be passed. * To use 'meta_value', or 'meta_value_num', 'meta_key=keyname' must be * also be defined. To sort by a specific `$meta_query` clause, use that * clause's array key. Accepts: * - 'none' * - 'name' * - 'author' * - 'date' * - 'title' * - 'modified' * - 'menu_order' * - 'parent' * - 'ID' * - 'rand' * - 'relevance' * - 'RAND(x)' (where 'x' is an integer seed value) * - 'comment_count' * - 'meta_value' * - 'meta_value_num' * - 'post__in' * - 'post_name__in' * - 'post_parent__in' * - The array keys of `$meta_query`. * Default is 'date', except when a search is being performed, when * the default is 'relevance'. * @type int $p Post ID. * @type int $page Show the number of posts that would show up on page X of a * static front page. * @type int $paged The number of the current page. * @type int $page_id Page ID. * @type string $pagename Page slug. * @type string $perm Show posts if user has the appropriate capability. * @type string $ping_status Ping status. * @type int[] $post__in An array of post IDs to retrieve, sticky posts will be included. * @type int[] $post__not_in An array of post IDs not to retrieve. Note: a string of comma- * separated IDs will NOT work. * @type string $post_mime_type The mime type of the post. Used for 'attachment' post_type. * @type string[] $post_name__in An array of post slugs that results must match. * @type int $post_parent Page ID to retrieve child pages for. Use 0 to only retrieve * top-level pages. * @type int[] $post_parent__in An array containing parent page IDs to query child pages from. * @type int[] $post_parent__not_in An array containing parent page IDs not to query child pages from. * @type string|string[] $post_type A post type slug (string) or array of post type slugs. * Default 'any' if using 'tax_query'. * @type string|string[] $post_status A post status (string) or array of post statuses. * @type int $posts_per_page The number of posts to query for. Use -1 to request all posts. * @type int $posts_per_archive_page The number of posts to query for by archive page. Overrides * 'posts_per_page' when is_archive(), or is_search() are true. * @type string $s Search keyword(s). Prepending a term with a hyphen will * exclude posts matching that term. Eg, 'pillow -sofa' will * return posts containing 'pillow' but not 'sofa'. The * character used for exclusion can be modified using the * the 'wp_query_search_exclusion_prefix' filter. * @type string[] $search_columns Array of column names to be searched. Accepts 'post_title', * 'post_excerpt' and 'post_content'. Default empty array. * @type int $second Second of the minute. Default empty. Accepts numbers 0-59. * @type bool $sentence Whether to search by phrase. Default false. * @type bool $suppress_filters Whether to suppress filters. Default false. * @type string $tag Tag slug. Comma-separated (either), Plus-separated (all). * @type int[] $tag__and An array of tag IDs (AND in). * @type int[] $tag__in An array of tag IDs (OR in). * @type int[] $tag__not_in An array of tag IDs (NOT in). * @type int $tag_id Tag id or comma-separated list of IDs. * @type string[] $tag_slug__and An array of tag slugs (AND in). * @type string[] $tag_slug__in An array of tag slugs (OR in). unless 'ignore_sticky_posts' is * true. Note: a string of comma-separated IDs will NOT work. * @type array $tax_query An associative array of WP_Tax_Query arguments. * See WP_Tax_Query::__construct(). * @type string $title Post title. * @type bool $update_post_meta_cache Whether to update the post meta cache. Default true. * @type bool $update_post_term_cache Whether to update the post term cache. Default true. * @type bool $update_menu_item_cache Whether to update the menu item cache. Default false. * @type bool $lazy_load_term_meta Whether to lazy-load term meta. Setting to false will * disable cache priming for term meta, so that each * get_term_meta() call will hit the database. * Defaults to the value of `$update_post_term_cache`. * @type int $w The week number of the year. Default empty. Accepts numbers 0-53. * @type int $year The four-digit year. Default empty. Accepts any four-digit year. * } * @phpstan-param array{ * attachment_id?: int, * author?: int|string, * author_name?: string, * author__in?: int[], * author__not_in?: int[], * cache_results?: bool, * cat?: int|string, * category__and?: int[], * category__in?: int[], * category__not_in?: int[], * category_name?: string, * comment_count?: array|int, * comment_status?: string, * comments_per_page?: int, * date_query?: array, * day?: int, * exact?: bool, * fields?: string, * hour?: int, * ignore_sticky_posts?: int|bool, * m?: int, * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * menu_order?: int, * minute?: int, * monthnum?: int, * name?: string, * nopaging?: bool, * no_found_rows?: bool, * offset?: int, * order?: string, * orderby?: string|array, * p?: int, * page?: int, * paged?: int, * page_id?: int, * pagename?: string, * perm?: string, * ping_status?: string, * post__in?: int[], * post__not_in?: int[], * post_mime_type?: string, * post_name__in?: string[], * post_parent?: int, * post_parent__in?: int[], * post_parent__not_in?: int[], * post_type?: string|string[], * post_status?: string|string[], * posts_per_page?: int, * posts_per_archive_page?: int, * s?: string, * search_columns?: string[], * second?: int, * sentence?: bool, * suppress_filters?: bool, * tag?: string, * tag__and?: int[], * tag__in?: int[], * tag__not_in?: int[], * tag_id?: int, * tag_slug__and?: string[], * tag_slug__in?: string[], * tax_query?: array, * title?: string, * update_post_meta_cache?: bool, * update_post_term_cache?: bool, * update_menu_item_cache?: bool, * lazy_load_term_meta?: bool, * w?: int, * year?: int, * } $query */ public function parse_query($query = '') { } /** * Parses various taxonomy related query vars. * * For BC, this method is not marked as protected. See [28987]. * * @since 3.1.0 * * @param array $q The query variables. Passed by reference. */ public function parse_tax_query(&$q) { } /** * Generates SQL for the WHERE clause based on passed search terms. * * @since 3.7.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $q Query variables. * @return string WHERE clause. */ protected function parse_search(&$q) { } /** * Checks if the terms are suitable for searching. * * Uses an array of stopwords (terms) that are excluded from the separate * term matching when searching for posts. The list of English stopwords is * the approximate search engines list, and is translatable. * * @since 3.7.0 * * @param string[] $terms Array of terms to check. * @return string[] Terms that are not stopwords. */ protected function parse_search_terms($terms) { } /** * Retrieves stopwords used when parsing search terms. * * @since 3.7.0 * * @return string[] Stopwords. */ protected function get_search_stopwords() { } /** * Generates SQL for the ORDER BY condition based on passed search terms. * * @since 3.7.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $q Query variables. * @return string ORDER BY clause. */ protected function parse_search_order(&$q) { } /** * Converts the given orderby alias (if allowed) to a properly-prefixed value. * * @since 4.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $orderby Alias for the field to order by. * @return string|false Table-prefixed value to used in the ORDER clause. False otherwise. */ protected function parse_orderby($orderby) { } /** * Parse an 'order' query variable and cast it to ASC or DESC as necessary. * * @since 4.0.0 * * @param string $order The 'order' query variable. * @return string The sanitized 'order' query variable. */ protected function parse_order($order) { } /** * Sets the 404 property and saves whether query is feed. * * @since 2.0.0 */ public function set_404() { } /** * Retrieves the value of a query variable. * * @since 1.5.0 * @since 3.9.0 The `$default_value` argument was introduced. * * @param string $query_var Query variable key. * @param mixed $default_value Optional. Value to return if the query variable is not set. * Default empty string. * @return mixed Contents of the query variable. */ public function get($query_var, $default_value = '') { } /** * Sets the value of a query variable. * * @since 1.5.0 * * @param string $query_var Query variable key. * @param mixed $value Query variable value. */ public function set($query_var, $value) { } /** * Retrieves an array of posts based on query variables. * * There are a few filters and actions that can be used to modify the post * database query. * * @since 1.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return WP_Post[]|int[] Array of post objects or post IDs. */ public function get_posts() { } /** * Sets up the next post and iterate current post index. * * @since 1.5.0 * * @return WP_Post Next post. */ public function next_post() { } /** * Sets up the current post. * * Retrieves the next post, sets up the post, sets the 'in the loop' * property to true. * * @since 1.5.0 * * @global WP_Post $post Global post object. */ public function the_post() { } /** * Determines whether there are more posts available in the loop. * * Calls the {@see 'loop_end'} action when the loop is complete. * * @since 1.5.0 * * @return bool True if posts are available, false if end of the loop. * @phpstan-impure */ public function have_posts() { } /** * Rewinds the posts and resets post index. * * @since 1.5.0 */ public function rewind_posts() { } /** * Iterates current comment index and returns WP_Comment object. * * @since 2.2.0 * * @return WP_Comment Comment object. */ public function next_comment() { } /** * Sets up the current comment. * * @since 2.2.0 * * @global WP_Comment $comment Global comment object. */ public function the_comment() { } /** * Determines whether there are more comments available. * * Automatically rewinds comments when finished. * * @since 2.2.0 * * @return bool True if comments are available, false if no more comments. */ public function have_comments() { } /** * Rewinds the comments, resets the comment index and comment to first. * * @since 2.2.0 */ public function rewind_comments() { } /** * Sets up the WordPress query by parsing query string. * * @since 1.5.0 * * @see WP_Query::parse_query() for all available arguments. * * @param string|array $query URL query string or array of query arguments. * @return WP_Post[]|int[] Array of post objects or post IDs. */ public function query($query) { } /** * Retrieves the currently queried object. * * If queried object is not set, then the queried object will be set from * the category, tag, taxonomy, posts page, single post, page, or author * query variable. After it is set up, it will be returned. * * @since 1.5.0 * * @return WP_Term|WP_Post_Type|WP_Post|WP_User|null The queried object. */ public function get_queried_object() { } /** * Retrieves the ID of the currently queried object. * * @since 1.5.0 * * @return int */ public function get_queried_object_id() { } /** * Constructor. * * Sets up the WordPress query, if parameter is not empty. * * @since 1.5.0 * * @see WP_Query::parse_query() for all available arguments. * * @param string|array $query URL query string or array of vars. */ public function __construct($query = '') { } /** * Makes private properties readable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to get. * @return mixed Property. */ public function __get($name) { } /** * Makes private properties checkable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to check if set. * @return bool Whether the property is set. */ public function __isset($name) { } /** * Makes private/protected methods readable for backward compatibility. * * @since 4.0.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed|false Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } /** * Determines whether the query is for an existing archive page. * * Archive pages include category, tag, author, date, custom post type, * and custom taxonomy based archives. * * @since 3.1.0 * * @see WP_Query::is_category() * @see WP_Query::is_tag() * @see WP_Query::is_author() * @see WP_Query::is_date() * @see WP_Query::is_post_type_archive() * @see WP_Query::is_tax() * * @return bool Whether the query is for an existing archive page. */ public function is_archive() { } /** * Determines whether the query is for an existing post type archive page. * * @since 3.1.0 * * @param string|string[] $post_types Optional. Post type or array of posts types * to check against. Default empty. * @return bool Whether the query is for an existing post type archive page. */ public function is_post_type_archive($post_types = '') { } /** * Determines whether the query is for an existing attachment page. * * @since 3.1.0 * * @param int|string|int[]|string[] $attachment Optional. Attachment ID, title, slug, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing attachment page. */ public function is_attachment($attachment = '') { } /** * Determines whether the query is for an existing author archive page. * * If the $author parameter is specified, this function will additionally * check if the query is for one of the authors specified. * * @since 3.1.0 * * @param int|string|int[]|string[] $author Optional. User ID, nickname, nicename, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing author archive page. */ public function is_author($author = '') { } /** * Determines whether the query is for an existing category archive page. * * If the $category parameter is specified, this function will additionally * check if the query is for one of the categories specified. * * @since 3.1.0 * * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing category archive page. */ public function is_category($category = '') { } /** * Determines whether the query is for an existing tag archive page. * * If the $tag parameter is specified, this function will additionally * check if the query is for one of the tags specified. * * @since 3.1.0 * * @param int|string|int[]|string[] $tag Optional. Tag ID, name, slug, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing tag archive page. */ public function is_tag($tag = '') { } /** * Determines whether the query is for an existing custom taxonomy archive page. * * If the $taxonomy parameter is specified, this function will additionally * check if the query is for that specific $taxonomy. * * If the $term parameter is specified in addition to the $taxonomy parameter, * this function will additionally check if the query is for one of the terms * specified. * * @since 3.1.0 * * @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies. * * @param string|string[] $taxonomy Optional. Taxonomy slug or slugs to check against. * Default empty. * @param int|string|int[]|string[] $term Optional. Term ID, name, slug, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing custom taxonomy archive page. * True for custom taxonomy archive pages, false for built-in taxonomies * (category and tag archives). */ public function is_tax($taxonomy = '', $term = '') { } /** * Determines whether the current URL is within the comments popup window. * * @since 3.1.0 * @deprecated 4.5.0 * * @return false Always returns false. */ public function is_comments_popup() { } /** * Determines whether the query is for an existing date archive. * * @since 3.1.0 * * @return bool Whether the query is for an existing date archive. */ public function is_date() { } /** * Determines whether the query is for an existing day archive. * * @since 3.1.0 * * @return bool Whether the query is for an existing day archive. */ public function is_day() { } /** * Determines whether the query is for a feed. * * @since 3.1.0 * * @param string|string[] $feeds Optional. Feed type or array of feed types * to check against. Default empty. * @return bool Whether the query is for a feed. */ public function is_feed($feeds = '') { } /** * Determines whether the query is for a comments feed. * * @since 3.1.0 * * @return bool Whether the query is for a comments feed. */ public function is_comment_feed() { } /** * Determines whether the query is for the front page of the site. * * This is for what is displayed at your site's main URL. * * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_on_front'. * * If you set a static page for the front page of your site, this function will return * true when viewing that page. * * Otherwise the same as {@see WP_Query::is_home()}. * * @since 3.1.0 * * @return bool Whether the query is for the front page of the site. */ public function is_front_page() { } /** * Determines whether the query is for the blog homepage. * * This is the page which shows the time based blog content of your site. * * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'. * * If you set a static page for the front page of your site, this function will return * true only on the page you set as the "Posts page". * * @since 3.1.0 * * @see WP_Query::is_front_page() * * @return bool Whether the query is for the blog homepage. */ public function is_home() { } /** * Determines whether the query is for the Privacy Policy page. * * This is the page which shows the Privacy Policy content of your site. * * Depends on the site's "Change your Privacy Policy page" Privacy Settings 'wp_page_for_privacy_policy'. * * This function will return true only on the page you set as the "Privacy Policy page". * * @since 5.2.0 * * @return bool Whether the query is for the Privacy Policy page. */ public function is_privacy_policy() { } /** * Determines whether the query is for an existing month archive. * * @since 3.1.0 * * @return bool Whether the query is for an existing month archive. */ public function is_month() { } /** * Determines whether the query is for an existing single page. * * If the $page parameter is specified, this function will additionally * check if the query is for one of the pages specified. * * @since 3.1.0 * * @see WP_Query::is_single() * @see WP_Query::is_singular() * * @param int|string|int[]|string[] $page Optional. Page ID, title, slug, path, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing single page. */ public function is_page($page = '') { } /** * Determines whether the query is for a paged result and not for the first page. * * @since 3.1.0 * * @return bool Whether the query is for a paged result. */ public function is_paged() { } /** * Determines whether the query is for a post or page preview. * * @since 3.1.0 * * @return bool Whether the query is for a post or page preview. */ public function is_preview() { } /** * Determines whether the query is for the robots.txt file. * * @since 3.1.0 * * @return bool Whether the query is for the robots.txt file. */ public function is_robots() { } /** * Determines whether the query is for the favicon.ico file. * * @since 5.4.0 * * @return bool Whether the query is for the favicon.ico file. */ public function is_favicon() { } /** * Determines whether the query is for a search. * * @since 3.1.0 * * @return bool Whether the query is for a search. */ public function is_search() { } /** * Determines whether the query is for an existing single post. * * Works for any post type excluding pages. * * If the $post parameter is specified, this function will additionally * check if the query is for one of the Posts specified. * * @since 3.1.0 * * @see WP_Query::is_page() * @see WP_Query::is_singular() * * @param int|string|int[]|string[] $post Optional. Post ID, title, slug, path, or array of such * to check against. Default empty. * @return bool Whether the query is for an existing single post. */ public function is_single($post = '') { } /** * Determines whether the query is for an existing single post of any post type * (post, attachment, page, custom post types). * * If the $post_types parameter is specified, this function will additionally * check if the query is for one of the Posts Types specified. * * @since 3.1.0 * * @see WP_Query::is_page() * @see WP_Query::is_single() * * @param string|string[] $post_types Optional. Post type or array of post types * to check against. Default empty. * @return bool Whether the query is for an existing single post * or any of the given post types. */ public function is_singular($post_types = '') { } /** * Determines whether the query is for a specific time. * * @since 3.1.0 * * @return bool Whether the query is for a specific time. */ public function is_time() { } /** * Determines whether the query is for a trackback endpoint call. * * @since 3.1.0 * * @return bool Whether the query is for a trackback endpoint call. */ public function is_trackback() { } /** * Determines whether the query is for an existing year archive. * * @since 3.1.0 * * @return bool Whether the query is for an existing year archive. */ public function is_year() { } /** * Determines whether the query is a 404 (returns no results). * * @since 3.1.0 * * @return bool Whether the query is a 404 error. */ public function is_404() { } /** * Determines whether the query is for an embedded post. * * @since 4.4.0 * * @return bool Whether the query is for an embedded post. */ public function is_embed() { } /** * Determines whether the query is the main query. * * @since 3.3.0 * * @global WP_Query $wp_the_query WordPress Query object. * * @return bool Whether the query is the main query. */ public function is_main_query() { } /** * Sets up global post data. * * @since 4.1.0 * @since 4.4.0 Added the ability to pass a post ID to `$post`. * * @global int $id * @global WP_User $authordata * @global string $currentday * @global string $currentmonth * @global int $page * @global array $pages * @global int $multipage * @global int $more * @global int $numpages * * @param WP_Post|object|int $post WP_Post instance or Post ID/object. * @return true True when finished. */ public function setup_postdata($post) { } /** * Generates post data. * * @since 5.2.0 * * @param WP_Post|object|int $post WP_Post instance or Post ID/object. * @return array|false Elements of post or false on failure. */ public function generate_postdata($post) { } /** * Generates cache key. * * @since 6.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args Query arguments. * @param string $sql SQL statement. * @return string Cache key. */ protected function generate_cache_key(array $args, $sql) { } /** * After looping through a nested query, this function * restores the $post global to the current post in this query. * * @since 3.7.0 * * @global WP_Post $post Global post object. */ public function reset_postdata() { } /** * Lazyloads term meta for posts in the loop. * * @since 4.4.0 * @deprecated 4.5.0 See wp_queue_posts_for_term_meta_lazyload(). * * @param mixed $check * @param int $term_id * @return mixed */ public function lazyload_term_meta($check, $term_id) { } /** * Lazyloads comment meta for comments in the loop. * * @since 4.4.0 * @deprecated 4.5.0 See wp_lazyload_comment_meta(). * * @param mixed $check * @param int $comment_id * @return mixed */ public function lazyload_comment_meta($check, $comment_id) { } } /** * Core class used to set, validate, and clear cookies that identify a Recovery Mode session. * * @since 5.2.0 */ #[\AllowDynamicProperties] final class WP_Recovery_Mode_Cookie_Service { /** * Checks whether the recovery mode cookie is set. * * @since 5.2.0 * * @return bool True if the cookie is set, false otherwise. */ public function is_cookie_set() { } /** * Sets the recovery mode cookie. * * This must be immediately followed by exiting the request. * * @since 5.2.0 */ public function set_cookie() { } /** * Clears the recovery mode cookie. * * @since 5.2.0 */ public function clear_cookie() { } /** * Validates the recovery mode cookie. * * @since 5.2.0 * * @param string $cookie Optionally specify the cookie string. * If omitted, it will be retrieved from the super global. * @return true|WP_Error True on success, error object on failure. */ public function validate_cookie($cookie = '') { } /** * Gets the session identifier from the cookie. * * The cookie should be validated before calling this API. * * @since 5.2.0 * * @param string $cookie Optionally specify the cookie string. * If omitted, it will be retrieved from the super global. * @return string|WP_Error Session ID on success, or error object on failure. */ public function get_session_id_from_cookie($cookie = '') { } } /** * Core class used to send an email with a link to begin Recovery Mode. * * @since 5.2.0 */ #[\AllowDynamicProperties] final class WP_Recovery_Mode_Email_Service { const RATE_LIMIT_OPTION = 'recovery_mode_email_last_sent'; /** * WP_Recovery_Mode_Email_Service constructor. * * @since 5.2.0 * * @param WP_Recovery_Mode_Link_Service $link_service */ public function __construct(\WP_Recovery_Mode_Link_Service $link_service) { } /** * Sends the recovery mode email if the rate limit has not been sent. * * @since 5.2.0 * * @param int $rate_limit Number of seconds before another email can be sent. * @param array $error Error details from `error_get_last()`. * @param array $extension { * The extension that caused the error. * * @type string $slug The extension slug. The plugin or theme's directory. * @type string $type The extension type. Either 'plugin' or 'theme'. * } * @return true|WP_Error True if email sent, WP_Error otherwise. * @phpstan-param array{ * slug?: string, * type?: string, * } $extension */ public function maybe_send_recovery_mode_email($rate_limit, $error, $extension) { } /** * Clears the rate limit, allowing a new recovery mode email to be sent immediately. * * @since 5.2.0 * * @return bool True on success, false on failure. */ public function clear_rate_limit() { } } /** * Core class used to generate and validate keys used to enter Recovery Mode. * * @since 5.2.0 */ #[\AllowDynamicProperties] final class WP_Recovery_Mode_Key_Service { /** * Creates a recovery mode token. * * @since 5.2.0 * * @return string A random string to identify its associated key in storage. */ public function generate_recovery_mode_token() { } /** * Creates a recovery mode key. * * @since 5.2.0 * * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. * * @param string $token A token generated by {@see generate_recovery_mode_token()}. * @return string Recovery mode key. */ public function generate_and_store_recovery_mode_key($token) { } /** * Verifies if the recovery mode key is correct. * * Recovery mode keys can only be used once; the key will be consumed in the process. * * @since 5.2.0 * * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. * * @param string $token The token used when generating the given key. * @param string $key The unhashed key. * @param int $ttl Time in seconds for the key to be valid for. * @return true|WP_Error True on success, error object on failure. */ public function validate_recovery_mode_key($token, $key, $ttl) { } /** * Removes expired recovery mode keys. * * @since 5.2.0 * * @param int $ttl Time in seconds for the keys to be valid for. */ public function clean_expired_keys($ttl) { } } /** * Core class used to generate and handle recovery mode links. * * @since 5.2.0 */ #[\AllowDynamicProperties] class WP_Recovery_Mode_Link_Service { const LOGIN_ACTION_ENTER = 'enter_recovery_mode'; const LOGIN_ACTION_ENTERED = 'entered_recovery_mode'; /** * WP_Recovery_Mode_Link_Service constructor. * * @since 5.2.0 * * @param WP_Recovery_Mode_Cookie_Service $cookie_service Service to handle setting the recovery mode cookie. * @param WP_Recovery_Mode_Key_Service $key_service Service to handle generating recovery mode keys. */ public function __construct(\WP_Recovery_Mode_Cookie_Service $cookie_service, \WP_Recovery_Mode_Key_Service $key_service) { } /** * Generates a URL to begin recovery mode. * * Only one recovery mode URL can may be valid at the same time. * * @since 5.2.0 * * @return string Generated URL. */ public function generate_url() { } /** * Enters recovery mode when the user hits wp-login.php with a valid recovery mode link. * * @since 5.2.0 * * @global string $pagenow The filename of the current screen. * * @param int $ttl Number of seconds the link should be valid for. * @phpstan-return void */ public function handle_begin_link($ttl) { } } /** * Core class used to implement Recovery Mode. * * @since 5.2.0 */ #[\AllowDynamicProperties] class WP_Recovery_Mode { const EXIT_ACTION = 'exit_recovery_mode'; /** * WP_Recovery_Mode constructor. * * @since 5.2.0 */ public function __construct() { } /** * Initialize recovery mode for the current request. * * @since 5.2.0 * @phpstan-return void */ public function initialize() { } /** * Checks whether recovery mode is active. * * This will not change after recovery mode has been initialized. {@see WP_Recovery_Mode::run()}. * * @since 5.2.0 * * @return bool True if recovery mode is active, false otherwise. */ public function is_active() { } /** * Gets the recovery mode session ID. * * @since 5.2.0 * * @return string The session ID if recovery mode is active, empty string otherwise. */ public function get_session_id() { } /** * Checks whether recovery mode has been initialized. * * Recovery mode should not be used until this point. Initialization happens immediately before loading plugins. * * @since 5.2.0 * * @return bool */ public function is_initialized() { } /** * Handles a fatal error occurring. * * The calling API should immediately die() after calling this function. * * @since 5.2.0 * * @param array $error Error details from `error_get_last()`. * @return true|WP_Error True if the error was handled and headers have already been sent. * Or the request will exit to try and catch multiple errors at once. * WP_Error if an error occurred preventing it from being handled. */ public function handle_error(array $error) { } /** * Ends the current recovery mode session. * * @since 5.2.0 * * @return bool True on success, false on failure. */ public function exit_recovery_mode() { } /** * Handles a request to exit Recovery Mode. * * @since 5.2.0 * @phpstan-return void */ public function handle_exit_recovery_mode() { } /** * Cleans any recovery mode keys that have expired according to the link TTL. * * Executes on a daily cron schedule. * * @since 5.2.0 */ public function clean_expired_keys() { } /** * Handles checking for the recovery mode cookie and validating it. * * @since 5.2.0 */ protected function handle_cookie() { } /** * Gets the rate limit between sending new recovery mode email links. * * @since 5.2.0 * * @return int Rate limit in seconds. */ protected function get_email_rate_limit() { } /** * Gets the number of seconds the recovery mode link is valid for. * * @since 5.2.0 * * @return int Interval in seconds. */ protected function get_link_ttl() { } /** * Gets the extension that the error occurred in. * * @since 5.2.0 * * @global array $wp_theme_directories * * @param array $error Error details from `error_get_last()`. * @return array|false { * Extension details. * * @type string $slug The extension slug. This is the plugin or theme's directory. * @type string $type The extension type. Either 'plugin' or 'theme'. * } * @phpstan-return false|array{ * slug: string, * type: string, * } */ protected function get_extension_for_error($error) { } /** * Checks whether the given extension a network activated plugin. * * @since 5.2.0 * * @param array $extension Extension data. * @return bool True if network plugin, false otherwise. */ protected function is_network_plugin($extension) { } /** * Stores the given error so that the extension causing it is paused. * * @since 5.2.0 * * @param array $error Error details from `error_get_last()`. * @return bool True if the error was stored successfully, false otherwise. */ protected function store_error($error) { } /** * Redirects the current request to allow recovering multiple errors in one go. * * The redirection will only happen when on a protected endpoint. * * It must be ensured that this method is only called when an error actually occurred and will not occur on the * next request again. Otherwise it will create a redirect loop. * * @since 5.2.0 * @phpstan-return never */ protected function redirect_protected() { } } /** * Core class used to implement a rewrite component API. * * The WordPress Rewrite class writes the rewrite module rules to the .htaccess * file. It also handles parsing the request to get the correct setup for the * WordPress Query class. * * The Rewrite along with WP class function as a front controller for WordPress. * You can add rules to trigger your page view and processing using this * component. The full functionality of a front controller does not exist, * meaning you can't define how the template files load based on the rewrite * rules. * * @since 1.5.0 */ #[\AllowDynamicProperties] class WP_Rewrite { /** * Permalink structure for posts. * * @since 1.5.0 * @var string */ public $permalink_structure; /** * Whether to add trailing slashes. * * @since 2.2.0 * @var bool */ public $use_trailing_slashes; /** * Base for the author permalink structure (example.com/$author_base/authorname). * * @since 1.5.0 * @var string */ public $author_base = 'author'; /** * Permalink structure for author archives. * * @since 1.5.0 * @var string */ public $author_structure; /** * Permalink structure for date archives. * * @since 1.5.0 * @var string */ public $date_structure; /** * Permalink structure for pages. * * @since 1.5.0 * @var string */ public $page_structure; /** * Base of the search permalink structure (example.com/$search_base/query). * * @since 1.5.0 * @var string */ public $search_base = 'search'; /** * Permalink structure for searches. * * @since 1.5.0 * @var string */ public $search_structure; /** * Comments permalink base. * * @since 1.5.0 * @var string */ public $comments_base = 'comments'; /** * Pagination permalink base. * * @since 3.1.0 * @var string */ public $pagination_base = 'page'; /** * Comments pagination permalink base. * * @since 4.2.0 * @var string */ public $comments_pagination_base = 'comment-page'; /** * Feed permalink base. * * @since 1.5.0 * @var string */ public $feed_base = 'feed'; /** * Comments feed permalink structure. * * @since 1.5.0 * @var string */ public $comment_feed_structure; /** * Feed request permalink structure. * * @since 1.5.0 * @var string */ public $feed_structure; /** * The static portion of the post permalink structure. * * If the permalink structure is "/archive/%post_id%" then the front * is "/archive/". If the permalink structure is "/%year%/%postname%/" * then the front is "/". * * @since 1.5.0 * @var string * * @see WP_Rewrite::init() */ public $front; /** * The prefix for all permalink structures. * * If PATHINFO/index permalinks are in use then the root is the value of * `WP_Rewrite::$index` with a trailing slash appended. Otherwise the root * will be empty. * * @since 1.5.0 * @var string * * @see WP_Rewrite::init() * @see WP_Rewrite::using_index_permalinks() */ public $root = ''; /** * The name of the index file which is the entry point to all requests. * * @since 1.5.0 * @var string */ public $index = 'index.php'; /** * Variable name to use for regex matches in the rewritten query. * * @since 1.5.0 * @var string */ public $matches = ''; /** * Rewrite rules to match against the request to find the redirect or query. * * @since 1.5.0 * @var string[] */ public $rules; /** * Additional rules added external to the rewrite class. * * Those not generated by the class, see add_rewrite_rule(). * * @since 2.1.0 * @var string[] */ public $extra_rules = array(); /** * Additional rules that belong at the beginning to match first. * * Those not generated by the class, see add_rewrite_rule(). * * @since 2.3.0 * @var string[] */ public $extra_rules_top = array(); /** * Rules that don't redirect to WordPress' index.php. * * These rules are written to the mod_rewrite portion of the .htaccess, * and are added by add_external_rule(). * * @since 2.1.0 * @var string[] */ public $non_wp_rules = array(); /** * Extra permalink structures, e.g. categories, added by add_permastruct(). * * @since 2.1.0 * @var array[] */ public $extra_permastructs = array(); /** * Endpoints (like /trackback/) added by add_rewrite_endpoint(). * * @since 2.1.0 * @var array[] */ public $endpoints; /** * Whether to write every mod_rewrite rule for WordPress into the .htaccess file. * * This is off by default, turning it on might print a lot of rewrite rules * to the .htaccess file. * * @since 2.0.0 * @var bool * * @see WP_Rewrite::mod_rewrite_rules() */ public $use_verbose_rules = \false; /** * Could post permalinks be confused with those of pages? * * If the first rewrite tag in the post permalink structure is one that could * also match a page name (e.g. %postname% or %author%) then this flag is * set to true. Prior to WordPress 3.3 this flag indicated that every page * would have a set of rules added to the top of the rewrite rules array. * Now it tells WP::parse_request() to check if a URL matching the page * permastruct is actually a page before accepting it. * * @since 2.5.0 * @var bool * * @see WP_Rewrite::init() */ public $use_verbose_page_rules = \true; /** * Rewrite tags that can be used in permalink structures. * * These are translated into the regular expressions stored in * `WP_Rewrite::$rewritereplace` and are rewritten to the query * variables listed in WP_Rewrite::$queryreplace. * * Additional tags can be added with add_rewrite_tag(). * * @since 1.5.0 * @var string[] */ public $rewritecode = array('%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', '%postname%', '%post_id%', '%author%', '%pagename%', '%search%'); /** * Regular expressions to be substituted into rewrite rules in place * of rewrite tags, see WP_Rewrite::$rewritecode. * * @since 1.5.0 * @var string[] */ public $rewritereplace = array('([0-9]{4})', '([0-9]{1,2})', '([0-9]{1,2})', '([0-9]{1,2})', '([0-9]{1,2})', '([0-9]{1,2})', '([^/]+)', '([0-9]+)', '([^/]+)', '([^/]+?)', '(.+)'); /** * Query variables that rewrite tags map to, see WP_Rewrite::$rewritecode. * * @since 1.5.0 * @var string[] */ public $queryreplace = array('year=', 'monthnum=', 'day=', 'hour=', 'minute=', 'second=', 'name=', 'p=', 'author_name=', 'pagename=', 's='); /** * Supported default feeds. * * @since 1.5.0 * @var string[] */ public $feeds = array('feed', 'rdf', 'rss', 'rss2', 'atom'); /** * Determines whether permalinks are being used. * * This can be either rewrite module or permalink in the HTTP query string. * * @since 1.5.0 * * @return bool True, if permalinks are enabled. */ public function using_permalinks() { } /** * Determines whether permalinks are being used and rewrite module is not enabled. * * Means that permalink links are enabled and index.php is in the URL. * * @since 1.5.0 * * @return bool Whether permalink links are enabled and index.php is in the URL. */ public function using_index_permalinks() { } /** * Determines whether permalinks are being used and rewrite module is enabled. * * Using permalinks and index.php is not in the URL. * * @since 1.5.0 * * @return bool Whether permalink links are enabled and index.php is NOT in the URL. */ public function using_mod_rewrite_permalinks() { } /** * Indexes for matches for usage in preg_*() functions. * * The format of the string is, with empty matches property value, '$NUM'. * The 'NUM' will be replaced with the value in the $number parameter. With * the matches property not empty, the value of the returned string will * contain that value of the matches property. The format then will be * '$MATCHES[NUM]', with MATCHES as the value in the property and NUM the * value of the $number parameter. * * @since 1.5.0 * * @param int $number Index number. * @return string */ public function preg_index($number) { } /** * Retrieves all pages and attachments for pages URIs. * * The attachments are for those that have pages as parents and will be * retrieved. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return array Array of page URIs as first element and attachment URIs as second element. */ public function page_uri_index() { } /** * Retrieves all of the rewrite rules for pages. * * @since 1.5.0 * * @return string[] Page rewrite rules. */ public function page_rewrite_rules() { } /** * Retrieves date permalink structure, with year, month, and day. * * The permalink structure for the date, if not set already depends on the * permalink structure. It can be one of three formats. The first is year, * month, day; the second is day, month, year; and the last format is month, * day, year. These are matched against the permalink structure for which * one is used. If none matches, then the default will be used, which is * year, month, day. * * Prevents post ID and date permalinks from overlapping. In the case of * post_id, the date permalink will be prepended with front permalink with * 'date/' before the actual permalink to form the complete date permalink * structure. * * @since 1.5.0 * * @return string|false Date permalink structure on success, false on failure. */ public function get_date_permastruct() { } /** * Retrieves the year permalink structure without month and day. * * Gets the date permalink structure and strips out the month and day * permalink structures. * * @since 1.5.0 * * @return string|false Year permalink structure on success, false on failure. */ public function get_year_permastruct() { } /** * Retrieves the month permalink structure without day and with year. * * Gets the date permalink structure and strips out the day permalink * structures. Keeps the year permalink structure. * * @since 1.5.0 * * @return string|false Year/Month permalink structure on success, false on failure. */ public function get_month_permastruct() { } /** * Retrieves the day permalink structure with month and year. * * Keeps date permalink structure with all year, month, and day. * * @since 1.5.0 * * @return string|false Year/Month/Day permalink structure on success, false on failure. */ public function get_day_permastruct() { } /** * Retrieves the permalink structure for categories. * * If the category_base property has no value, then the category structure * will have the front property value, followed by 'category', and finally * '%category%'. If it does, then the root property will be used, along with * the category_base property value. * * @since 1.5.0 * * @return string|false Category permalink structure on success, false on failure. */ public function get_category_permastruct() { } /** * Retrieves the permalink structure for tags. * * If the tag_base property has no value, then the tag structure will have * the front property value, followed by 'tag', and finally '%tag%'. If it * does, then the root property will be used, along with the tag_base * property value. * * @since 2.3.0 * * @return string|false Tag permalink structure on success, false on failure. */ public function get_tag_permastruct() { } /** * Retrieves an extra permalink structure by name. * * @since 2.5.0 * * @param string $name Permalink structure name. * @return string|false Permalink structure string on success, false on failure. */ public function get_extra_permastruct($name) { } /** * Retrieves the author permalink structure. * * The permalink structure is front property, author base, and finally * '/%author%'. Will set the author_structure property and then return it * without attempting to set the value again. * * @since 1.5.0 * * @return string|false Author permalink structure on success, false on failure. */ public function get_author_permastruct() { } /** * Retrieves the search permalink structure. * * The permalink structure is root property, search base, and finally * '/%search%'. Will set the search_structure property and then return it * without attempting to set the value again. * * @since 1.5.0 * * @return string|false Search permalink structure on success, false on failure. */ public function get_search_permastruct() { } /** * Retrieves the page permalink structure. * * The permalink structure is root property, and '%pagename%'. Will set the * page_structure property and then return it without attempting to set the * value again. * * @since 1.5.0 * * @return string|false Page permalink structure on success, false on failure. */ public function get_page_permastruct() { } /** * Retrieves the feed permalink structure. * * The permalink structure is root property, feed base, and finally * '/%feed%'. Will set the feed_structure property and then return it * without attempting to set the value again. * * @since 1.5.0 * * @return string|false Feed permalink structure on success, false on failure. */ public function get_feed_permastruct() { } /** * Retrieves the comment feed permalink structure. * * The permalink structure is root property, comment base property, feed * base and finally '/%feed%'. Will set the comment_feed_structure property * and then return it without attempting to set the value again. * * @since 1.5.0 * * @return string|false Comment feed permalink structure on success, false on failure. */ public function get_comment_feed_permastruct() { } /** * Adds or updates existing rewrite tags (e.g. %postname%). * * If the tag already exists, replace the existing pattern and query for * that tag, otherwise add the new tag. * * @since 1.5.0 * * @see WP_Rewrite::$rewritecode * @see WP_Rewrite::$rewritereplace * @see WP_Rewrite::$queryreplace * * @param string $tag Name of the rewrite tag to add or update. * @param string $regex Regular expression to substitute the tag for in rewrite rules. * @param string $query String to append to the rewritten query. Must end in '='. */ public function add_rewrite_tag($tag, $regex, $query) { } /** * Removes an existing rewrite tag. * * @since 4.5.0 * * @see WP_Rewrite::$rewritecode * @see WP_Rewrite::$rewritereplace * @see WP_Rewrite::$queryreplace * * @param string $tag Name of the rewrite tag to remove. */ public function remove_rewrite_tag($tag) { } /** * Generates rewrite rules from a permalink structure. * * The main WP_Rewrite function for building the rewrite rule list. The * contents of the function is a mix of black magic and regular expressions, * so best just ignore the contents and move to the parameters. * * @since 1.5.0 * * @param string $permalink_structure The permalink structure. * @param int $ep_mask Optional. Endpoint mask defining what endpoints are added to the structure. * Accepts a mask of: * - `EP_ALL` * - `EP_NONE` * - `EP_ALL_ARCHIVES` * - `EP_ATTACHMENT` * - `EP_AUTHORS` * - `EP_CATEGORIES` * - `EP_COMMENTS` * - `EP_DATE` * - `EP_DAY` * - `EP_MONTH` * - `EP_PAGES` * - `EP_PERMALINK` * - `EP_ROOT` * - `EP_SEARCH` * - `EP_TAGS` * - `EP_YEAR` * Default `EP_NONE`. * @param bool $paged Optional. Whether archive pagination rules should be added for the structure. * Default true. * @param bool $feed Optional. Whether feed rewrite rules should be added for the structure. * Default true. * @param bool $forcomments Optional. Whether the feed rules should be a query for a comments feed. * Default false. * @param bool $walk_dirs Optional. Whether the 'directories' making up the structure should be walked * over and rewrite rules built for each in-turn. Default true. * @param bool $endpoints Optional. Whether endpoints should be applied to the generated rewrite rules. * Default true. * @return string[] Array of rewrite rules keyed by their regex pattern. */ public function generate_rewrite_rules($permalink_structure, $ep_mask = \EP_NONE, $paged = \true, $feed = \true, $forcomments = \false, $walk_dirs = \true, $endpoints = \true) { } /** * Generates rewrite rules with permalink structure and walking directory only. * * Shorten version of WP_Rewrite::generate_rewrite_rules() that allows for shorter * list of parameters. See the method for longer description of what generating * rewrite rules does. * * @since 1.5.0 * * @see WP_Rewrite::generate_rewrite_rules() See for long description and rest of parameters. * * @param string $permalink_structure The permalink structure to generate rules. * @param bool $walk_dirs Optional. Whether to create list of directories to walk over. * Default false. * @return array An array of rewrite rules keyed by their regex pattern. */ public function generate_rewrite_rule($permalink_structure, $walk_dirs = \false) { } /** * Constructs rewrite matches and queries from permalink structure. * * Runs the action {@see 'generate_rewrite_rules'} with the parameter that is an * reference to the current WP_Rewrite instance to further manipulate the * permalink structures and rewrite rules. Runs the {@see 'rewrite_rules_array'} * filter on the full rewrite rule array. * * There are two ways to manipulate the rewrite rules, one by hooking into * the {@see 'generate_rewrite_rules'} action and gaining full control of the * object or just manipulating the rewrite rule array before it is passed * from the function. * * @since 1.5.0 * * @return string[] An associative array of matches and queries. */ public function rewrite_rules() { } /** * Retrieves the rewrite rules. * * The difference between this method and WP_Rewrite::rewrite_rules() is that * this method stores the rewrite rules in the 'rewrite_rules' option and retrieves * it. This prevents having to process all of the permalinks to get the rewrite rules * in the form of caching. * * @since 1.5.0 * * @return string[] Array of rewrite rules keyed by their regex pattern. */ public function wp_rewrite_rules() { } /** * Retrieves mod_rewrite-formatted rewrite rules to write to .htaccess. * * Does not actually write to the .htaccess file, but creates the rules for * the process that will. * * Will add the non_wp_rules property rules to the .htaccess file before * the WordPress rewrite rules one. * * @since 1.5.0 * * @return string */ public function mod_rewrite_rules() { } /** * Retrieves IIS7 URL Rewrite formatted rewrite rules to write to web.config file. * * Does not actually write to the web.config file, but creates the rules for * the process that will. * * @since 2.8.0 * * @param bool $add_parent_tags Optional. Whether to add parent tags to the rewrite rule sets. * Default false. * @return string IIS7 URL rewrite rule sets. */ public function iis7_url_rewrite_rules($add_parent_tags = \false) { } /** * Adds a rewrite rule that transforms a URL structure to a set of query vars. * * Any value in the $after parameter that isn't 'bottom' will result in the rule * being placed at the top of the rewrite rules. * * @since 2.1.0 * @since 4.4.0 Array support was added to the `$query` parameter. * * @param string $regex Regular expression to match request against. * @param string|array $query The corresponding query vars for this rewrite rule. * @param string $after Optional. Priority of the new rule. Accepts 'top' * or 'bottom'. Default 'bottom'. * @phpstan-param 'top'|'bottom' $after */ public function add_rule($regex, $query, $after = 'bottom') { } /** * Adds a rewrite rule that doesn't correspond to index.php. * * @since 2.1.0 * * @param string $regex Regular expression to match request against. * @param string $query The corresponding query vars for this rewrite rule. */ public function add_external_rule($regex, $query) { } /** * Adds an endpoint, like /trackback/. * * @since 2.1.0 * @since 3.9.0 $query_var parameter added. * @since 4.3.0 Added support for skipping query var registration by passing `false` to `$query_var`. * * @see add_rewrite_endpoint() for full documentation. * @global WP $wp Current WordPress environment instance. * * @param string $name Name of the endpoint. * @param int $places Endpoint mask describing the places the endpoint should be added. * Accepts a mask of: * - `EP_ALL` * - `EP_NONE` * - `EP_ALL_ARCHIVES` * - `EP_ATTACHMENT` * - `EP_AUTHORS` * - `EP_CATEGORIES` * - `EP_COMMENTS` * - `EP_DATE` * - `EP_DAY` * - `EP_MONTH` * - `EP_PAGES` * - `EP_PERMALINK` * - `EP_ROOT` * - `EP_SEARCH` * - `EP_TAGS` * - `EP_YEAR` * @param string|bool $query_var Optional. Name of the corresponding query variable. Pass `false` to * skip registering a query_var for this endpoint. Defaults to the * value of `$name`. */ public function add_endpoint($name, $places, $query_var = \true) { } /** * Adds a new permalink structure. * * A permalink structure (permastruct) is an abstract definition of a set of rewrite rules; * it is an easy way of expressing a set of regular expressions that rewrite to a set of * query strings. The new permastruct is added to the WP_Rewrite::$extra_permastructs array. * * When the rewrite rules are built by WP_Rewrite::rewrite_rules(), all of these extra * permastructs are passed to WP_Rewrite::generate_rewrite_rules() which transforms them * into the regular expressions that many love to hate. * * The `$args` parameter gives you control over how WP_Rewrite::generate_rewrite_rules() * works on the new permastruct. * * @since 2.5.0 * * @param string $name Name for permalink structure. * @param string $struct Permalink structure (e.g. category/%category%) * @param array $args { * Optional. Arguments for building rewrite rules based on the permalink structure. * Default empty array. * * @type bool $with_front Whether the structure should be prepended with `WP_Rewrite::$front`. * Default true. * @type int $ep_mask The endpoint mask defining which endpoints are added to the structure. * Accepts a mask of: * - `EP_ALL` * - `EP_NONE` * - `EP_ALL_ARCHIVES` * - `EP_ATTACHMENT` * - `EP_AUTHORS` * - `EP_CATEGORIES` * - `EP_COMMENTS` * - `EP_DATE` * - `EP_DAY` * - `EP_MONTH` * - `EP_PAGES` * - `EP_PERMALINK` * - `EP_ROOT` * - `EP_SEARCH` * - `EP_TAGS` * - `EP_YEAR` * Default `EP_NONE`. * @type bool $paged Whether archive pagination rules should be added for the structure. * Default true. * @type bool $feed Whether feed rewrite rules should be added for the structure. Default true. * @type bool $forcomments Whether the feed rules should be a query for a comments feed. Default false. * @type bool $walk_dirs Whether the 'directories' making up the structure should be walked over * and rewrite rules built for each in-turn. Default true. * @type bool $endpoints Whether endpoints should be applied to the generated rules. Default true. * } * @phpstan-param array{ * with_front?: bool, * ep_mask?: int, * paged?: bool, * feed?: bool, * forcomments?: bool, * walk_dirs?: bool, * endpoints?: bool, * } $args */ public function add_permastruct($name, $struct, $args = array()) { } /** * Removes a permalink structure. * * @since 4.5.0 * * @param string $name Name for permalink structure. */ public function remove_permastruct($name) { } /** * Removes rewrite rules and then recreate rewrite rules. * * Calls WP_Rewrite::wp_rewrite_rules() after removing the 'rewrite_rules' option. * If the function named 'save_mod_rewrite_rules' exists, it will be called. * * @since 2.0.1 * * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard). * @phpstan-return void */ public function flush_rules($hard = \true) { } /** * Sets up the object's properties. * * The 'use_verbose_page_rules' object property will be set to true if the * permalink structure begins with one of the following: '%postname%', '%category%', * '%tag%', or '%author%'. * * @since 1.5.0 */ public function init() { } /** * Sets the main permalink structure for the site. * * Will update the 'permalink_structure' option, if there is a difference * between the current permalink structure and the parameter value. Calls * WP_Rewrite::init() after the option is updated. * * Fires the {@see 'permalink_structure_changed'} action once the init call has * processed passing the old and new values * * @since 1.5.0 * * @param string $permalink_structure Permalink structure. */ public function set_permalink_structure($permalink_structure) { } /** * Sets the category base for the category permalink. * * Will update the 'category_base' option, if there is a difference between * the current category base and the parameter value. Calls WP_Rewrite::init() * after the option is updated. * * @since 1.5.0 * * @param string $category_base Category permalink structure base. */ public function set_category_base($category_base) { } /** * Sets the tag base for the tag permalink. * * Will update the 'tag_base' option, if there is a difference between the * current tag base and the parameter value. Calls WP_Rewrite::init() after * the option is updated. * * @since 2.3.0 * * @param string $tag_base Tag permalink structure base. */ public function set_tag_base($tag_base) { } /** * Constructor - Calls init(), which runs setup. * * @since 1.5.0 */ public function __construct() { } } /** * Core class used to extend the user roles API. * * @since 2.0.0 */ #[\AllowDynamicProperties] class WP_Role { /** * Role name. * * @since 2.0.0 * @var string */ public $name; /** * List of capabilities the role contains. * * @since 2.0.0 * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values * represent whether the role has that capability. */ public $capabilities; /** * Constructor - Set up object properties. * * The list of capabilities must have the key as the name of the capability * and the value a boolean of whether it is granted to the role. * * @since 2.0.0 * * @param string $role Role name. * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values * represent whether the role has that capability. */ public function __construct($role, $capabilities) { } /** * Assign role a capability. * * @since 2.0.0 * * @param string $cap Capability name. * @param bool $grant Whether role has capability privilege. */ public function add_cap($cap, $grant = \true) { } /** * Removes a capability from a role. * * @since 2.0.0 * * @param string $cap Capability name. */ public function remove_cap($cap) { } /** * Determines whether the role has the given capability. * * @since 2.0.0 * * @param string $cap Capability name. * @return bool Whether the role has the given capability. */ public function has_cap($cap) { } } /** * Core class used to implement a user roles API. * * The role option is simple, the structure is organized by role name that store * the name in value of the 'name' key. The capabilities are stored as an array * in the value of the 'capability' key. * * array ( * 'rolename' => array ( * 'name' => 'rolename', * 'capabilities' => array() * ) * ) * * @since 2.0.0 */ #[\AllowDynamicProperties] class WP_Roles { /** * List of roles and capabilities. * * @since 2.0.0 * @var array[] */ public $roles; /** * List of the role objects. * * @since 2.0.0 * @var WP_Role[] */ public $role_objects = array(); /** * List of role names. * * @since 2.0.0 * @var string[] */ public $role_names = array(); /** * Option name for storing role list. * * @since 2.0.0 * @var string */ public $role_key; /** * Whether to use the database for retrieval and storage. * * @since 2.1.0 * @var bool */ public $use_db = \true; /** * The site ID the roles are initialized for. * * @since 4.9.0 * @var int */ protected $site_id = 0; /** * Constructor. * * @since 2.0.0 * @since 4.9.0 The `$site_id` argument was added. * * @global array $wp_user_roles Used to set the 'roles' property value. * * @param int $site_id Site ID to initialize roles for. Default is the current site. */ public function __construct($site_id = \null) { } /** * Makes private/protected methods readable for backward compatibility. * * @since 4.0.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed|false Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } /** * Sets up the object properties. * * The role key is set to the current prefix for the $wpdb object with * 'user_roles' appended. If the $wp_user_roles global is set, then it will * be used and the role option will not be updated or used. * * @since 2.1.0 * @deprecated 4.9.0 Use WP_Roles::for_site() */ protected function _init() { } /** * Reinitializes the object. * * Recreates the role objects. This is typically called only by switch_to_blog() * after switching wpdb to a new site ID. * * @since 3.5.0 * @deprecated 4.7.0 Use WP_Roles::for_site() */ public function reinit() { } /** * Adds a role name with capabilities to the list. * * Updates the list of roles, if the role doesn't already exist. * * The capabilities are defined in the following format: `array( 'read' => true )`. * To explicitly deny the role a capability, set the value for that capability to false. * * @since 2.0.0 * * @param string $role Role name. * @param string $display_name Role display name. * @param bool[] $capabilities Optional. List of capabilities keyed by the capability name, * e.g. `array( 'edit_posts' => true, 'delete_posts' => false )`. * Default empty array. * @return WP_Role|void WP_Role object, if the role is added. */ public function add_role($role, $display_name, $capabilities = array()) { } /** * Removes a role by name. * * @since 2.0.0 * * @param string $role Role name. * @phpstan-return void */ public function remove_role($role) { } /** * Adds a capability to role. * * @since 2.0.0 * * @param string $role Role name. * @param string $cap Capability name. * @param bool $grant Optional. Whether role is capable of performing capability. * Default true. * @phpstan-return void */ public function add_cap($role, $cap, $grant = \true) { } /** * Removes a capability from role. * * @since 2.0.0 * * @param string $role Role name. * @param string $cap Capability name. * @phpstan-return void */ public function remove_cap($role, $cap) { } /** * Retrieves a role object by name. * * @since 2.0.0 * * @param string $role Role name. * @return WP_Role|null WP_Role object if found, null if the role does not exist. */ public function get_role($role) { } /** * Retrieves a list of role names. * * @since 2.0.0 * * @return string[] List of role names. */ public function get_names() { } /** * Determines whether a role name is currently in the list of available roles. * * @since 2.0.0 * * @param string $role Role name to look up. * @return bool */ public function is_role($role) { } /** * Initializes all of the available roles. * * @since 4.9.0 * @phpstan-return void */ public function init_roles() { } /** * Sets the site to operate on. Defaults to the current site. * * @since 4.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $site_id Site ID to initialize roles for. Default is the current site. * @phpstan-return void */ public function for_site($site_id = \null) { } /** * Gets the ID of the site for which roles are currently initialized. * * @since 4.9.0 * * @return int Site ID. */ public function get_site_id() { } /** * Gets the available roles data. * * @since 4.9.0 * * @global array $wp_user_roles Used to set the 'roles' property value. * * @return array Roles array. */ protected function get_roles_data() { } } /** * Core class used to register script modules. * * @since 6.5.0 */ class WP_Script_Modules { /** * Registers the script module if no script module with that script module * identifier has already been registered. * * @since 6.5.0 * * @param string $id The identifier of the script module. Should be unique. It will be used in the * final import map. * @param string $src Optional. Full URL of the script module, or path of the script module relative * to the WordPress root directory. If it is provided and the script module has * not been registered yet, it will be registered. * @param array $deps { * Optional. List of dependencies. * * @type string|array ...$0 { * An array of script module identifiers of the dependencies of this script * module. The dependencies can be strings or arrays. If they are arrays, * they need an `id` key with the script module identifier, and can contain * an `import` key with either `static` or `dynamic`. By default, * dependencies that don't contain an `import` key are considered static. * * @type string $id The script module identifier. * @type string $import Optional. Import type. May be either `static` or * `dynamic`. Defaults to `static`. * } * } * @param string|false|null $version Optional. String specifying the script module version number. Defaults to false. * It is added to the URL as a query string for cache busting purposes. If $version * is set to false, the version number is the currently installed WordPress version. * If $version is set to null, no version is added. * @phpstan-param array<int|string, array{ * id: string, * import?: string, * }> $deps */ public function register(string $id, string $src, array $deps = array(), $version = \false) { } /** * Marks the script module to be enqueued in the page. * * If a src is provided and the script module has not been registered yet, it * will be registered. * * @since 6.5.0 * * @param string $id The identifier of the script module. Should be unique. It will be used in the * final import map. * @param string $src Optional. Full URL of the script module, or path of the script module relative * to the WordPress root directory. If it is provided and the script module has * not been registered yet, it will be registered. * @param array $deps { * Optional. List of dependencies. * * @type string|array ...$0 { * An array of script module identifiers of the dependencies of this script * module. The dependencies can be strings or arrays. If they are arrays, * they need an `id` key with the script module identifier, and can contain * an `import` key with either `static` or `dynamic`. By default, * dependencies that don't contain an `import` key are considered static. * * @type string $id The script module identifier. * @type string $import Optional. Import type. May be either `static` or * `dynamic`. Defaults to `static`. * } * } * @param string|false|null $version Optional. String specifying the script module version number. Defaults to false. * It is added to the URL as a query string for cache busting purposes. If $version * is set to false, the version number is the currently installed WordPress version. * If $version is set to null, no version is added. * @phpstan-param array<int|string, array{ * id: string, * import?: string, * }> $deps */ public function enqueue(string $id, string $src = '', array $deps = array(), $version = \false) { } /** * Unmarks the script module so it will no longer be enqueued in the page. * * @since 6.5.0 * * @param string $id The identifier of the script module. */ public function dequeue(string $id) { } /** * Removes a registered script module. * * @since 6.5.0 * * @param string $id The identifier of the script module. */ public function deregister(string $id) { } /** * Adds the hooks to print the import map, enqueued script modules and script * module preloads. * * In classic themes, the script modules used by the blocks are not yet known * when the `wp_head` actions is fired, so it needs to print everything in the * footer. * * @since 6.5.0 */ public function add_hooks() { } /** * Prints the enqueued script modules using script tags with type="module" * attributes. * * @since 6.5.0 */ public function print_enqueued_script_modules() { } /** * Prints the the static dependencies of the enqueued script modules using * link tags with rel="modulepreload" attributes. * * If a script module is marked for enqueue, it will not be preloaded. * * @since 6.5.0 */ public function print_script_module_preloads() { } /** * Prints the import map using a script tag with a type="importmap" attribute. * * @since 6.5.0 */ public function print_import_map() { } /** * Print data associated with Script Modules. * * The data will be embedded in the page HTML and can be read by Script Modules on page load. * * @since 6.7.0 * * Data can be associated with a Script Module via the * {@see "script_module_data_{$module_id}"} filter. * * The data for a Script Module will be serialized as JSON in a script tag with an ID of the * form `wp-script-module-data-{$module_id}`. */ public function print_script_module_data() : void { } /** * @access private This is only intended to be called by the registered actions. * * @since 6.7.0 * @phpstan-return void */ public function print_a11y_script_module_html() { } } /** * Core class used to register scripts. * * @since 2.1.0 * * @see WP_Dependencies */ class WP_Scripts extends \WP_Dependencies { /** * Base URL for scripts. * * Full URL with trailing slash. * * @since 2.6.0 * @var string */ public $base_url; /** * URL of the content directory. * * @since 2.8.0 * @var string */ public $content_url; /** * Default version string for scripts. * * @since 2.6.0 * @var string */ public $default_version; /** * Holds handles of scripts which are enqueued in footer. * * @since 2.8.0 * @var array */ public $in_footer = array(); /** * Holds a list of script handles which will be concatenated. * * @since 2.8.0 * @var string */ public $concat = ''; /** * Holds a string which contains script handles and their version. * * @since 2.8.0 * @deprecated 3.4.0 * @var string */ public $concat_version = ''; /** * Whether to perform concatenation. * * @since 2.8.0 * @var bool */ public $do_concat = \false; /** * Holds HTML markup of scripts and additional data if concatenation * is enabled. * * @since 2.8.0 * @var string */ public $print_html = ''; /** * Holds inline code if concatenation is enabled. * * @since 2.8.0 * @var string */ public $print_code = ''; /** * Holds a list of script handles which are not in the default directory * if concatenation is enabled. * * Unused in core. * * @since 2.8.0 * @var string */ public $ext_handles = ''; /** * Holds a string which contains handles and versions of scripts which * are not in the default directory if concatenation is enabled. * * Unused in core. * * @since 2.8.0 * @var string */ public $ext_version = ''; /** * List of default directories. * * @since 2.8.0 * @var array */ public $default_dirs; /** * Constructor. * * @since 2.6.0 */ public function __construct() { } /** * Initialize the class. * * @since 3.4.0 */ public function init() { } /** * Prints scripts. * * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies. * * @since 2.1.0 * @since 2.8.0 Added the `$group` parameter. * * @param string|string[]|false $handles Optional. Scripts to be printed: queue (false), * single script (string), or multiple scripts (array of strings). * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return string[] Handles of scripts that have been printed. */ public function print_scripts($handles = \false, $group = \false) { } /** * Prints extra scripts of a registered script. * * @since 2.1.0 * @since 2.8.0 Added the `$display` parameter. * @deprecated 3.3.0 * * @see print_extra_script() * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_scripts_l10n($handle, $display = \true) { } /** * Prints extra scripts of a registered script. * * @since 3.3.0 * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_extra_script($handle, $display = \true) { } /** * Processes a script dependency. * * @since 2.6.0 * @since 2.8.0 Added the `$group` parameter. * * @see WP_Dependencies::do_item() * * @param string $handle The script's registered handle. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function do_item($handle, $group = \false) { } /** * Adds extra code to a registered script. * * @since 4.5.0 * * @param string $handle Name of the script to add the inline script to. * Must be lowercase. * @param string $data String containing the JavaScript to be added. * @param string $position Optional. Whether to add the inline script * before the handle or after. Default 'after'. * @return bool True on success, false on failure. */ public function add_inline_script($handle, $data, $position = 'after') { } /** * Prints inline scripts registered for a specific handle. * * @since 4.5.0 * @deprecated 6.3.0 Use methods get_inline_script_tag() or get_inline_script_data() instead. * * @param string $handle Name of the script to print inline scripts for. * Must be lowercase. * @param string $position Optional. Whether to add the inline script * before the handle or after. Default 'after'. * @param bool $display Optional. Whether to print the script tag * instead of just returning the script data. Default true. * @return string|false Script data on success, false otherwise. */ public function print_inline_script($handle, $position = 'after', $display = \true) { } /** * Gets data for inline scripts registered for a specific handle. * * @since 6.3.0 * * @param string $handle Name of the script to get data for. * Must be lowercase. * @param string $position Optional. Whether to add the inline script * before the handle or after. Default 'after'. * @return string Inline script, which may be empty string. */ public function get_inline_script_data($handle, $position = 'after') { } /** * Gets tags for inline scripts registered for a specific handle. * * @since 6.3.0 * * @param string $handle Name of the script to get associated inline script tag for. * Must be lowercase. * @param string $position Optional. Whether to get tag for inline * scripts in the before or after position. Default 'after'. * @return string Inline script, which may be empty string. */ public function get_inline_script_tag($handle, $position = 'after') { } /** * Localizes a script, only if the script has already been added. * * @since 2.1.0 * * @param string $handle Name of the script to attach data to. * @param string $object_name Name of the variable that will contain the data. * @param array $l10n Array of data to localize. * @return bool True on success, false on failure. */ public function localize($handle, $object_name, $l10n) { } /** * Sets handle group. * * @since 2.8.0 * * @see WP_Dependencies::set_group() * * @param string $handle Name of the item. Should be unique. * @param bool $recursion Internal flag that calling function was called recursively. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool Not already in the group or a lower group. */ public function set_group($handle, $recursion, $group = \false) { } /** * Sets a translation textdomain. * * @since 5.0.0 * @since 5.1.0 The `$domain` parameter was made optional. * * @param string $handle Name of the script to register a translation domain to. * @param string $domain Optional. Text domain. Default 'default'. * @param string $path Optional. The full file path to the directory containing translation files. * @return bool True if the text domain was registered, false if not. */ public function set_translations($handle, $domain = 'default', $path = '') { } /** * Prints translations set for a specific handle. * * @since 5.0.0 * * @param string $handle Name of the script to add the inline script to. * Must be lowercase. * @param bool $display Optional. Whether to print the script * instead of just returning it. Default true. * @return string|false Script on success, false otherwise. */ public function print_translations($handle, $display = \true) { } /** * Determines script dependencies. * * @since 2.1.0 * * @see WP_Dependencies::all_deps() * * @param string|string[] $handles Item handle (string) or item handles (array of strings). * @param bool $recursion Optional. Internal flag that function is calling itself. * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function all_deps($handles, $recursion = \false, $group = \false) { } /** * Processes items and dependencies for the head group. * * @since 2.8.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_head_items() { } /** * Processes items and dependencies for the footer group. * * @since 2.8.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_footer_items() { } /** * Whether a handle's source is in a default directory. * * @since 2.8.0 * * @param string $src The source of the enqueued script. * @return bool True if found, false if not. */ public function in_default_dir($src) { } /** * This overrides the add_data method from WP_Dependencies, to support normalizing of $args. * * @since 6.3.0 * * @param string $handle Name of the item. Should be unique. * @param string $key The data key. * @param mixed $value The data value. * @return bool True on success, false on failure. */ public function add_data($handle, $key, $value) { } /** * Resets class properties. * * @since 2.8.0 */ public function reset() { } } /** * Abstract class for managing user session tokens. * * @since 4.0.0 */ #[\AllowDynamicProperties] abstract class WP_Session_Tokens { /** * User ID. * * @since 4.0.0 * @var int User ID. */ protected $user_id; /** * Protected constructor. Use the `get_instance()` method to get the instance. * * @since 4.0.0 * * @param int $user_id User whose session to manage. */ protected function __construct($user_id) { } /** * Retrieves a session manager instance for a user. * * This method contains a {@see 'session_token_manager'} filter, allowing a plugin to swap out * the session manager for a subclass of `WP_Session_Tokens`. * * @since 4.0.0 * * @param int $user_id User whose session to manage. * @return WP_Session_Tokens The session object, which is by default an instance of * the `WP_User_Meta_Session_Tokens` class. */ public static final function get_instance($user_id) { } /** * Retrieves a user's session for the given token. * * @since 4.0.0 * * @param string $token Session token. * @return array|null The session, or null if it does not exist. */ public final function get($token) { } /** * Validates the given session token for authenticity and validity. * * Checks that the given token is present and hasn't expired. * * @since 4.0.0 * * @param string $token Token to verify. * @return bool Whether the token is valid for the user. */ public final function verify($token) { } /** * Generates a session token and attaches session information to it. * * A session token is a long, random string. It is used in a cookie * to link that cookie to an expiration time and to ensure the cookie * becomes invalidated when the user logs out. * * This function generates a token and stores it with the associated * expiration time (and potentially other session information via the * {@see 'attach_session_information'} filter). * * @since 4.0.0 * * @param int $expiration Session expiration timestamp. * @return string Session token. */ public final function create($expiration) { } /** * Updates the data for the session with the given token. * * @since 4.0.0 * * @param string $token Session token to update. * @param array $session Session information. */ public final function update($token, $session) { } /** * Destroys the session with the given token. * * @since 4.0.0 * * @param string $token Session token to destroy. */ public final function destroy($token) { } /** * Destroys all sessions for this user except the one with the given token (presumably the one in use). * * @since 4.0.0 * * @param string $token_to_keep Session token to keep. */ public final function destroy_others($token_to_keep) { } /** * Determines whether a session is still valid, based on its expiration timestamp. * * @since 4.0.0 * * @param array $session Session to check. * @return bool Whether session is valid. */ protected final function is_still_valid($session) { } /** * Destroys all sessions for a user. * * @since 4.0.0 */ public final function destroy_all() { } /** * Destroys all sessions for all users. * * @since 4.0.0 */ public static final function destroy_all_for_all_users() { } /** * Retrieves all sessions for a user. * * @since 4.0.0 * * @return array Sessions for a user. */ public final function get_all() { } /** * Retrieves all sessions of the user. * * @since 4.0.0 * * @return array Sessions of the user. */ protected abstract function get_sessions(); /** * Retrieves a session based on its verifier (token hash). * * @since 4.0.0 * * @param string $verifier Verifier for the session to retrieve. * @return array|null The session, or null if it does not exist. */ protected abstract function get_session($verifier); /** * Updates a session based on its verifier (token hash). * * Omitting the second argument destroys the session. * * @since 4.0.0 * * @param string $verifier Verifier for the session to update. * @param array $session Optional. Session. Omitting this argument destroys the session. */ protected abstract function update_session($verifier, $session = \null); /** * Destroys all sessions for this user, except the single session with the given verifier. * * @since 4.0.0 * * @param string $verifier Verifier of the session to keep. */ protected abstract function destroy_other_sessions($verifier); /** * Destroys all sessions for the user. * * @since 4.0.0 */ protected abstract function destroy_all_sessions(); /** * Destroys all sessions for all users. * * @since 4.0.0 */ public static function drop_sessions() { } } /** * Core class for fetching remote files and reading local files with SimplePie. * * This uses Core's HTTP API to make requests, which gives plugins the ability * to hook into the process. * * @since 2.8.0 */ #[\AllowDynamicProperties] class WP_SimplePie_File extends \SimplePie\File { /** * Timeout. * * @var int How long the connection should stay open in seconds. */ public $timeout = 10; /** * Constructor. * * @since 2.8.0 * @since 3.2.0 Updated to use a PHP5 constructor. * @since 5.6.1 Multiple headers are concatenated into a comma-separated string, * rather than remaining an array. * * @param string $url Remote file URL. * @param int $timeout Optional. How long the connection should stay open in seconds. * Default 10. * @param int $redirects Optional. The number of allowed redirects. Default 5. * @param string|array $headers Optional. Array or string of headers to send with the request. * Default null. * @param string $useragent Optional. User-agent value sent. Default null. * @param bool $force_fsockopen Optional. Whether to force opening internet or unix domain socket * connection or not. Default false. */ public function __construct($url, $timeout = 10, $redirects = 5, $headers = \null, $useragent = \null, $force_fsockopen = \false) { } } /** * Core class used to implement SimplePie feed sanitization. * * Extends the SimplePie\Sanitize class to use KSES, because * we cannot universally count on DOMDocument being available. * * @since 3.5.0 */ #[\AllowDynamicProperties] class WP_SimplePie_Sanitize_KSES extends \SimplePie\Sanitize { /** * WordPress SimplePie sanitization using KSES. * * Sanitizes the incoming data, to ensure that it matches the type of data expected, using KSES. * * @since 3.5.0 * * @param mixed $data The data that needs to be sanitized. * @param int $type The type of data that it's supposed to be. * @param string $base Optional. The `xml:base` value to use when converting relative * URLs to absolute ones. Default empty. * @return mixed Sanitized data. */ public function sanitize($data, $type, $base = '') { } } /** * Core class used for querying sites. * * @since 4.6.0 * * @see WP_Site_Query::__construct() for accepted arguments. */ #[\AllowDynamicProperties] class WP_Site_Query { /** * SQL for database query. * * @since 4.6.0 * @var string */ public $request; /** * SQL query clauses. * * @since 4.6.0 * @var array */ protected $sql_clauses = array('select' => '', 'from' => '', 'where' => array(), 'groupby' => '', 'orderby' => '', 'limits' => ''); /** * Metadata query container. * * @since 5.1.0 * @var WP_Meta_Query */ public $meta_query = \false; /** * Metadata query clauses. * * @since 5.1.0 * @var array */ protected $meta_query_clauses; /** * Date query container. * * @since 4.6.0 * @var WP_Date_Query A date query instance. */ public $date_query = \false; /** * Query vars set by the user. * * @since 4.6.0 * @var array */ public $query_vars; /** * Default values for query vars. * * @since 4.6.0 * @var array */ public $query_var_defaults; /** * List of sites located by the query. * * @since 4.6.0 * @var array */ public $sites; /** * The amount of found sites for the current query. * * @since 4.6.0 * @var int */ public $found_sites = 0; /** * The number of pages. * * @since 4.6.0 * @var int */ public $max_num_pages = 0; /** * Sets up the site query, based on the query vars passed. * * @since 4.6.0 * @since 4.8.0 Introduced the 'lang_id', 'lang__in', and 'lang__not_in' parameters. * @since 5.1.0 Introduced the 'update_site_meta_cache', 'meta_query', 'meta_key', * 'meta_compare_key', 'meta_value', 'meta_type', and 'meta_compare' parameters. * @since 5.3.0 Introduced the 'meta_type_key' parameter. * * @param string|array $query { * Optional. Array or query string of site query parameters. Default empty. * * @type int[] $site__in Array of site IDs to include. Default empty. * @type int[] $site__not_in Array of site IDs to exclude. Default empty. * @type bool $count Whether to return a site count (true) or array of site objects. * Default false. * @type array $date_query Date query clauses to limit sites by. See WP_Date_Query. * Default null. * @type string $fields Site fields to return. Accepts 'ids' (returns an array of site IDs) * or empty (returns an array of complete site objects). Default empty. * @type int $ID A site ID to only return that site. Default empty. * @type int $number Maximum number of sites to retrieve. Default 100. * @type int $offset Number of sites to offset the query. Used to build LIMIT clause. * Default 0. * @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true. * @type string|array $orderby Site status or array of statuses. Accepts: * - 'id' * - 'domain' * - 'path' * - 'network_id' * - 'last_updated' * - 'registered' * - 'domain_length' * - 'path_length' * - 'site__in' * - 'network__in' * - 'deleted' * - 'mature' * - 'spam' * - 'archived' * - 'public' * - false, an empty array, or 'none' to disable `ORDER BY` clause. * Default 'id'. * @type string $order How to order retrieved sites. Accepts 'ASC', 'DESC'. Default 'ASC'. * @type int $network_id Limit results to those affiliated with a given network ID. If 0, * include all networks. Default 0. * @type int[] $network__in Array of network IDs to include affiliated sites for. Default empty. * @type int[] $network__not_in Array of network IDs to exclude affiliated sites for. Default empty. * @type string $domain Limit results to those affiliated with a given domain. Default empty. * @type string[] $domain__in Array of domains to include affiliated sites for. Default empty. * @type string[] $domain__not_in Array of domains to exclude affiliated sites for. Default empty. * @type string $path Limit results to those affiliated with a given path. Default empty. * @type string[] $path__in Array of paths to include affiliated sites for. Default empty. * @type string[] $path__not_in Array of paths to exclude affiliated sites for. Default empty. * @type int $public Limit results to public sites. Accepts 1 or 0. Default empty. * @type int $archived Limit results to archived sites. Accepts 1 or 0. Default empty. * @type int $mature Limit results to mature sites. Accepts 1 or 0. Default empty. * @type int $spam Limit results to spam sites. Accepts 1 or 0. Default empty. * @type int $deleted Limit results to deleted sites. Accepts 1 or 0. Default empty. * @type int $lang_id Limit results to a language ID. Default empty. * @type string[] $lang__in Array of language IDs to include affiliated sites for. Default empty. * @type string[] $lang__not_in Array of language IDs to exclude affiliated sites for. Default empty. * @type string $search Search term(s) to retrieve matching sites for. Default empty. * @type string[] $search_columns Array of column names to be searched. Accepts 'domain' and 'path'. * Default empty array. * @type bool $update_site_cache Whether to prime the cache for found sites. Default true. * @type bool $update_site_meta_cache Whether to prime the metadata cache for found sites. Default true. * @type string|string[] $meta_key Meta key or keys to filter by. * @type string|string[] $meta_value Meta value or values to filter by. * @type string $meta_compare MySQL operator used for comparing the meta value. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_compare_key MySQL operator used for comparing the meta key. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type array $meta_query An associative array of WP_Meta_Query arguments. * See WP_Meta_Query::__construct() for accepted values. * } * @phpstan-param array{ * site__in?: int[], * site__not_in?: int[], * count?: bool, * date_query?: array, * fields?: string, * ID?: int, * number?: int, * offset?: int, * no_found_rows?: bool, * orderby?: string|array, * order?: string, * network_id?: int, * network__in?: int[], * network__not_in?: int[], * domain?: string, * domain__in?: string[], * domain__not_in?: string[], * path?: string, * path__in?: string[], * path__not_in?: string[], * public?: int, * archived?: int, * mature?: int, * spam?: int, * deleted?: int, * lang_id?: int, * lang__in?: string[], * lang__not_in?: string[], * search?: string, * search_columns?: string[], * update_site_cache?: bool, * update_site_meta_cache?: bool, * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * } $query */ public function __construct($query = '') { } /** * Parses arguments passed to the site query with default query parameters. * * @since 4.6.0 * * @see WP_Site_Query::__construct() * * @param string|array $query Array or string of WP_Site_Query arguments. See WP_Site_Query::__construct(). * @phpstan-param array{ * site__in?: int[], * site__not_in?: int[], * count?: bool, * date_query?: array, * fields?: string, * ID?: int, * number?: int, * offset?: int, * no_found_rows?: bool, * orderby?: string|array, * order?: string, * network_id?: int, * network__in?: int[], * network__not_in?: int[], * domain?: string, * domain__in?: string[], * domain__not_in?: string[], * path?: string, * path__in?: string[], * path__not_in?: string[], * public?: int, * archived?: int, * mature?: int, * spam?: int, * deleted?: int, * lang_id?: int, * lang__in?: string[], * lang__not_in?: string[], * search?: string, * search_columns?: string[], * update_site_cache?: bool, * update_site_meta_cache?: bool, * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * } $query See WP_Site_Query::__construct() */ public function parse_query($query = '') { } /** * Sets up the WordPress query for retrieving sites. * * @since 4.6.0 * * @param string|array $query Array or URL query string of parameters. * @return WP_Site[]|int[]|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids', * or the number of sites when 'count' is passed as a query var. */ public function query($query) { } /** * Retrieves a list of sites matching the query vars. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return WP_Site[]|int[]|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids', * or the number of sites when 'count' is passed as a query var. */ public function get_sites() { } /** * Used internally to get a list of site IDs matching the query vars. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int|array A single count of site IDs if a count query. An array of site IDs if a full query. */ protected function get_site_ids() { } /** * Used internally to generate an SQL string for searching across multiple columns. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $search Search string. * @param string[] $columns Array of columns to search. * @return string Search SQL. */ protected function get_search_sql($search, $columns) { } /** * Parses and sanitizes 'orderby' keys passed to the site query. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $orderby Alias for the field to order by. * @return string|false Value to used in the ORDER clause. False otherwise. */ protected function parse_orderby($orderby) { } /** * Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary. * * @since 4.6.0 * * @param string $order The 'order' query variable. * @return string The sanitized 'order' query variable. */ protected function parse_order($order) { } } /** * Core class used for interacting with a multisite site. * * This class is used during load to populate the `$current_blog` global and * setup the current site. * * @since 4.5.0 * * @property int $id * @property int $network_id * @property string $blogname * @property string $siteurl * @property int $post_count * @property string $home */ #[\AllowDynamicProperties] final class WP_Site { /** * Site ID. * * Named "blog" vs. "site" for legacy reasons. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $blog_id; /** * Domain of the site. * * @since 4.5.0 * @var string */ public $domain = ''; /** * Path of the site. * * @since 4.5.0 * @var string */ public $path = ''; /** * The ID of the site's parent network. * * Named "site" vs. "network" for legacy reasons. An individual site's "site" is * its network. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $site_id = '0'; /** * The date and time on which the site was created or registered. * * @since 4.5.0 * @var string Date in MySQL's datetime format. */ public $registered = '0000-00-00 00:00:00'; /** * The date and time on which site settings were last updated. * * @since 4.5.0 * @var string Date in MySQL's datetime format. */ public $last_updated = '0000-00-00 00:00:00'; /** * Whether the site should be treated as public. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $public = '1'; /** * Whether the site should be treated as archived. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $archived = '0'; /** * Whether the site should be treated as mature. * * Handling for this does not exist throughout WordPress core, but custom * implementations exist that require the property to be present. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $mature = '0'; /** * Whether the site should be treated as spam. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $spam = '0'; /** * Whether the site should be treated as deleted. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $deleted = '0'; /** * The language pack associated with this site. * * A numeric string, for compatibility reasons. * * @since 4.5.0 * @var string */ public $lang_id = '0'; /** * Retrieves a site from the database by its ID. * * @since 4.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $site_id The ID of the site to retrieve. * @return WP_Site|false The site's object if found. False if not. */ public static function get_instance($site_id) { } /** * Creates a new WP_Site object. * * Will populate object properties from the object provided and assign other * default properties based on that information. * * @since 4.5.0 * * @param WP_Site|object $site A site object. */ public function __construct($site) { } /** * Converts an object to array. * * @since 4.6.0 * * @return array Object as array. */ public function to_array() { } /** * Getter. * * Allows current multisite naming conventions when getting properties. * Allows access to extended site properties. * * @since 4.6.0 * * @param string $key Property to get. * @return mixed Value of the property. Null if not available. */ public function __get($key) { } /** * Isset-er. * * Allows current multisite naming conventions when checking for properties. * Checks for extended site properties. * * @since 4.6.0 * * @param string $key Property to check if set. * @return bool Whether the property is set. */ public function __isset($key) { } /** * Setter. * * Allows current multisite naming conventions while setting properties. * * @since 4.6.0 * * @param string $key Property to set. * @param mixed $value Value to assign to the property. */ public function __set($key, $value) { } } /** * Core class used to register styles. * * @since 2.6.0 * * @see WP_Dependencies */ class WP_Styles extends \WP_Dependencies { /** * Base URL for styles. * * Full URL with trailing slash. * * @since 2.6.0 * @var string */ public $base_url; /** * URL of the content directory. * * @since 2.8.0 * @var string */ public $content_url; /** * Default version string for stylesheets. * * @since 2.6.0 * @var string */ public $default_version; /** * The current text direction. * * @since 2.6.0 * @var string */ public $text_direction = 'ltr'; /** * Holds a list of style handles which will be concatenated. * * @since 2.8.0 * @var string */ public $concat = ''; /** * Holds a string which contains style handles and their version. * * @since 2.8.0 * @deprecated 3.4.0 * @var string */ public $concat_version = ''; /** * Whether to perform concatenation. * * @since 2.8.0 * @var bool */ public $do_concat = \false; /** * Holds HTML markup of styles and additional data if concatenation * is enabled. * * @since 2.8.0 * @var string */ public $print_html = ''; /** * Holds inline styles if concatenation is enabled. * * @since 3.3.0 * @var string */ public $print_code = ''; /** * List of default directories. * * @since 2.8.0 * @var array */ public $default_dirs; /** * Constructor. * * @since 2.6.0 */ public function __construct() { } /** * Processes a style dependency. * * @since 2.6.0 * @since 5.5.0 Added the `$group` parameter. * * @see WP_Dependencies::do_item() * * @param string $handle The style's registered handle. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function do_item($handle, $group = \false) { } /** * Adds extra CSS styles to a registered stylesheet. * * @since 3.3.0 * * @param string $handle The style's registered handle. * @param string $code String containing the CSS styles to be added. * @return bool True on success, false on failure. */ public function add_inline_style($handle, $code) { } /** * Prints extra CSS styles of a registered stylesheet. * * @since 3.3.0 * * @param string $handle The style's registered handle. * @param bool $display Optional. Whether to print the inline style * instead of just returning it. Default true. * @return string|bool False if no data exists, inline styles if `$display` is true, * true otherwise. */ public function print_inline_style($handle, $display = \true) { } /** * Determines style dependencies. * * @since 2.6.0 * * @see WP_Dependencies::all_deps() * * @param string|string[] $handles Item handle (string) or item handles (array of strings). * @param bool $recursion Optional. Internal flag that function is calling itself. * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function all_deps($handles, $recursion = \false, $group = \false) { } /** * Generates an enqueued style's fully-qualified URL. * * @since 2.6.0 * * @param string $src The source of the enqueued style. * @param string $ver The version of the enqueued style. * @param string $handle The style's registered handle. * @return string Style's fully-qualified URL. */ public function _css_href($src, $ver, $handle) { } /** * Whether a handle's source is in a default directory. * * @since 2.8.0 * * @param string $src The source of the enqueued style. * @return bool True if found, false if not. */ public function in_default_dir($src) { } /** * Processes items and dependencies for the footer group. * * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer. * * @since 3.3.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_footer_items() { } /** * Resets class properties. * * @since 3.3.0 */ public function reset() { } } /** * Core class used to implement taxonomy queries for the Taxonomy API. * * Used for generating SQL clauses that filter a primary query according to object * taxonomy terms. * * WP_Tax_Query is a helper that allows primary query classes, such as WP_Query, to filter * their results by object metadata, by generating `JOIN` and `WHERE` subclauses to be * attached to the primary SQL query string. * * @since 3.1.0 */ #[\AllowDynamicProperties] class WP_Tax_Query { /** * Array of taxonomy queries. * * See WP_Tax_Query::__construct() for information on tax query arguments. * * @since 3.1.0 * @var array */ public $queries = array(); /** * The relation between the queries. Can be one of 'AND' or 'OR'. * * @since 3.1.0 * @var string */ public $relation; /** * A flat list of table aliases used in the JOIN clauses. * * @since 4.1.0 * @var array */ protected $table_aliases = array(); /** * Terms and taxonomies fetched by this query. * * We store this data in a flat array because they are referenced in a * number of places by WP_Query. * * @since 4.1.0 * @var array */ public $queried_terms = array(); /** * Database table that where the metadata's objects are stored (eg $wpdb->users). * * @since 4.1.0 * @var string */ public $primary_table; /** * Column in 'primary_table' that represents the ID of the object. * * @since 4.1.0 * @var string */ public $primary_id_column; /** * Constructor. * * @since 3.1.0 * @since 4.1.0 Added support for `$operator` 'NOT EXISTS' and 'EXISTS' values. * * @param array $tax_query { * Array of taxonomy query clauses. * * @type string $relation Optional. The MySQL keyword used to join * the clauses of the query. Accepts 'AND', or 'OR'. Default 'AND'. * @type array ...$0 { * An array of first-order clause parameters, or another fully-formed tax query. * * @type string $taxonomy Taxonomy being queried. Optional when field=term_taxonomy_id. * @type string|int|array $terms Term or terms to filter by. * @type string $field Field to match $terms against. Accepts 'term_id', 'slug', * 'name', or 'term_taxonomy_id'. Default: 'term_id'. * @type string $operator MySQL operator to be used with $terms in the WHERE clause. * Accepts 'AND', 'IN', 'NOT IN', 'EXISTS', 'NOT EXISTS'. * Default: 'IN'. * @type bool $include_children Optional. Whether to include child terms. * Requires a $taxonomy. Default: true. * } * } */ public function __construct($tax_query) { } /** * Ensures the 'tax_query' argument passed to the class constructor is well-formed. * * Ensures that each query-level clause has a 'relation' key, and that * each first-order clause contains all the necessary keys from `$defaults`. * * @since 4.1.0 * * @param array $queries Array of queries clauses. * @return array Sanitized array of query clauses. */ public function sanitize_query($queries) { } /** * Sanitizes a 'relation' operator. * * @since 4.1.0 * * @param string $relation Raw relation key from the query argument. * @return string Sanitized relation. Either 'AND' or 'OR'. * @phpstan-return 'AND'|'OR' */ public function sanitize_relation($relation) { } /** * Determines whether a clause is first-order. * * A "first-order" clause is one that contains any of the first-order * clause keys ('terms', 'taxonomy', 'include_children', 'field', * 'operator'). An empty clause also counts as a first-order clause, * for backward compatibility. Any clause that doesn't meet this is * determined, by process of elimination, to be a higher-order query. * * @since 4.1.0 * * @param array $query Tax query arguments. * @return bool Whether the query clause is a first-order clause. */ protected static function is_first_order_clause($query) { } /** * Generates SQL clauses to be appended to a main query. * * @since 3.1.0 * * @param string $primary_table Database table where the object being filtered is stored (eg wp_users). * @param string $primary_id_column ID column for the filtered object in $primary_table. * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return array{ * join: string, * where: string, * } */ public function get_sql($primary_table, $primary_id_column) { } /** * Generates SQL clauses to be appended to a main query. * * Called by the public WP_Tax_Query::get_sql(), this method * is abstracted out to maintain parity with the other Query classes. * * @since 4.1.0 * * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return array{ * join: string, * where: string, * } */ protected function get_sql_clauses() { } /** * Generates SQL clauses for a single query array. * * If nested subqueries are found, this method recurses the tree to * produce the properly nested SQL. * * @since 4.1.0 * * @param array $query Query to parse (passed by reference). * @param int $depth Optional. Number of tree levels deep we currently are. * Used to calculate indentation. Default 0. * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to a single query array. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } * @phpstan-return array{ * join: string, * where: string, * } */ protected function get_sql_for_query(&$query, $depth = 0) { } /** * Generates SQL JOIN and WHERE clauses for a "first-order" query clause. * * @since 4.1.0 * * @global wpdb $wpdb The WordPress database abstraction object. * * @param array $clause Query clause (passed by reference). * @param array $parent_query Parent query array. * @return array { * Array containing JOIN and WHERE SQL clauses to append to a first-order query. * * @type string[] $join Array of SQL fragments to append to the main JOIN clause. * @type string[] $where Array of SQL fragments to append to the main WHERE clause. * } * @phpstan-return array{ * join: string[], * where: string[], * } */ public function get_sql_for_clause(&$clause, $parent_query) { } /** * Identifies an existing table alias that is compatible with the current query clause. * * We avoid unnecessary table joins by allowing each clause to look for * an existing table alias that is compatible with the query that it * needs to perform. * * An existing alias is compatible if (a) it is a sibling of `$clause` * (ie, it's under the scope of the same relation), and (b) the combination * of operator and relation between the clauses allows for a shared table * join. In the case of WP_Tax_Query, this only applies to 'IN' * clauses that are connected by the relation 'OR'. * * @since 4.1.0 * * @param array $clause Query clause. * @param array $parent_query Parent query of $clause. * @return string|false Table alias if found, otherwise false. */ protected function find_compatible_table_alias($clause, $parent_query) { } /** * Transforms a single query, from one field to another. * * Operates on the `$query` object by reference. In the case of error, * `$query` is converted to a WP_Error object. * * @since 3.2.0 * * @param array $query The single query. Passed by reference. * @param string $resulting_field The resulting field. Accepts 'slug', 'name', 'term_taxonomy_id', * or 'term_id'. Default 'term_id'. * @phpstan-param 'slug'|'name'|'term_taxonomy_id'|'term_id' $resulting_field * @phpstan-return void */ public function transform_query(&$query, $resulting_field) { } } /** * Core class used for interacting with taxonomies. * * @since 4.7.0 */ #[\AllowDynamicProperties] final class WP_Taxonomy { /** * Taxonomy key. * * @since 4.7.0 * @var string */ public $name; /** * Name of the taxonomy shown in the menu. Usually plural. * * @since 4.7.0 * @var string */ public $label; /** * Labels object for this taxonomy. * * If not set, tag labels are inherited for non-hierarchical types * and category labels for hierarchical ones. * * @see get_taxonomy_labels() * * @since 4.7.0 * @var stdClass */ public $labels; /** * A short descriptive summary of what the taxonomy is for. * * @since 4.7.0 * @var string */ public $description = ''; /** * Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users. * * @since 4.7.0 * @var bool */ public $public = \true; /** * Whether the taxonomy is publicly queryable. * * @since 4.7.0 * @var bool */ public $publicly_queryable = \true; /** * Whether the taxonomy is hierarchical. * * @since 4.7.0 * @var bool */ public $hierarchical = \false; /** * Whether to generate and allow a UI for managing terms in this taxonomy in the admin. * * @since 4.7.0 * @var bool */ public $show_ui = \true; /** * Whether to show the taxonomy in the admin menu. * * If true, the taxonomy is shown as a submenu of the object type menu. If false, no menu is shown. * * @since 4.7.0 * @var bool */ public $show_in_menu = \true; /** * Whether the taxonomy is available for selection in navigation menus. * * @since 4.7.0 * @var bool */ public $show_in_nav_menus = \true; /** * Whether to list the taxonomy in the tag cloud widget controls. * * @since 4.7.0 * @var bool */ public $show_tagcloud = \true; /** * Whether to show the taxonomy in the quick/bulk edit panel. * * @since 4.7.0 * @var bool */ public $show_in_quick_edit = \true; /** * Whether to display a column for the taxonomy on its post type listing screens. * * @since 4.7.0 * @var bool */ public $show_admin_column = \false; /** * The callback function for the meta box display. * * @since 4.7.0 * @var bool|callable */ public $meta_box_cb = \null; /** * The callback function for sanitizing taxonomy data saved from a meta box. * * @since 5.1.0 * @var callable */ public $meta_box_sanitize_cb = \null; /** * An array of object types this taxonomy is registered for. * * @since 4.7.0 * @var string[] */ public $object_type = \null; /** * Capabilities for this taxonomy. * * @since 4.7.0 * @var stdClass */ public $cap; /** * Rewrites information for this taxonomy. * * @since 4.7.0 * @var array|false */ public $rewrite; /** * Query var string for this taxonomy. * * @since 4.7.0 * @var string|false */ public $query_var; /** * Function that will be called when the count is updated. * * @since 4.7.0 * @var callable */ public $update_count_callback; /** * Whether this taxonomy should appear in the REST API. * * Default false. If true, standard endpoints will be registered with * respect to $rest_base and $rest_controller_class. * * @since 4.7.4 * @var bool $show_in_rest */ public $show_in_rest; /** * The base path for this taxonomy's REST API endpoints. * * @since 4.7.4 * @var string|bool $rest_base */ public $rest_base; /** * The namespace for this taxonomy's REST API endpoints. * * @since 5.9.0 * @var string|bool $rest_namespace */ public $rest_namespace; /** * The controller for this taxonomy's REST API endpoints. * * Custom controllers must extend WP_REST_Controller. * * @since 4.7.4 * @var string|bool $rest_controller_class */ public $rest_controller_class; /** * The controller instance for this taxonomy's REST API endpoints. * * Lazily computed. Should be accessed using {@see WP_Taxonomy::get_rest_controller()}. * * @since 5.5.0 * @var WP_REST_Controller $rest_controller */ public $rest_controller; /** * The default term name for this taxonomy. If you pass an array you have * to set 'name' and optionally 'slug' and 'description'. * * @since 5.5.0 * @var array|string */ public $default_term; /** * Whether terms in this taxonomy should be sorted in the order they are provided to `wp_set_object_terms()`. * * Use this in combination with `'orderby' => 'term_order'` when fetching terms. * * @since 2.5.0 * @var bool|null */ public $sort = \null; /** * Array of arguments to automatically use inside `wp_get_object_terms()` for this taxonomy. * * @since 2.6.0 * @var array|null */ public $args = \null; /** * Whether it is a built-in taxonomy. * * @since 4.7.0 * @var bool */ public $_builtin; /** * Constructor. * * See the register_taxonomy() function for accepted arguments for `$args`. * * @since 4.7.0 * * @param string $taxonomy Taxonomy key, must not exceed 32 characters. * @param array|string $object_type Name of the object type for the taxonomy object. * @param array|string $args Optional. Array or query string of arguments for registering a taxonomy. * See register_taxonomy() for information on accepted arguments. * Default empty array. * @phpstan-param array{ * labels?: string[], * description?: string, * public?: bool, * publicly_queryable?: bool, * hierarchical?: bool, * show_ui?: bool, * show_in_menu?: bool, * show_in_nav_menus?: bool, * show_in_rest?: bool, * rest_base?: string, * rest_namespace?: string, * rest_controller_class?: string, * show_tagcloud?: bool, * show_in_quick_edit?: bool, * show_admin_column?: bool, * meta_box_cb?: bool|callable, * meta_box_sanitize_cb?: callable, * capabilities?: array{ * manage_terms?: string, * edit_terms?: string, * delete_terms?: string, * assign_terms?: string, * }, * rewrite?: bool|array{ * slug?: string, * with_front?: bool, * hierarchical?: bool, * ep_mask?: int, * }, * query_var?: string|bool, * update_count_callback?: callable, * default_term?: string|array{ * name?: string, * slug?: string, * description?: string, * }, * sort?: bool, * args?: array, * _builtin?: bool, * } $args See register_taxonomy() */ public function __construct($taxonomy, $object_type, $args = array()) { } /** * Sets taxonomy properties. * * See the register_taxonomy() function for accepted arguments for `$args`. * * @since 4.7.0 * * @param string|string[] $object_type Name or array of names of the object types for the taxonomy. * @param array|string $args Array or query string of arguments for registering a taxonomy. */ public function set_props($object_type, $args) { } /** * Adds the necessary rewrite rules for the taxonomy. * * @since 4.7.0 * * @global WP $wp Current WordPress environment instance. */ public function add_rewrite_rules() { } /** * Removes any rewrite rules, permastructs, and rules for the taxonomy. * * @since 4.7.0 * * @global WP $wp Current WordPress environment instance. */ public function remove_rewrite_rules() { } /** * Registers the ajax callback for the meta box. * * @since 4.7.0 */ public function add_hooks() { } /** * Removes the ajax callback for the meta box. * * @since 4.7.0 */ public function remove_hooks() { } /** * Gets the REST API controller for this taxonomy. * * Will only instantiate the controller class once per request. * * @since 5.5.0 * * @return WP_REST_Controller|null The controller instance, or null if the taxonomy * is set not to show in rest. */ public function get_rest_controller() { } /** * Returns the default labels for taxonomies. * * @since 6.0.0 * * @return (string|null)[][] The default labels for taxonomies. */ public static function get_default_labels() { } /** * Resets the cache for the default labels. * * @since 6.0.0 */ public static function reset_default_labels() { } } /** * Class used for querying terms. * * @since 4.6.0 * * @see WP_Term_Query::__construct() for accepted arguments. */ #[\AllowDynamicProperties] class WP_Term_Query { /** * SQL string used to perform database query. * * @since 4.6.0 * @var string */ public $request; /** * Metadata query container. * * @since 4.6.0 * @var WP_Meta_Query A meta query instance. */ public $meta_query = \false; /** * Metadata query clauses. * * @since 4.6.0 * @var array */ protected $meta_query_clauses; /** * SQL query clauses. * * @since 4.6.0 * @var array */ protected $sql_clauses = array('select' => '', 'from' => '', 'where' => array(), 'orderby' => '', 'limits' => ''); /** * Query vars set by the user. * * @since 4.6.0 * @var array */ public $query_vars; /** * Default values for query vars. * * @since 4.6.0 * @var array */ public $query_var_defaults; /** * List of terms located by the query. * * @since 4.6.0 * @var array */ public $terms; /** * Constructor. * * Sets up the term query, based on the query vars passed. * * @since 4.6.0 * @since 4.6.0 Introduced 'term_taxonomy_id' parameter. * @since 4.7.0 Introduced 'object_ids' parameter. * @since 4.9.0 Added 'slug__in' support for 'orderby'. * @since 5.1.0 Introduced the 'meta_compare_key' parameter. * @since 5.3.0 Introduced the 'meta_type_key' parameter. * @since 6.4.0 Introduced the 'cache_results' parameter. * * @param string|array $query { * Optional. Array or query string of term query parameters. Default empty. * * @type string|string[] $taxonomy Taxonomy name, or array of taxonomy names, to which results * should be limited. * @type int|int[] $object_ids Object ID, or array of object IDs. Results will be * limited to terms associated with these objects. * @type string $orderby Field(s) to order terms by. Accepts: * - Term fields ('name', 'slug', 'term_group', 'term_id', 'id', * 'description', 'parent', 'term_order'). Unless `$object_ids` * is not empty, 'term_order' is treated the same as 'term_id'. * - 'count' to use the number of objects associated with the term. * - 'include' to match the 'order' of the `$include` param. * - 'slug__in' to match the 'order' of the `$slug` param. * - 'meta_value' * - 'meta_value_num'. * - The value of `$meta_key`. * - The array keys of `$meta_query`. * - 'none' to omit the ORDER BY clause. * Default 'name'. * @type string $order Whether to order terms in ascending or descending order. * Accepts 'ASC' (ascending) or 'DESC' (descending). * Default 'ASC'. * @type bool|int $hide_empty Whether to hide terms not assigned to any posts. Accepts * 1|true or 0|false. Default 1|true. * @type int[]|string $include Array or comma/space-separated string of term IDs to include. * Default empty array. * @type int[]|string $exclude Array or comma/space-separated string of term IDs to exclude. * If `$include` is non-empty, `$exclude` is ignored. * Default empty array. * @type int[]|string $exclude_tree Array or comma/space-separated string of term IDs to exclude * along with all of their descendant terms. If `$include` is * non-empty, `$exclude_tree` is ignored. Default empty array. * @type int|string $number Maximum number of terms to return. Accepts ''|0 (all) or any * positive number. Default ''|0 (all). Note that `$number` may * not return accurate results when coupled with `$object_ids`. * See #41796 for details. * @type int $offset The number by which to offset the terms query. Default empty. * @type string $fields Term fields to query for. Accepts: * - 'all' Returns an array of complete term objects (`WP_Term[]`). * - 'all_with_object_id' Returns an array of term objects * with the 'object_id' param (`WP_Term[]`). Works only * when the `$object_ids` parameter is populated. * - 'ids' Returns an array of term IDs (`int[]`). * - 'tt_ids' Returns an array of term taxonomy IDs (`int[]`). * - 'names' Returns an array of term names (`string[]`). * - 'slugs' Returns an array of term slugs (`string[]`). * - 'count' Returns the number of matching terms (`int`). * - 'id=>parent' Returns an associative array of parent term IDs, * keyed by term ID (`int[]`). * - 'id=>name' Returns an associative array of term names, * keyed by term ID (`string[]`). * - 'id=>slug' Returns an associative array of term slugs, * keyed by term ID (`string[]`). * Default 'all'. * @type string|string[] $name Name or array of names to return term(s) for. * Default empty. * @type string|string[] $slug Slug or array of slugs to return term(s) for. * Default empty. * @type int|int[] $term_taxonomy_id Term taxonomy ID, or array of term taxonomy IDs, * to match when querying terms. * @type bool $hierarchical Whether to include terms that have non-empty descendants * (even if `$hide_empty` is set to true). Default true. * @type string $search Search criteria to match terms. Will be SQL-formatted with * wildcards before and after. Default empty. * @type string $name__like Retrieve terms with criteria by which a term is LIKE * `$name__like`. Default empty. * @type string $description__like Retrieve terms where the description is LIKE * `$description__like`. Default empty. * @type bool $pad_counts Whether to pad the quantity of a term's children in the * quantity of each term's "count" object variable. * Default false. * @type string $get Whether to return terms regardless of ancestry or whether the * terms are empty. Accepts 'all' or '' (disabled). * Default ''. * @type int $child_of Term ID to retrieve child terms of. If multiple taxonomies * are passed, `$child_of` is ignored. Default 0. * @type int $parent Parent term ID to retrieve direct-child terms of. * Default empty. * @type bool $childless True to limit results to terms that have no children. * This parameter has no effect on non-hierarchical taxonomies. * Default false. * @type string $cache_domain Unique cache key to be produced when this query is stored in * an object cache. Default 'core'. * @type bool $cache_results Whether to cache term information. Default true. * @type bool $update_term_meta_cache Whether to prime meta caches for matched terms. Default true. * @type string|string[] $meta_key Meta key or keys to filter by. * @type string|string[] $meta_value Meta value or values to filter by. * @type string $meta_compare MySQL operator used for comparing the meta value. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_compare_key MySQL operator used for comparing the meta key. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type array $meta_query An associative array of WP_Meta_Query arguments. * See WP_Meta_Query::__construct() for accepted values. * } * @phpstan-param array{ * taxonomy?: string|string[], * object_ids?: int|int[], * orderby?: string, * order?: string, * hide_empty?: bool|int, * include?: int[]|string, * exclude?: int[]|string, * exclude_tree?: int[]|string, * number?: int|string, * offset?: int, * fields?: string, * name?: string|string[], * slug?: string|string[], * term_taxonomy_id?: int|int[], * hierarchical?: bool, * search?: string, * name__like?: string, * description__like?: string, * pad_counts?: bool, * get?: string, * child_of?: int, * parent?: int, * childless?: bool, * cache_domain?: string, * cache_results?: bool, * update_term_meta_cache?: bool, * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * } $query */ public function __construct($query = '') { } /** * Parse arguments passed to the term query with default query parameters. * * @since 4.6.0 * * @param string|array $query WP_Term_Query arguments. See WP_Term_Query::__construct() for accepted arguments. * @phpstan-param array{ * taxonomy?: string|string[], * object_ids?: int|int[], * orderby?: string, * order?: string, * hide_empty?: bool|int, * include?: int[]|string, * exclude?: int[]|string, * exclude_tree?: int[]|string, * number?: int|string, * offset?: int, * fields?: string, * name?: string|string[], * slug?: string|string[], * term_taxonomy_id?: int|int[], * hierarchical?: bool, * search?: string, * name__like?: string, * description__like?: string, * pad_counts?: bool, * get?: string, * child_of?: int, * parent?: int, * childless?: bool, * cache_domain?: string, * cache_results?: bool, * update_term_meta_cache?: bool, * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * } $query See WP_Term_Query::__construct() */ public function parse_query($query = '') { } /** * Sets up the query and retrieves the results. * * The return type varies depending on the value passed to `$args['fields']`. See * WP_Term_Query::get_terms() for details. * * @since 4.6.0 * * @param string|array $query Array or URL query string of parameters. * @return WP_Term[]|int[]|string[]|string Array of terms, or number of terms as numeric string * when 'count' is passed to `$args['fields']`. */ public function query($query) { } /** * Retrieves the query results. * * The return type varies depending on the value passed to `$args['fields']`. * * The following will result in an array of `WP_Term` objects being returned: * * - 'all' * - 'all_with_object_id' * * The following will result in a numeric string being returned: * * - 'count' * * The following will result in an array of text strings being returned: * * - 'id=>name' * - 'id=>slug' * - 'names' * - 'slugs' * * The following will result in an array of numeric strings being returned: * * - 'id=>parent' * * The following will result in an array of integers being returned: * * - 'ids' * - 'tt_ids' * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return WP_Term[]|int[]|string[]|string Array of terms, or number of terms as numeric string * when 'count' is passed to `$args['fields']`. */ public function get_terms() { } /** * Parse and sanitize 'orderby' keys passed to the term query. * * @since 4.6.0 * * @param string $orderby_raw Alias for the field to order by. * @return string|false Value to used in the ORDER clause. False otherwise. */ protected function parse_orderby($orderby_raw) { } /** * Format response depending on field requested. * * @since 6.0.0 * * @param WP_Term[] $term_objects Array of term objects. * @param string $_fields Field to format. * * @return WP_Term[]|int[]|string[] Array of terms / strings / ints depending on field requested. */ protected function format_terms($term_objects, $_fields) { } /** * Generate the ORDER BY clause for an 'orderby' param that is potentially related to a meta query. * * @since 4.6.0 * * @param string $orderby_raw Raw 'orderby' value passed to WP_Term_Query. * @return string ORDER BY clause. */ protected function parse_orderby_meta($orderby_raw) { } /** * Parse an 'order' query variable and cast it to ASC or DESC as necessary. * * @since 4.6.0 * * @param string $order The 'order' query variable. * @return string The sanitized 'order' query variable. */ protected function parse_order($order) { } /** * Used internally to generate a SQL string related to the 'search' parameter. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $search Search string. * @return string Search SQL. */ protected function get_search_sql($search) { } /** * Creates an array of term objects from an array of term IDs. * * Also discards invalid term objects. * * @since 4.9.8 * * @param Object[]|int[] $terms List of objects or term ids. * @return WP_Term[] Array of `WP_Term` objects. */ protected function populate_terms($terms) { } /** * Generate cache key. * * @since 6.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args WP_Term_Query arguments. * @param string $sql SQL statement. * * @return string Cache key. */ protected function generate_cache_key(array $args, $sql) { } } /** * Core class used to implement the WP_Term object. * * @since 4.4.0 * * @property-read object $data Sanitized term data. */ #[\AllowDynamicProperties] final class WP_Term { /** * Term ID. * * @since 4.4.0 * @var int */ public $term_id; /** * The term's name. * * @since 4.4.0 * @var string */ public $name = ''; /** * The term's slug. * * @since 4.4.0 * @var string */ public $slug = ''; /** * The term's term_group. * * @since 4.4.0 * @var int */ public $term_group = ''; /** * Term Taxonomy ID. * * @since 4.4.0 * @var int */ public $term_taxonomy_id = 0; /** * The term's taxonomy name. * * @since 4.4.0 * @var string */ public $taxonomy = ''; /** * The term's description. * * @since 4.4.0 * @var string */ public $description = ''; /** * ID of a term's parent term. * * @since 4.4.0 * @var int */ public $parent = 0; /** * Cached object count for this term. * * @since 4.4.0 * @var int */ public $count = 0; /** * Stores the term object's sanitization level. * * Does not correspond to a database field. * * @since 4.4.0 * @var string */ public $filter = 'raw'; /** * Retrieve WP_Term instance. * * @since 4.4.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $term_id Term ID. * @param string $taxonomy Optional. Limit matched terms to those matching `$taxonomy`. Only used for * disambiguating potentially shared terms. * @return WP_Term|WP_Error|false Term object, if found. WP_Error if `$term_id` is shared between taxonomies and * there's insufficient data to distinguish which term is intended. * False for other failures. */ public static function get_instance($term_id, $taxonomy = \null) { } /** * Constructor. * * @since 4.4.0 * * @param WP_Term|object $term Term object. */ public function __construct($term) { } /** * Sanitizes term fields, according to the filter type provided. * * @since 4.4.0 * * @param string $filter Filter context. Accepts 'edit', 'db', 'display', 'attribute', 'js', 'rss', or 'raw'. * @phpstan-param 'edit'|'db'|'display'|'attribute'|'js'|'rss'|'raw' $filter */ public function filter($filter) { } /** * Converts an object to array. * * @since 4.4.0 * * @return array Object as array. */ public function to_array() { } /** * Getter. * * @since 4.4.0 * * @param string $key Property to get. * @return mixed Property value. */ public function __get($key) { } } /** * Better word splitting than the PEAR package provides. * * @since 2.6.0 * @uses Text_Diff_Renderer_inline Extends */ #[\AllowDynamicProperties] class WP_Text_Diff_Renderer_inline extends \Text_Diff_Renderer_inline { /** * @ignore * @since 2.6.0 * * @param string $string * @param string $newlineEscape * @return string */ public function _splitOnWords($string, $newlineEscape = "\n") { } } /** * Table renderer to display the diff lines. * * @since 2.6.0 * @uses Text_Diff_Renderer Extends */ #[\AllowDynamicProperties] class WP_Text_Diff_Renderer_Table extends \Text_Diff_Renderer { /** * @see Text_Diff_Renderer::_leading_context_lines * @var int * @since 2.6.0 */ public $_leading_context_lines = 10000; /** * @see Text_Diff_Renderer::_trailing_context_lines * @var int * @since 2.6.0 */ public $_trailing_context_lines = 10000; /** * Title of the item being compared. * * @since 6.4.0 Declared a previously dynamic property. * @var string|null */ public $_title; /** * Title for the left column. * * @since 6.4.0 Declared a previously dynamic property. * @var string|null */ public $_title_left; /** * Title for the right column. * * @since 6.4.0 Declared a previously dynamic property. * @var string|null */ public $_title_right; /** * Threshold for when a diff should be saved or omitted. * * @var float * @since 2.6.0 */ protected $_diff_threshold = 0.6; /** * Inline display helper object name. * * @var string * @since 2.6.0 */ protected $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline'; /** * Should we show the split view or not * * @var string * @since 3.6.0 */ protected $_show_split_view = \true; protected $compat_fields = array('_show_split_view', 'inline_diff_renderer', '_diff_threshold'); /** * Caches the output of count_chars() in compute_string_distance() * * @var array * @since 5.0.0 */ protected $count_cache = array(); /** * Caches the difference calculation in compute_string_distance() * * @var array * @since 5.0.0 */ protected $difference_cache = array(); /** * Constructor - Call parent constructor with params array. * * This will set class properties based on the key value pairs in the array. * * @since 2.6.0 * * @param array $params */ public function __construct($params = array()) { } /** * @ignore * * @param string $header * @return string */ public function _startBlock($header) { } /** * @ignore * * @param array $lines * @param string $prefix */ public function _lines($lines, $prefix = ' ') { } /** * @ignore * * @param string $line HTML-escape the value. * @return string */ public function addedLine($line) { } /** * @ignore * * @param string $line HTML-escape the value. * @return string */ public function deletedLine($line) { } /** * @ignore * * @param string $line HTML-escape the value. * @return string */ public function contextLine($line) { } /** * @ignore * * @return string */ public function emptyLine() { } /** * @ignore * * @param array $lines * @param bool $encode * @return string */ public function _added($lines, $encode = \true) { } /** * @ignore * * @param array $lines * @param bool $encode * @return string */ public function _deleted($lines, $encode = \true) { } /** * @ignore * * @param array $lines * @param bool $encode * @return string */ public function _context($lines, $encode = \true) { } /** * Process changed lines to do word-by-word diffs for extra highlighting. * * (TRAC style) sometimes these lines can actually be deleted or added rows. * We do additional processing to figure that out * * @since 2.6.0 * * @param array $orig * @param array $final * @return string */ public function _changed($orig, $final) { } /** * Takes changed blocks and matches which rows in orig turned into which rows in final. * * @since 2.6.0 * * @param array $orig Lines of the original version of the text. * @param array $final Lines of the final version of the text. * @return array { * Array containing results of comparing the original text to the final text. * * @type array $orig_matches Associative array of original matches. Index == row * number of `$orig`, value == corresponding row number * of that same line in `$final` or 'x' if there is no * corresponding row (indicating it is a deleted line). * @type array $final_matches Associative array of final matches. Index == row * number of `$final`, value == corresponding row number * of that same line in `$orig` or 'x' if there is no * corresponding row (indicating it is a new line). * @type array $orig_rows Associative array of interleaved rows of `$orig` with * blanks to keep matches aligned with side-by-side diff * of `$final`. A value >= 0 corresponds to index of `$orig`. * Value < 0 indicates a blank row. * @type array $final_rows Associative array of interleaved rows of `$final` with * blanks to keep matches aligned with side-by-side diff * of `$orig`. A value >= 0 corresponds to index of `$final`. * Value < 0 indicates a blank row. * } * @phpstan-return array{ * orig_matches: array, * final_matches: array, * orig_rows: array, * final_rows: array, * } */ public function interleave_changed_lines($orig, $final) { } /** * Computes a number that is intended to reflect the "distance" between two strings. * * @since 2.6.0 * * @param string $string1 * @param string $string2 * @return int */ public function compute_string_distance($string1, $string2) { } /** * @ignore * @since 2.6.0 * * @param int $a * @param int $b * @return int */ public function difference($a, $b) { } /** * Make private properties readable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Getting a dynamic property is deprecated. * * @param string $name Property to get. * @return mixed A declared property's value, else null. */ public function __get($name) { } /** * Make private properties settable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Setting a dynamic property is deprecated. * * @param string $name Property to check if set. * @param mixed $value Property value. * @phpstan-return void */ public function __set($name, $value) { } /** * Make private properties checkable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Checking a dynamic property is deprecated. * * @param string $name Property to check if set. * @return bool Whether the property is set. */ public function __isset($name) { } /** * Make private properties un-settable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Unsetting a dynamic property is deprecated. * * @param string $name Property to unset. * @phpstan-return void */ public function __unset($name) { } } /** * Core class used for registering text domains. * * @since 6.1.0 */ #[\AllowDynamicProperties] class WP_Textdomain_Registry { /** * List of domains and all their language directory paths for each locale. * * @since 6.1.0 * * @var array */ protected $all = array(); /** * List of domains and their language directory path for the current (most recent) locale. * * @since 6.1.0 * * @var array */ protected $current = array(); /** * List of domains and their custom language directory paths. * * @see load_plugin_textdomain() * @see load_theme_textdomain() * * @since 6.1.0 * * @var array */ protected $custom_paths = array(); /** * Holds a cached list of available .mo files to improve performance. * * @since 6.1.0 * @since 6.5.0 This property is no longer used. * * @var array * * @deprecated */ protected $cached_mo_files = array(); /** * Holds a cached list of domains with translations to improve performance. * * @since 6.2.0 * * @var string[] */ protected $domains_with_translations = array(); /** * Initializes the registry. * * Hooks into the {@see 'upgrader_process_complete'} filter * to invalidate MO files caches. * * @since 6.5.0 */ public function init() { } /** * Returns the languages directory path for a specific domain and locale. * * @since 6.1.0 * * @param string $domain Text domain. * @param string $locale Locale. * * @return string|false Languages directory path or false if there is none available. */ public function get($domain, $locale) { } /** * Determines whether any MO file paths are available for the domain. * * This is the case if a path has been set for the current locale, * or if there is no information stored yet, in which case * {@see _load_textdomain_just_in_time()} will fetch the information first. * * @since 6.1.0 * * @param string $domain Text domain. * @return bool Whether any MO file paths are available for the domain. */ public function has($domain) { } /** * Sets the language directory path for a specific domain and locale. * * Also sets the 'current' property for direct access * to the path for the current (most recent) locale. * * @since 6.1.0 * * @param string $domain Text domain. * @param string $locale Locale. * @param string|false $path Language directory path or false if there is none available. */ public function set($domain, $locale, $path) { } /** * Sets the custom path to the plugin's/theme's languages directory. * * Used by {@see load_plugin_textdomain()} and {@see load_theme_textdomain()}. * * @since 6.1.0 * * @param string $domain Text domain. * @param string $path Language directory path. */ public function set_custom_path($domain, $path) { } /** * Retrieves translation files from the specified path. * * Allows early retrieval through the {@see 'pre_get_mo_files_from_path'} filter to optimize * performance, especially in directories with many files. * * @since 6.5.0 * * @param string $path The directory path to search for translation files. * @return array Array of translation file paths. Can contain .mo and .l10n.php files. */ public function get_language_files_from_path($path) { } /** * Invalidate the cache for .mo files. * * This function deletes the cache entries related to .mo files when triggered * by specific actions, such as the completion of an upgrade process. * * @since 6.5.0 * * @param WP_Upgrader $upgrader Unused. WP_Upgrader instance. In other contexts this might be a * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. * @param array $hook_extra { * Array of bulk item update data. * * @type string $action Type of action. Default 'update'. * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'. * @type bool $bulk Whether the update process is a bulk update. Default true. * @type array $plugins Array of the basename paths of the plugins' main files. * @type array $themes The theme slugs. * @type array $translations { * Array of translations update data. * * @type string $language The locale the translation is for. * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'. * @type string $slug Text domain the translation is for. The slug of a theme/plugin or * 'default' for core translations. * @type string $version The version of a theme, plugin, or core. * } * } * @phpstan-param array{ * action?: string, * type?: string, * bulk?: bool, * plugins?: array, * themes?: array, * translations?: array{ * language: string, * type: string, * slug: string, * version: string, * }, * } $hook_extra * @phpstan-return void */ public function invalidate_mo_files_cache($upgrader, $hook_extra) { } } /** * Class to provide access to update a theme.json structure. */ #[\AllowDynamicProperties] class WP_Theme_JSON_Data { /** * Constructor. * * @since 6.1.0 * * @link https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/ * * @param array $data Array following the theme.json specification. * @param string $origin The origin of the data: default, theme, user. */ public function __construct($data = array('version' => \WP_Theme_JSON::LATEST_SCHEMA), $origin = 'theme') { } /** * Updates the theme.json with the the given data. * * @since 6.1.0 * * @param array $new_data Array following the theme.json specification. * * @return WP_Theme_JSON_Data The own instance with access to the modified data. */ public function update_with($new_data) { } /** * Returns an array containing the underlying data * following the theme.json specification. * * @since 6.1.0 * * @return array */ public function get_data() { } /** * Returns theme JSON object. * * @since 6.6.0 * * @return WP_Theme_JSON The theme JSON structure stored in this data object. */ public function get_theme_json() { } } /** * Class that abstracts the processing of the different data sources * for site-level config and offers an API to work with them. * * This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes). * This is a low-level API that may need to do breaking changes. Please, * use get_global_settings(), get_global_styles(), and get_global_stylesheet() instead. * * @access private */ #[\AllowDynamicProperties] class WP_Theme_JSON_Resolver { /** * Container for keep track of registered blocks. * * @since 6.1.0 * @var array */ protected static $blocks_cache = array('core' => array(), 'blocks' => array(), 'theme' => array(), 'user' => array()); /** * Container for data coming from core. * * @since 5.8.0 * @var WP_Theme_JSON */ protected static $core = \null; /** * Container for data coming from the blocks. * * @since 6.1.0 * @var WP_Theme_JSON */ protected static $blocks = \null; /** * Container for data coming from the theme. * * @since 5.8.0 * @var WP_Theme_JSON */ protected static $theme = \null; /** * Container for data coming from the user. * * @since 5.9.0 * @var WP_Theme_JSON */ protected static $user = \null; /** * Stores the ID of the custom post type * that holds the user data. * * @since 5.9.0 * @var int */ protected static $user_custom_post_type_id = \null; /** * Container to keep loaded i18n schema for `theme.json`. * * @since 5.8.0 As `$theme_json_i18n`. * @since 5.9.0 Renamed from `$theme_json_i18n` to `$i18n_schema`. * @var array */ protected static $i18n_schema = \null; /** * `theme.json` file cache. * * @since 6.1.0 * @var array */ protected static $theme_json_file_cache = array(); /** * Processes a file that adheres to the theme.json schema * and returns an array with its contents, or a void array if none found. * * @since 5.8.0 * @since 6.1.0 Added caching. * * @param string $file_path Path to file. Empty if no file. * @return array Contents that adhere to the theme.json schema. */ protected static function read_json_file($file_path) { } /** * Returns a data structure used in theme.json translation. * * @since 5.8.0 * @deprecated 5.9.0 * * @return array An array of theme.json fields that are translatable and the keys that are translatable. */ public static function get_fields_to_translate() { } /** * Given a theme.json structure modifies it in place to update certain values * by its translated strings according to the language set by the user. * * @since 5.8.0 * * @param array $theme_json The theme.json to translate. * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings. * Default 'default'. * @return array Returns the modified $theme_json_structure. */ protected static function translate($theme_json, $domain = 'default') { } /** * Returns core's origin config. * * @since 5.8.0 * * @return WP_Theme_JSON Entity that holds core data. */ public static function get_core_data() { } /** * Checks whether the registered blocks were already processed for this origin. * * @since 6.1.0 * * @param string $origin Data source for which to cache the blocks. * Valid values are 'core', 'blocks', 'theme', and 'user'. * @return bool True on success, false otherwise. * @phpstan-param 'core'|'blocks'|'theme'|'user' $origin */ protected static function has_same_registered_blocks($origin) { } /** * Returns the theme's data. * * Data from theme.json will be backfilled from existing * theme supports, if any. Note that if the same data * is present in theme.json and in theme supports, * the theme.json takes precedence. * * @since 5.8.0 * @since 5.9.0 Theme supports have been inlined and the `$theme_support_data` argument removed. * @since 6.0.0 Added an `$options` parameter to allow the theme data to be returned without theme supports. * @since 6.6.0 Add support for 'default-font-sizes' and 'default-spacing-sizes' theme supports. * Added registration and merging of block style variations from partial theme.json files and the block styles registry. * * @param array $deprecated Deprecated. Not used. * @param array $options { * Options arguments. * * @type bool $with_supports Whether to include theme supports in the data. Default true. * } * @return WP_Theme_JSON Entity that holds theme data. * @phpstan-param array{ * with_supports?: bool, * } $options */ public static function get_theme_data($deprecated = array(), $options = array()) { } /** * Gets the styles for blocks from the block.json file. * * @since 6.1.0 * * @return WP_Theme_JSON */ public static function get_block_data() { } /** * Returns the custom post type that contains the user's origin config * for the active theme or an empty array if none are found. * * This can also create and return a new draft custom post type. * * @since 5.9.0 * * @param WP_Theme $theme The theme object. If empty, it * defaults to the active theme. * @param bool $create_post Optional. Whether a new custom post * type should be created if none are * found. Default false. * @param array $post_status_filter Optional. Filter custom post type by * post status. Default `array( 'publish' )`, * so it only fetches published posts. * @return array Custom Post Type for the user's origin config. */ public static function get_user_data_from_wp_global_styles($theme, $create_post = \false, $post_status_filter = array('publish')) { } /** * Returns the user's origin config. * * @since 5.9.0 * @since 6.6.0 The 'isGlobalStylesUserThemeJSON' flag is left on the user data. * Register the block style variations coming from the user data. * * @return WP_Theme_JSON Entity that holds styles for user data. */ public static function get_user_data() { } /** * Returns the data merged from multiple origins. * * There are four sources of data (origins) for a site: * * - default => WordPress * - blocks => each one of the blocks provides data for itself * - theme => the active theme * - custom => data provided by the user * * The custom's has higher priority than the theme's, the theme's higher than blocks', * and block's higher than default's. * * Unlike the getters * {@link https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_core_data/ get_core_data}, * {@link https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_theme_data/ get_theme_data}, * and {@link https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_user_data/ get_user_data}, * this method returns data after it has been merged with the previous origins. * This means that if the same piece of data is declared in different origins * (default, blocks, theme, custom), the last origin overrides the previous. * * For example, if the user has set a background color * for the paragraph block, and the theme has done it as well, * the user preference wins. * * @since 5.8.0 * @since 5.9.0 Added user data, removed the `$settings` parameter, * added the `$origin` parameter. * @since 6.1.0 Added block data and generation of spacingSizes array. * @since 6.2.0 Changed ' $origin' parameter values to 'default', 'blocks', 'theme' or 'custom'. * * @param string $origin Optional. To what level should we merge data: 'default', 'blocks', 'theme' or 'custom'. * 'custom' is used as default value as well as fallback value if the origin is unknown. * @return WP_Theme_JSON * @phpstan-param 'default'|'blocks'|'theme'|'custom' $origin */ public static function get_merged_data($origin = 'custom') { } /** * Returns the ID of the custom post type * that stores user data. * * @since 5.9.0 * * @return integer|null */ public static function get_user_global_styles_post_id() { } /** * Determines whether the active theme has a theme.json file. * * @since 5.8.0 * @since 5.9.0 Added a check in the parent theme. * @deprecated 6.2.0 Use wp_theme_has_theme_json() instead. * * @return bool */ public static function theme_has_support() { } /** * Builds the path to the given file and checks that it is readable. * * If it isn't, returns an empty string, otherwise returns the whole file path. * * @since 5.8.0 * @since 5.9.0 Adapted to work with child themes, added the `$template` argument. * * @param string $file_name Name of the file. * @param bool $template Optional. Use template theme directory. Default false. * @return string The whole file path or empty if the file doesn't exist. */ protected static function get_file_path_from_theme($file_name, $template = \false) { } /** * Cleans the cached data so it can be recalculated. * * @since 5.8.0 * @since 5.9.0 Added the `$user`, `$user_custom_post_type_id`, * and `$i18n_schema` variables to reset. * @since 6.1.0 Added the `$blocks` and `$blocks_cache` variables * to reset. */ public static function clean_cached_data() { } /** * Returns the style variations defined by the theme. * * @since 6.0.0 * @since 6.2.0 Returns parent theme variations if theme is a child. * @since 6.6.0 Added configurable scope parameter to allow filtering * theme.json partial files by the scope to which they * can be applied e.g. theme vs block etc. * Added basic caching for read theme.json partial files. * * @param string $scope The scope or type of style variation to retrieve e.g. theme, block etc. * @return array */ public static function get_style_variations($scope = 'theme') { } /** * Resolves relative paths in theme.json styles to theme absolute paths * and returns them in an array that can be embedded * as the value of `_link` object in REST API responses. * * @since 6.6.0 * @since 6.7.0 Resolve relative paths in block styles. * * @param WP_Theme_JSON $theme_json A theme json instance. * @return array An array of resolved paths. */ public static function get_resolved_theme_uris($theme_json) { } /** * Resolves relative paths in theme.json styles to theme absolute paths * and merges them with incoming theme JSON. * * @since 6.6.0 * * @param WP_Theme_JSON $theme_json A theme json instance. * @return WP_Theme_JSON Theme merged with resolved paths, if any found. */ public static function resolve_theme_file_uris($theme_json) { } } /** * Class that migrates a given theme.json structure to the latest schema. * * This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes). * This is a low-level API that may need to do breaking changes. Please, * use get_global_settings, get_global_styles, and get_global_stylesheet instead. * * @since 5.9.0 * @access private */ #[\AllowDynamicProperties] class WP_Theme_JSON_Schema { /** * Maps old properties to their new location within the schema's settings. * This will be applied at both the defaults and individual block levels. */ const V1_TO_V2_RENAMED_PATHS = array('border.customRadius' => 'border.radius', 'spacing.customMargin' => 'spacing.margin', 'spacing.customPadding' => 'spacing.padding', 'typography.customLineHeight' => 'typography.lineHeight'); /** * Function that migrates a given theme.json structure to the last version. * * @since 5.9.0 * @since 6.6.0 Migrate up to v3 and add $origin parameter. * * @param array $theme_json The structure to migrate. * @param string $origin Optional. What source of data this object represents. * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'. * @return array The structure in the last version. * @phpstan-param 'blocks'|'default'|'theme'|'custom' $origin */ public static function migrate($theme_json, $origin = 'theme') { } } /** * Class that encapsulates the processing of structures that adhere to the theme.json spec. * * This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes). * This is a low-level API that may need to do breaking changes. Please, * use get_global_settings, get_global_styles, and get_global_stylesheet instead. * * @access private */ #[\AllowDynamicProperties] class WP_Theme_JSON { /** * Container of data in theme.json format. * * @since 5.8.0 * @var array */ protected $theme_json = \null; /** * Holds block metadata extracted from block.json * to be shared among all instances so we don't * process it twice. * * @since 5.8.0 * @since 6.1.0 Initialize as an empty array. * @var array */ protected static $blocks_metadata = array(); /** * The CSS selector for the top-level preset settings. * * @since 6.6.0 * @var string */ const ROOT_CSS_PROPERTIES_SELECTOR = ':root'; /** * The CSS selector for the top-level styles. * * @since 5.8.0 * @var string */ const ROOT_BLOCK_SELECTOR = 'body'; /** * The sources of data this object can represent. * * @since 5.8.0 * @since 6.1.0 Added 'blocks'. * @var string[] */ const VALID_ORIGINS = array('default', 'blocks', 'theme', 'custom'); /** * Presets are a set of values that serve * to bootstrap some styles: colors, font sizes, etc. * * They are a unkeyed array of values such as: * * array( * array( * 'slug' => 'unique-name-within-the-set', * 'name' => 'Name for the UI', * <value_key> => 'value' * ), * ) * * This contains the necessary metadata to process them: * * - path => Where to find the preset within the settings section. * - prevent_override => Disables override of default presets by theme presets. * The relationship between whether to override the defaults * and whether the defaults are enabled is inverse: * - If defaults are enabled => theme presets should not be overridden * - If defaults are disabled => theme presets should be overridden * For example, a theme sets defaultPalette to false, * making the default palette hidden from the user. * In that case, we want all the theme presets to be present, * so they should override the defaults by setting this false. * - use_default_names => whether to use the default names * - value_key => the key that represents the value * - value_func => optionally, instead of value_key, a function to generate * the value that takes a preset as an argument * (either value_key or value_func should be present) * - css_vars => template string to use in generating the CSS Custom Property. * Example output: "--wp--preset--duotone--blue: <value>" will generate as many CSS Custom Properties as presets defined * substituting the $slug for the slug's value for each preset value. * - classes => array containing a structure with the classes to * generate for the presets, where for each array item * the key is the class name and the value the property name. * The "$slug" substring will be replaced by the slug of each preset. * For example: * 'classes' => array( * '.has-$slug-color' => 'color', * '.has-$slug-background-color' => 'background-color', * '.has-$slug-border-color' => 'border-color', * ) * - properties => array of CSS properties to be used by kses to * validate the content of each preset * by means of the remove_insecure_properties method. * * @since 5.8.0 * @since 5.9.0 Added the `color.duotone` and `typography.fontFamilies` presets, * `use_default_names` preset key, and simplified the metadata structure. * @since 6.0.0 Replaced `override` with `prevent_override` and updated the * `prevent_override` value for `color.duotone` to use `color.defaultDuotone`. * @since 6.2.0 Added 'shadow' presets. * @since 6.3.0 Replaced value_func for duotone with `null`. Custom properties are handled by class-wp-duotone.php. * @since 6.6.0 Added the `dimensions.aspectRatios` and `dimensions.defaultAspectRatios` presets. * Updated the 'prevent_override' value for font size presets to use 'typography.defaultFontSizes' * and spacing size presets to use `spacing.defaultSpacingSizes`. * @var array */ const PRESETS_METADATA = array(array('path' => array('dimensions', 'aspectRatios'), 'prevent_override' => array('dimensions', 'defaultAspectRatios'), 'use_default_names' => \false, 'value_key' => 'ratio', 'css_vars' => '--wp--preset--aspect-ratio--$slug', 'classes' => array(), 'properties' => array('aspect-ratio')), array('path' => array('color', 'palette'), 'prevent_override' => array('color', 'defaultPalette'), 'use_default_names' => \false, 'value_key' => 'color', 'css_vars' => '--wp--preset--color--$slug', 'classes' => array('.has-$slug-color' => 'color', '.has-$slug-background-color' => 'background-color', '.has-$slug-border-color' => 'border-color'), 'properties' => array('color', 'background-color', 'border-color')), array('path' => array('color', 'gradients'), 'prevent_override' => array('color', 'defaultGradients'), 'use_default_names' => \false, 'value_key' => 'gradient', 'css_vars' => '--wp--preset--gradient--$slug', 'classes' => array('.has-$slug-gradient-background' => 'background'), 'properties' => array('background')), array( 'path' => array('color', 'duotone'), 'prevent_override' => array('color', 'defaultDuotone'), 'use_default_names' => \false, 'value_func' => \null, // CSS Custom Properties for duotone are handled by block supports in class-wp-duotone.php. 'css_vars' => \null, 'classes' => array(), 'properties' => array('filter'), ), array('path' => array('typography', 'fontSizes'), 'prevent_override' => array('typography', 'defaultFontSizes'), 'use_default_names' => \true, 'value_func' => 'wp_get_typography_font_size_value', 'css_vars' => '--wp--preset--font-size--$slug', 'classes' => array('.has-$slug-font-size' => 'font-size'), 'properties' => array('font-size')), array('path' => array('typography', 'fontFamilies'), 'prevent_override' => \false, 'use_default_names' => \false, 'value_key' => 'fontFamily', 'css_vars' => '--wp--preset--font-family--$slug', 'classes' => array('.has-$slug-font-family' => 'font-family'), 'properties' => array('font-family')), array('path' => array('spacing', 'spacingSizes'), 'prevent_override' => array('spacing', 'defaultSpacingSizes'), 'use_default_names' => \true, 'value_key' => 'size', 'css_vars' => '--wp--preset--spacing--$slug', 'classes' => array(), 'properties' => array('padding', 'margin')), array('path' => array('shadow', 'presets'), 'prevent_override' => array('shadow', 'defaultPresets'), 'use_default_names' => \false, 'value_key' => 'shadow', 'css_vars' => '--wp--preset--shadow--$slug', 'classes' => array(), 'properties' => array('box-shadow'))); /** * Metadata for style properties. * * Each element is a direct mapping from the CSS property name to the * path to the value in theme.json & block attributes. * * @since 5.8.0 * @since 5.9.0 Added the `border-*`, `font-family`, `font-style`, `font-weight`, * `letter-spacing`, `margin-*`, `padding-*`, `--wp--style--block-gap`, * `text-decoration`, `text-transform`, and `filter` properties, * simplified the metadata structure. * @since 6.1.0 Added the `border-*-color`, `border-*-width`, `border-*-style`, * `--wp--style--root--padding-*`, and `box-shadow` properties, * removed the `--wp--style--block-gap` property. * @since 6.2.0 Added `outline-*`, and `min-height` properties. * @since 6.3.0 Added `column-count` property. * @since 6.4.0 Added `writing-mode` property. * @since 6.5.0 Added `aspect-ratio` property. * @since 6.6.0 Added `background-[image|position|repeat|size]` properties. * @since 6.7.0 Added `background-attachment` property. * * @var array */ const PROPERTIES_METADATA = array('aspect-ratio' => array('dimensions', 'aspectRatio'), 'background' => array('color', 'gradient'), 'background-color' => array('color', 'background'), 'background-image' => array('background', 'backgroundImage'), 'background-position' => array('background', 'backgroundPosition'), 'background-repeat' => array('background', 'backgroundRepeat'), 'background-size' => array('background', 'backgroundSize'), 'background-attachment' => array('background', 'backgroundAttachment'), 'border-radius' => array('border', 'radius'), 'border-top-left-radius' => array('border', 'radius', 'topLeft'), 'border-top-right-radius' => array('border', 'radius', 'topRight'), 'border-bottom-left-radius' => array('border', 'radius', 'bottomLeft'), 'border-bottom-right-radius' => array('border', 'radius', 'bottomRight'), 'border-color' => array('border', 'color'), 'border-width' => array('border', 'width'), 'border-style' => array('border', 'style'), 'border-top-color' => array('border', 'top', 'color'), 'border-top-width' => array('border', 'top', 'width'), 'border-top-style' => array('border', 'top', 'style'), 'border-right-color' => array('border', 'right', 'color'), 'border-right-width' => array('border', 'right', 'width'), 'border-right-style' => array('border', 'right', 'style'), 'border-bottom-color' => array('border', 'bottom', 'color'), 'border-bottom-width' => array('border', 'bottom', 'width'), 'border-bottom-style' => array('border', 'bottom', 'style'), 'border-left-color' => array('border', 'left', 'color'), 'border-left-width' => array('border', 'left', 'width'), 'border-left-style' => array('border', 'left', 'style'), 'color' => array('color', 'text'), 'text-align' => array('typography', 'textAlign'), 'column-count' => array('typography', 'textColumns'), 'font-family' => array('typography', 'fontFamily'), 'font-size' => array('typography', 'fontSize'), 'font-style' => array('typography', 'fontStyle'), 'font-weight' => array('typography', 'fontWeight'), 'letter-spacing' => array('typography', 'letterSpacing'), 'line-height' => array('typography', 'lineHeight'), 'margin' => array('spacing', 'margin'), 'margin-top' => array('spacing', 'margin', 'top'), 'margin-right' => array('spacing', 'margin', 'right'), 'margin-bottom' => array('spacing', 'margin', 'bottom'), 'margin-left' => array('spacing', 'margin', 'left'), 'min-height' => array('dimensions', 'minHeight'), 'outline-color' => array('outline', 'color'), 'outline-offset' => array('outline', 'offset'), 'outline-style' => array('outline', 'style'), 'outline-width' => array('outline', 'width'), 'padding' => array('spacing', 'padding'), 'padding-top' => array('spacing', 'padding', 'top'), 'padding-right' => array('spacing', 'padding', 'right'), 'padding-bottom' => array('spacing', 'padding', 'bottom'), 'padding-left' => array('spacing', 'padding', 'left'), '--wp--style--root--padding' => array('spacing', 'padding'), '--wp--style--root--padding-top' => array('spacing', 'padding', 'top'), '--wp--style--root--padding-right' => array('spacing', 'padding', 'right'), '--wp--style--root--padding-bottom' => array('spacing', 'padding', 'bottom'), '--wp--style--root--padding-left' => array('spacing', 'padding', 'left'), 'text-decoration' => array('typography', 'textDecoration'), 'text-transform' => array('typography', 'textTransform'), 'filter' => array('filter', 'duotone'), 'box-shadow' => array('shadow'), 'writing-mode' => array('typography', 'writingMode')); /** * Indirect metadata for style properties that are not directly output. * * Each element maps from a CSS property name to an array of * paths to the value in theme.json & block attributes. * * Indirect properties are not output directly by `compute_style_properties`, * but are used elsewhere in the processing of global styles. The indirect * property is used to validate whether a style value is allowed. * * @since 6.2.0 * @since 6.6.0 Added background-image properties. * * @var array */ const INDIRECT_PROPERTIES_METADATA = array('gap' => array(array('spacing', 'blockGap')), 'column-gap' => array(array('spacing', 'blockGap', 'left')), 'row-gap' => array(array('spacing', 'blockGap', 'top')), 'max-width' => array(array('layout', 'contentSize'), array('layout', 'wideSize')), 'background-image' => array(array('background', 'backgroundImage', 'url'))); /** * Protected style properties. * * These style properties are only rendered if a setting enables it * via a value other than `null`. * * Each element maps the style property to the corresponding theme.json * setting key. * * @since 5.9.0 */ const PROTECTED_PROPERTIES = array('spacing.blockGap' => array('spacing', 'blockGap')); /** * The top-level keys a theme.json can have. * * @since 5.8.0 As `ALLOWED_TOP_LEVEL_KEYS`. * @since 5.9.0 Renamed from `ALLOWED_TOP_LEVEL_KEYS` to `VALID_TOP_LEVEL_KEYS`, * added the `customTemplates` and `templateParts` values. * @since 6.3.0 Added the `description` value. * @since 6.6.0 Added `blockTypes` to support block style variation theme.json partials. * @var string[] */ const VALID_TOP_LEVEL_KEYS = array('blockTypes', 'customTemplates', 'description', 'patterns', 'settings', 'slug', 'styles', 'templateParts', 'title', 'version'); /** * The valid properties under the settings key. * * @since 5.8.0 As `ALLOWED_SETTINGS`. * @since 5.9.0 Renamed from `ALLOWED_SETTINGS` to `VALID_SETTINGS`, * added new properties for `border`, `color`, `spacing`, * and `typography`, and renamed others according to the new schema. * @since 6.0.0 Added `color.defaultDuotone`. * @since 6.1.0 Added `layout.definitions` and `useRootPaddingAwareAlignments`. * @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', 'shadow.defaultPresets', * `position.fixed` and `position.sticky`. * @since 6.3.0 Added support for `typography.textColumns`, removed `layout.definitions`. * @since 6.4.0 Added support for `layout.allowEditing`, `background.backgroundImage`, * `typography.writingMode`, `lightbox.enabled` and `lightbox.allowEditing`. * @since 6.5.0 Added support for `layout.allowCustomContentAndWideSize`, * `background.backgroundSize` and `dimensions.aspectRatio`. * @since 6.6.0 Added support for 'dimensions.aspectRatios', 'dimensions.defaultAspectRatios', * 'typography.defaultFontSizes', and 'spacing.defaultSpacingSizes'. * @var array */ const VALID_SETTINGS = array('appearanceTools' => \null, 'useRootPaddingAwareAlignments' => \null, 'background' => array('backgroundImage' => \null, 'backgroundSize' => \null), 'border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null), 'color' => array('background' => \null, 'custom' => \null, 'customDuotone' => \null, 'customGradient' => \null, 'defaultDuotone' => \null, 'defaultGradients' => \null, 'defaultPalette' => \null, 'duotone' => \null, 'gradients' => \null, 'link' => \null, 'heading' => \null, 'button' => \null, 'caption' => \null, 'palette' => \null, 'text' => \null), 'custom' => \null, 'dimensions' => array('aspectRatio' => \null, 'aspectRatios' => \null, 'defaultAspectRatios' => \null, 'minHeight' => \null), 'layout' => array('contentSize' => \null, 'wideSize' => \null, 'allowEditing' => \null, 'allowCustomContentAndWideSize' => \null), 'lightbox' => array('enabled' => \null, 'allowEditing' => \null), 'position' => array('fixed' => \null, 'sticky' => \null), 'spacing' => array('customSpacingSize' => \null, 'defaultSpacingSizes' => \null, 'spacingSizes' => \null, 'spacingScale' => \null, 'blockGap' => \null, 'margin' => \null, 'padding' => \null, 'units' => \null), 'shadow' => array('presets' => \null, 'defaultPresets' => \null), 'typography' => array('fluid' => \null, 'customFontSize' => \null, 'defaultFontSizes' => \null, 'dropCap' => \null, 'fontFamilies' => \null, 'fontSizes' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textAlign' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null)); /* * The valid properties for fontFamilies under settings key. * * @since 6.5.0 * * @var array */ const FONT_FAMILY_SCHEMA = array(array('fontFamily' => \null, 'name' => \null, 'slug' => \null, 'fontFace' => array(array('ascentOverride' => \null, 'descentOverride' => \null, 'fontDisplay' => \null, 'fontFamily' => \null, 'fontFeatureSettings' => \null, 'fontStyle' => \null, 'fontStretch' => \null, 'fontVariationSettings' => \null, 'fontWeight' => \null, 'lineGapOverride' => \null, 'sizeAdjust' => \null, 'src' => \null, 'unicodeRange' => \null)))); /** * The valid properties under the styles key. * * @since 5.8.0 As `ALLOWED_STYLES`. * @since 5.9.0 Renamed from `ALLOWED_STYLES` to `VALID_STYLES`, * added new properties for `border`, `filter`, `spacing`, * and `typography`. * @since 6.1.0 Added new side properties for `border`, * added new property `shadow`, * updated `blockGap` to be allowed at any level. * @since 6.2.0 Added `outline`, and `minHeight` properties. * @since 6.3.0 Added support for `typography.textColumns`. * @since 6.5.0 Added support for `dimensions.aspectRatio`. * @since 6.6.0 Added `background` sub properties to top-level only. * * @var array */ const VALID_STYLES = array('background' => array('backgroundImage' => \null, 'backgroundPosition' => \null, 'backgroundRepeat' => \null, 'backgroundSize' => \null, 'backgroundAttachment' => \null), 'border' => array('color' => \null, 'radius' => \null, 'style' => \null, 'width' => \null, 'top' => \null, 'right' => \null, 'bottom' => \null, 'left' => \null), 'color' => array('background' => \null, 'gradient' => \null, 'text' => \null), 'dimensions' => array('aspectRatio' => \null, 'minHeight' => \null), 'filter' => array('duotone' => \null), 'outline' => array('color' => \null, 'offset' => \null, 'style' => \null, 'width' => \null), 'shadow' => \null, 'spacing' => array('margin' => \null, 'padding' => \null, 'blockGap' => \null), 'typography' => array('fontFamily' => \null, 'fontSize' => \null, 'fontStyle' => \null, 'fontWeight' => \null, 'letterSpacing' => \null, 'lineHeight' => \null, 'textAlign' => \null, 'textColumns' => \null, 'textDecoration' => \null, 'textTransform' => \null, 'writingMode' => \null), 'css' => \null); /** * Defines which pseudo selectors are enabled for which elements. * * The order of the selectors should be: link, any-link, visited, hover, focus, active. * This is to ensure the user action (hover, focus and active) styles have a higher * specificity than the visited styles, which in turn have a higher specificity than * the unvisited styles. * * See https://core.trac.wordpress.org/ticket/56928. * Note: this will affect both top-level and block-level elements. * * @since 6.1.0 * @since 6.2.0 Added support for ':link' and ':any-link'. */ const VALID_ELEMENT_PSEUDO_SELECTORS = array('link' => array(':link', ':any-link', ':visited', ':hover', ':focus', ':active'), 'button' => array(':link', ':any-link', ':visited', ':hover', ':focus', ':active')); /** * The valid elements that can be found under styles. * * @since 5.8.0 * @since 6.1.0 Added `heading`, `button`, and `caption` elements. * @var string[] */ const ELEMENTS = array( 'link' => 'a:where(:not(.wp-element-button))', // The `where` is needed to lower the specificity. 'heading' => 'h1, h2, h3, h4, h5, h6', 'h1' => 'h1', 'h2' => 'h2', 'h3' => 'h3', 'h4' => 'h4', 'h5' => 'h5', 'h6' => 'h6', // We have the .wp-block-button__link class so that this will target older buttons that have been serialized. 'button' => '.wp-element-button, .wp-block-button__link', // The block classes are necessary to target older content that won't use the new class names. 'caption' => '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption', 'cite' => 'cite', ); const __EXPERIMENTAL_ELEMENT_CLASS_NAMES = array('button' => 'wp-element-button', 'caption' => 'wp-element-caption'); /** * List of block support features that can have their related styles * generated under their own feature level selector rather than the block's. * * @since 6.1.0 * @var string[] */ const BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = array('__experimentalBorder' => 'border', 'color' => 'color', 'spacing' => 'spacing', 'typography' => 'typography'); /** * Return the input schema at the root and per origin. * * @since 6.5.0 * * @param array $schema The base schema. * @return array The schema at the root and per origin. * * Example: * schema_in_root_and_per_origin( * array( * 'fontFamily' => null, * 'slug' => null, * ) * ) * * Returns: * array( * 'fontFamily' => null, * 'slug' => null, * 'default' => array( * 'fontFamily' => null, * 'slug' => null, * ), * 'blocks' => array( * 'fontFamily' => null, * 'slug' => null, * ), * 'theme' => array( * 'fontFamily' => null, * 'slug' => null, * ), * 'custom' => array( * 'fontFamily' => null, * 'slug' => null, * ), * ) */ protected static function schema_in_root_and_per_origin($schema) { } /** * Returns a class name by an element name. * * @since 6.1.0 * * @param string $element The name of the element. * @return string The name of the class. */ public static function get_element_class_name($element) { } /** * Options that settings.appearanceTools enables. * * @since 6.0.0 * @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`. * @since 6.4.0 Added `background.backgroundImage`. * @since 6.5.0 Added `background.backgroundSize` and `dimensions.aspectRatio`. * @var array */ const APPEARANCE_TOOLS_OPT_INS = array(array('background', 'backgroundImage'), array('background', 'backgroundSize'), array('border', 'color'), array('border', 'radius'), array('border', 'style'), array('border', 'width'), array('color', 'link'), array('color', 'heading'), array('color', 'button'), array('color', 'caption'), array('dimensions', 'aspectRatio'), array('dimensions', 'minHeight'), array('position', 'sticky'), array('spacing', 'blockGap'), array('spacing', 'margin'), array('spacing', 'padding'), array('typography', 'lineHeight')); /** * The latest version of the schema in use. * * @since 5.8.0 * @since 5.9.0 Changed value from 1 to 2. * @since 6.6.0 Changed value from 2 to 3. * @var int */ const LATEST_SCHEMA = 3; /** * Constructor. * * @since 5.8.0 * @since 6.6.0 Key spacingScale by origin, and Pre-generate the spacingSizes from spacingScale. * Added unwrapping of shared block style variations into block type variations if registered. * * @param array $theme_json A structure that follows the theme.json schema. * @param string $origin Optional. What source of data this object represents. * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'. * @phpstan-param 'blocks'|'default'|'theme'|'custom' $origin */ public function __construct($theme_json = array('version' => self::LATEST_SCHEMA), $origin = 'theme') { } /** * Enables some opt-in settings if theme declared support. * * @since 5.9.0 * * @param array $theme_json A theme.json structure to modify. * @return array The modified theme.json structure. */ protected static function maybe_opt_in_into_settings($theme_json) { } /** * Enables some settings. * * @since 5.9.0 * * @param array $context The context to which the settings belong. */ protected static function do_opt_in_into_settings(&$context) { } /** * Sanitizes the input according to the schemas. * * @since 5.8.0 * @since 5.9.0 Added the `$valid_block_names` and `$valid_element_name` parameters. * @since 6.3.0 Added the `$valid_variations` parameter. * @since 6.6.0 Updated schema to allow extended block style variations. * * @param array $input Structure to sanitize. * @param array $valid_block_names List of valid block names. * @param array $valid_element_names List of valid element names. * @param array $valid_variations List of valid variations per block. * @return array The sanitized output. */ protected static function sanitize($input, $valid_block_names, $valid_element_names, $valid_variations) { } /** * Appends a sub-selector to an existing one. * * Given the compounded $selector "h1, h2, h3" * and the $to_append selector ".some-class" the result will be * "h1.some-class, h2.some-class, h3.some-class". * * @since 5.8.0 * @since 6.1.0 Added append position. * @since 6.3.0 Removed append position parameter. * * @param string $selector Original selector. * @param string $to_append Selector to append. * @return string The new selector. */ protected static function append_to_selector($selector, $to_append) { } /** * Prepends a sub-selector to an existing one. * * Given the compounded $selector "h1, h2, h3" * and the $to_prepend selector ".some-class " the result will be * ".some-class h1, .some-class h2, .some-class h3". * * @since 6.3.0 * * @param string $selector Original selector. * @param string $to_prepend Selector to prepend. * @return string The new selector. */ protected static function prepend_to_selector($selector, $to_prepend) { } /** * Returns the metadata for each block. * * Example: * * { * 'core/paragraph': { * 'selector': 'p', * 'elements': { * 'link' => 'link selector', * 'etc' => 'element selector' * } * }, * 'core/heading': { * 'selector': 'h1', * 'elements': {} * }, * 'core/image': { * 'selector': '.wp-block-image', * 'duotone': 'img', * 'elements': {} * } * } * * @since 5.8.0 * @since 5.9.0 Added `duotone` key with CSS selector. * @since 6.1.0 Added `features` key with block support feature level selectors. * @since 6.3.0 Refactored and stabilized selectors API. * @since 6.6.0 Updated to include block style variations from the block styles registry. * * @return array Block metadata. */ protected static function get_blocks_metadata() { } /** * Given a tree, removes the keys that are not present in the schema. * * It is recursive and modifies the input in-place. * * @since 5.8.0 * * @param array $tree Input to process. * @param array $schema Schema to adhere to. * @return array The modified $tree. */ protected static function remove_keys_not_in_schema($tree, $schema) { } /** * Returns the existing settings for each block. * * Example: * * { * 'root': { * 'color': { * 'custom': true * } * }, * 'core/paragraph': { * 'spacing': { * 'customPadding': true * } * } * } * * @since 5.8.0 * * @return array Settings per block. */ public function get_settings() { } /** * Returns the stylesheet that results of processing * the theme.json structure this object represents. * * @since 5.8.0 * @since 5.9.0 Removed the `$type` parameter, added the `$types` and `$origins` parameters. * @since 6.3.0 Add fallback layout styles for Post Template when block gap support isn't available. * @since 6.6.0 Added boolean `skip_root_layout_styles` and `include_block_style_variations` options * to control styles output as desired. * * @param string[] $types Types of styles to load. Will load all by default. It accepts: * - `variables`: only the CSS Custom Properties for presets & custom ones. * - `styles`: only the styles section in theme.json. * - `presets`: only the classes for the presets. * @param string[] $origins A list of origins to include. By default it includes VALID_ORIGINS. * @param array $options { * Optional. An array of options for now used for internal purposes only (may change without notice). * * @type string $scope Makes sure all style are scoped to a given selector * @type string $root_selector Overwrites and forces a given selector to be used on the root node * @type bool $skip_root_layout_styles Omits root layout styles from the generated stylesheet. Default false. * @type bool $include_block_style_variations Includes styles for block style variations in the generated stylesheet. Default false. * } * @return string The resulting stylesheet. * @phpstan-param array{ * scope?: string, * root_selector?: string, * skip_root_layout_styles?: bool, * include_block_style_variations?: bool, * } $options */ public function get_stylesheet($types = array('variables', 'styles', 'presets'), $origins = \null, $options = array()) { } /** * Processes the CSS, to apply nesting. * * @since 6.2.0 * @since 6.6.0 Enforced 0-1-0 specificity for block custom CSS selectors. * * @param string $css The CSS to process. * @param string $selector The selector to nest. * @return string The processed CSS. */ protected function process_blocks_custom_css($css, $selector) { } /** * Returns the global styles custom CSS. * * @since 6.2.0 * @deprecated 6.7.0 Use {@see 'get_stylesheet'} instead. * * @return string The global styles custom CSS. */ public function get_custom_css() { } /** * Returns the page templates of the active theme. * * @since 5.9.0 * * @return array */ public function get_custom_templates() { } /** * Returns the template part data of active theme. * * @since 5.9.0 * * @return array */ public function get_template_parts() { } /** * Converts each style section into a list of rulesets * containing the block styles to be appended to the stylesheet. * * See glossary at https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax * * For each section this creates a new ruleset such as: * * block-selector { * style-property-one: value; * } * * @since 5.8.0 As `get_block_styles()`. * @since 5.9.0 Renamed from `get_block_styles()` to `get_block_classes()` * and no longer returns preset classes. * Removed the `$setting_nodes` parameter. * @since 6.1.0 Moved most internal logic to `get_styles_for_block()`. * * @param array $style_nodes Nodes with styles. * @return string The new stylesheet. */ protected function get_block_classes($style_nodes) { } /** * Gets the CSS layout rules for a particular block from theme.json layout definitions. * * @since 6.1.0 * @since 6.3.0 Reduced specificity for layout margin rules. * @since 6.5.1 Only output rules referencing content and wide sizes when values exist. * @since 6.5.3 Add types parameter to check if only base layout styles are needed. * @since 6.6.0 Updated layout style specificity to be compatible with overall 0-1-0 specificity in global styles. * * @param array $block_metadata Metadata about the block to get styles for. * @param array $types Optional. Types of styles to output. If empty, all styles will be output. * @return string Layout styles for the block. */ protected function get_layout_styles($block_metadata, $types = array()) { } /** * Creates new rulesets as classes for each preset value such as: * * .has-value-color { * color: value; * } * * .has-value-background-color { * background-color: value; * } * * .has-value-font-size { * font-size: value; * } * * .has-value-gradient-background { * background: value; * } * * p.has-value-gradient-background { * background: value; * } * * @since 5.9.0 * * @param array $setting_nodes Nodes with settings. * @param string[] $origins List of origins to process presets from. * @return string The new stylesheet. */ protected function get_preset_classes($setting_nodes, $origins) { } /** * Converts each styles section into a list of rulesets * to be appended to the stylesheet. * These rulesets contain all the css variables (custom variables and preset variables). * * See glossary at https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax * * For each section this creates a new ruleset such as: * * block-selector { * --wp--preset--category--slug: value; * --wp--custom--variable: value; * } * * @since 5.8.0 * @since 5.9.0 Added the `$origins` parameter. * * @param array $nodes Nodes with settings. * @param string[] $origins List of origins to process. * @return string The new stylesheet. */ protected function get_css_variables($nodes, $origins) { } /** * Given a selector and a declaration list, * creates the corresponding ruleset. * * @since 5.8.0 * * @param string $selector CSS selector. * @param array $declarations List of declarations. * @return string The resulting CSS ruleset. */ protected static function to_ruleset($selector, $declarations) { } /** * Given a settings array, returns the generated rulesets * for the preset classes. * * @since 5.8.0 * @since 5.9.0 Added the `$origins` parameter. * @since 6.6.0 Added check for root CSS properties selector. * * @param array $settings Settings to process. * @param string $selector Selector wrapping the classes. * @param string[] $origins List of origins to process. * @return string The result of processing the presets. */ protected static function compute_preset_classes($settings, $selector, $origins) { } /** * Function that scopes a selector with another one. This works a bit like * SCSS nesting except the `&` operator isn't supported. * * <code> * $scope = '.a, .b .c'; * $selector = '> .x, .y'; * $merged = scope_selector( $scope, $selector ); * // $merged is '.a > .x, .a .y, .b .c > .x, .b .c .y' * </code> * * @since 5.9.0 * @since 6.6.0 Added early return if missing scope or selector. * * @param string $scope Selector to scope to. * @param string $selector Original selector. * @return string Scoped selector. */ public static function scope_selector($scope, $selector) { } /** * Scopes the selectors for a given style node. * * This includes the primary selector, i.e. `$node['selector']`, as well as any custom * selectors for features and subfeatures, e.g. `$node['selectors']['border']` etc. * * @since 6.6.0 * * @param string $scope Selector to scope to. * @param array $node Style node with selectors to scope. * @return array Node with updated selectors. */ protected static function scope_style_node_selectors($scope, $node) { } /** * Gets preset values keyed by slugs based on settings and metadata. * * <code> * $settings = array( * 'typography' => array( * 'fontFamilies' => array( * array( * 'slug' => 'sansSerif', * 'fontFamily' => '"Helvetica Neue", sans-serif', * ), * array( * 'slug' => 'serif', * 'colors' => 'Georgia, serif', * ) * ), * ), * ); * $meta = array( * 'path' => array( 'typography', 'fontFamilies' ), * 'value_key' => 'fontFamily', * ); * $values_by_slug = get_settings_values_by_slug(); * // $values_by_slug === array( * // 'sans-serif' => '"Helvetica Neue", sans-serif', * // 'serif' => 'Georgia, serif', * // ); * </code> * * @since 5.9.0 * @since 6.6.0 Passing $settings to the callbacks defined in static::PRESETS_METADATA. * * @param array $settings Settings to process. * @param array $preset_metadata One of the PRESETS_METADATA values. * @param string[] $origins List of origins to process. * @return array Array of presets where each key is a slug and each value is the preset value. */ protected static function get_settings_values_by_slug($settings, $preset_metadata, $origins) { } /** * Similar to get_settings_values_by_slug, but doesn't compute the value. * * @since 5.9.0 * * @param array $settings Settings to process. * @param array $preset_metadata One of the PRESETS_METADATA values. * @param string[] $origins List of origins to process. * @return array Array of presets where the key and value are both the slug. */ protected static function get_settings_slugs($settings, $preset_metadata, $origins = \null) { } /** * Transforms a slug into a CSS Custom Property. * * @since 5.9.0 * * @param string $input String to replace. * @param string $slug The slug value to use to generate the custom property. * @return string The CSS Custom Property. Something along the lines of `--wp--preset--color--black`. */ protected static function replace_slug_in_string($input, $slug) { } /** * Given the block settings, extracts the CSS Custom Properties * for the presets and adds them to the $declarations array * following the format: * * array( * 'name' => 'property_name', * 'value' => 'property_value, * ) * * @since 5.8.0 * @since 5.9.0 Added the `$origins` parameter. * * @param array $settings Settings to process. * @param string[] $origins List of origins to process. * @return array The modified $declarations. */ protected static function compute_preset_vars($settings, $origins) { } /** * Given an array of settings, extracts the CSS Custom Properties * for the custom values and adds them to the $declarations * array following the format: * * array( * 'name' => 'property_name', * 'value' => 'property_value, * ) * * @since 5.8.0 * * @param array $settings Settings to process. * @return array The modified $declarations. */ protected static function compute_theme_vars($settings) { } /** * Given a tree, it creates a flattened one * by merging the keys and binding the leaf values * to the new keys. * * It also transforms camelCase names into kebab-case * and substitutes '/' by '-'. * * This is thought to be useful to generate * CSS Custom Properties from a tree, * although there's nothing in the implementation * of this function that requires that format. * * For example, assuming the given prefix is '--wp' * and the token is '--', for this input tree: * * { * 'some/property': 'value', * 'nestedProperty': { * 'sub-property': 'value' * } * } * * it'll return this output: * * { * '--wp--some-property': 'value', * '--wp--nested-property--sub-property': 'value' * } * * @since 5.8.0 * * @param array $tree Input tree to process. * @param string $prefix Optional. Prefix to prepend to each variable. Default empty string. * @param string $token Optional. Token to use between levels. Default '--'. * @return array The flattened tree. */ protected static function flatten_tree($tree, $prefix = '', $token = '--') { } /** * Given a styles array, it extracts the style properties * and adds them to the $declarations array following the format: * * array( * 'name' => 'property_name', * 'value' => 'property_value', * ) * * @since 5.8.0 * @since 5.9.0 Added the `$settings` and `$properties` parameters. * @since 6.1.0 Added `$theme_json`, `$selector`, and `$use_root_padding` parameters. * @since 6.5.0 Output a `min-height: unset` rule when `aspect-ratio` is set. * @since 6.6.0 Pass current theme JSON settings to wp_get_typography_font_size_value(), and process background properties. * @since 6.7.0 `ref` resolution of background properties, and assigning custom default values. * * @param array $styles Styles to process. * @param array $settings Theme settings. * @param array $properties Properties metadata. * @param array $theme_json Theme JSON array. * @param string $selector The style block selector. * @param boolean $use_root_padding Whether to add custom properties at root level. * @return array Returns the modified $declarations. */ protected static function compute_style_properties($styles, $settings = array(), $properties = \null, $theme_json = \null, $selector = \null, $use_root_padding = \null) { } /** * Returns the style property for the given path. * * It also converts references to a path to the value * stored at that location, e.g. * { "ref": "style.color.background" } => "#fff". * * @since 5.8.0 * @since 5.9.0 Added support for values of array type, which are returned as is. * @since 6.1.0 Added the `$theme_json` parameter. * @since 6.3.0 It no longer converts the internal format "var:preset|color|secondary" * to the standard form "--wp--preset--color--secondary". * This is already done by the sanitize method, * so every property will be in the standard form. * @since 6.7.0 Added support for background image refs. * * @param array $styles Styles subtree. * @param array $path Which property to process. * @param array $theme_json Theme JSON array. * @return string|array Style property value. */ protected static function get_property_value($styles, $path, $theme_json = \null) { } /** * Builds metadata for the setting nodes, which returns in the form of: * * [ * [ * 'path' => ['path', 'to', 'some', 'node' ], * 'selector' => 'CSS selector for some node' * ], * [ * 'path' => [ 'path', 'to', 'other', 'node' ], * 'selector' => 'CSS selector for other node' * ], * ] * * @since 5.8.0 * * @param array $theme_json The tree to extract setting nodes from. * @param array $selectors List of selectors per block. * @return array An array of setting nodes metadata. */ protected static function get_setting_nodes($theme_json, $selectors = array()) { } /** * Builds metadata for the style nodes, which returns in the form of: * * [ * [ * 'path' => [ 'path', 'to', 'some', 'node' ], * 'selector' => 'CSS selector for some node', * 'duotone' => 'CSS selector for duotone for some node' * ], * [ * 'path' => ['path', 'to', 'other', 'node' ], * 'selector' => 'CSS selector for other node', * 'duotone' => null * ], * ] * * @since 5.8.0 * @since 6.6.0 Added options array for modifying generated nodes. * * @param array $theme_json The tree to extract style nodes from. * @param array $selectors List of selectors per block. * @param array $options { * Optional. An array of options for now used for internal purposes only (may change without notice). * * @type bool $include_block_style_variations Includes style nodes for block style variations. Default false. * } * @return array An array of style nodes metadata. * @phpstan-param array{ * include_block_style_variations?: bool, * } $options */ protected static function get_style_nodes($theme_json, $selectors = array(), $options = array()) { } /** * A public helper to get the block nodes from a theme.json file. * * @since 6.1.0 * * @return array The block nodes in theme.json. */ public function get_styles_block_nodes() { } /** * Gets the CSS rules for a particular block from theme.json. * * @since 6.1.0 * @since 6.6.0 Setting a min-height of HTML when root styles have a background gradient or image. * Updated general global styles specificity to 0-1-0. * Fixed custom CSS output in block style variations. * * @param array $block_metadata Metadata about the block to get styles for. * * @return string Styles for the block. */ public function get_styles_for_block($block_metadata) { } /** * Outputs the CSS for layout rules on the root. * * @since 6.1.0 * @since 6.6.0 Use `ROOT_CSS_PROPERTIES_SELECTOR` for CSS custom properties and improved consistency of root padding rules. * Updated specificity of body margin reset and first/last child selectors. * * @param string $selector The root node selector. * @param array $block_metadata The metadata for the root block. * @return string The additional root rules CSS. */ public function get_root_layout_rules($selector, $block_metadata) { } /** * For metadata values that can either be booleans or paths to booleans, gets the value. * * $data = array( * 'color' => array( * 'defaultPalette' => true * ) * ); * * static::get_metadata_boolean( $data, false ); * // => false * * static::get_metadata_boolean( $data, array( 'color', 'defaultPalette' ) ); * // => true * * @since 6.0.0 * * @param array $data The data to inspect. * @param bool|array $path Boolean or path to a boolean. * @param bool $default_value Default value if the referenced path is missing. * Default false. * @return bool Value of boolean metadata. */ protected static function get_metadata_boolean($data, $path, $default_value = \false) { } /** * Merges new incoming data. * * @since 5.8.0 * @since 5.9.0 Duotone preset also has origins. * @since 6.7.0 Replace background image objects during merge. * * @param WP_Theme_JSON $incoming Data to merge. */ public function merge($incoming) { } /** * Converts all filter (duotone) presets into SVGs. * * @since 5.9.1 * * @param array $origins List of origins to process. * @return string SVG filters. */ public function get_svg_filters($origins) { } /** * Determines whether a presets should be overridden or not. * * @since 5.9.0 * @deprecated 6.0.0 Use {@see 'get_metadata_boolean'} instead. * * @param array $theme_json The theme.json like structure to inspect. * @param array $path Path to inspect. * @param bool|array $override Data to compute whether to override the preset. * @return bool */ protected static function should_override_preset($theme_json, $path, $override) { } /** * Returns the default slugs for all the presets in an associative array * whose keys are the preset paths and the leaves is the list of slugs. * * For example: * * array( * 'color' => array( * 'palette' => array( 'slug-1', 'slug-2' ), * 'gradients' => array( 'slug-3', 'slug-4' ), * ), * ) * * @since 5.9.0 * * @param array $data A theme.json like structure. * @param array $node_path The path to inspect. It's 'settings' by default. * @return array */ protected static function get_default_slugs($data, $node_path) { } /** * Gets a `default`'s preset name by a provided slug. * * @since 5.9.0 * * @param string $slug The slug we want to find a match from default presets. * @param array $base_path The path to inspect. It's 'settings' by default. * @return string|null */ protected function get_name_from_defaults($slug, $base_path) { } /** * Removes the preset values whose slug is equal to any of given slugs. * * @since 5.9.0 * * @param array $node The node with the presets to validate. * @param array $slugs The slugs that should not be overridden. * @return array The new node. */ protected static function filter_slugs($node, $slugs) { } /** * Removes insecure data from theme.json. * * @since 5.9.0 * @since 6.3.2 Preserves global styles block variations when securing styles. * @since 6.6.0 Updated to allow variation element styles and $origin parameter. * * @param array $theme_json Structure to sanitize. * @param string $origin Optional. What source of data this object represents. * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'. * @return array Sanitized structure. * @phpstan-param 'blocks'|'default'|'theme'|'custom' $origin */ public static function remove_insecure_properties($theme_json, $origin = 'theme') { } /** * Processes a setting node and returns the same node * without the insecure settings. * * @since 5.9.0 * * @param array $input Node to process. * @return array */ protected static function remove_insecure_settings($input) { } /** * Processes a style node and returns the same node * without the insecure styles. * * @since 5.9.0 * * @param array $input Node to process. * @return array */ protected static function remove_insecure_styles($input) { } /** * Checks that a declaration provided by the user is safe. * * @since 5.9.0 * * @param string $property_name Property name in a CSS declaration, i.e. the `color` in `color: red`. * @param string $property_value Value in a CSS declaration, i.e. the `red` in `color: red`. * @return bool */ protected static function is_safe_css_declaration($property_name, $property_value) { } /** * Returns the raw data. * * @since 5.8.0 * * @return array Raw data. */ public function get_raw_data() { } /** * Transforms the given editor settings according the * add_theme_support format to the theme.json format. * * @since 5.8.0 * * @param array $settings Existing editor settings. * @return array Config that adheres to the theme.json schema. */ public static function get_from_editor_settings($settings) { } /** * Returns the current theme's wanted patterns(slugs) to be * registered from Pattern Directory. * * @since 6.0.0 * * @return string[] */ public function get_patterns() { } /** * Returns a valid theme.json as provided by a theme. * * Unlike get_raw_data() this returns the presets flattened, as provided by a theme. * This also uses appearanceTools instead of their opt-ins if all of them are true. * * @since 6.0.0 * * @return array */ public function get_data() { } /** * Sets the spacingSizes array based on the spacingScale values from theme.json. * * @since 6.1.0 * @deprecated 6.6.0 No longer used as the spacingSizes are automatically * generated in the constructor and merge methods instead * of manually after instantiation. * * @return null|void */ public function set_spacing_sizes() { } /** * Returns the selectors metadata for a block. * * @since 6.3.0 * * @param object $block_type The block type. * @param string $root_selector The block's root selector. * * @return array The custom selectors set by the block. */ protected static function get_block_selectors($block_type, $root_selector) { } /** * Generates all the element selectors for a block. * * @since 6.3.0 * * @param string $root_selector The block's root CSS selector. * @return array The block's element selectors. */ protected static function get_block_element_selectors($root_selector) { } /** * Generates style declarations for a node's features e.g., color, border, * typography etc. that have custom selectors in their related block's * metadata. * * @since 6.3.0 * * @param object $metadata The related block metadata containing selectors. * @param object $node A merged theme.json node for block or variation. * * @return array The style declarations for the node's features with custom * selectors. */ protected function get_feature_declarations_for_node($metadata, &$node) { } /** * Resolves the values of CSS variables in the given styles. * * @since 6.3.0 * @param WP_Theme_JSON $theme_json The theme json resolver. * * @return WP_Theme_JSON The $theme_json with resolved variables. */ public static function resolve_variables($theme_json) { } /** * Generates a selector for a block style variation. * * @since 6.5.0 * * @param string $variation_name Name of the block style variation. * @param string $block_selector CSS selector for the block. * @return string Block selector with block style variation selector added to it. */ protected static function get_block_style_variation_selector($variation_name, $block_selector) { } /** * Collects valid block style variations keyed by block type. * * @since 6.6.0 * * @return array Valid block style variations by block type. */ protected static function get_valid_block_style_variations() { } } /** * WP_Theme Class * * @package WordPress * @subpackage Theme * @since 3.4.0 * @phpstan-type ThemeKey 'Name'|'Version'|'Status'|'Title'|'Author'|'Author Name'|'Author URI'|'Description'|'Template'|'Stylesheet'|'Template Files'|'Stylesheet Files'|'Template Dir'|'Stylesheet Dir'|'Screenshot'|'Tags'|'Theme Root'|'Theme Root URI'|'Parent Theme' * @phpstan-property-read string $name * @phpstan-property-read string $title * @phpstan-property-read string $version * @phpstan-property-read string $parent_theme * @phpstan-property-read string $template_dir * @phpstan-property-read string $stylesheet_dir * @phpstan-property-read string $template * @phpstan-property-read string $stylesheet * @phpstan-property-read string $screenshot * @phpstan-property-read string $description * @phpstan-property-read string $author * @phpstan-property-read list<string> $tags * @phpstan-property-read string $theme_root * @phpstan-property-read string $theme_root_uri */ #[\AllowDynamicProperties] final class WP_Theme implements \ArrayAccess { /** * Whether the theme has been marked as updateable. * * @since 4.4.0 * @var bool * * @see WP_MS_Themes_List_Table */ public $update = \false; /** * Constructor for WP_Theme. * * @since 3.4.0 * * @global array $wp_theme_directories * * @param string $theme_dir Directory of the theme within the theme_root. * @param string $theme_root Theme root. * @param WP_Theme|null $_child If this theme is a parent theme, the child may be passed for validation purposes. * @phpstan-return void */ public function __construct($theme_dir, $theme_root, $_child = \null) { } /** * When converting the object to a string, the theme name is returned. * * @since 3.4.0 * * @return string Theme name, ready for display (translated) */ public function __toString() { } /** * __isset() magic method for properties formerly returned by current_theme_info() * * @since 3.4.0 * * @param string $offset Property to check if set. * @return bool Whether the given property is set. */ public function __isset($offset) { } /** * __get() magic method for properties formerly returned by current_theme_info() * * @since 3.4.0 * * @param string $offset Property to get. * @return mixed Property value. */ public function __get($offset) { } /** * Method to implement ArrayAccess for keys formerly returned by get_themes() * * @since 3.4.0 * * @param mixed $offset * @param mixed $value */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } /** * Method to implement ArrayAccess for keys formerly returned by get_themes() * * @since 3.4.0 * * @param mixed $offset */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { } /** * Method to implement ArrayAccess for keys formerly returned by get_themes() * * @since 3.4.0 * * @param mixed $offset * @return bool * @phpstan-return ($offset is ThemeKey ? true : false) */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Method to implement ArrayAccess for keys formerly returned by get_themes(). * * Author, Author Name, Author URI, and Description did not previously return * translated data. We are doing so now as it is safe to do. However, as * Name and Title could have been used as the key for get_themes(), both remain * untranslated for back compatibility. This means that ['Name'] is not ideal, * and care should be taken to use `$theme::display( 'Name' )` to get a properly * translated header. * * @since 3.4.0 * * @param mixed $offset * @return mixed * @phpstan-return ($offset is ThemeKey ? mixed : null) */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } /** * Returns errors property. * * @since 3.4.0 * * @return WP_Error|false WP_Error if there are errors, or false. */ public function errors() { } /** * Determines whether the theme exists. * * A theme with errors exists. A theme with the error of 'theme_not_found', * meaning that the theme's directory was not found, does not exist. * * @since 3.4.0 * * @return bool Whether the theme exists. */ public function exists() { } /** * Returns reference to the parent theme. * * @since 3.4.0 * * @return WP_Theme|false Parent theme, or false if the active theme is not a child theme. */ public function parent() { } /** * Perform reinitialization tasks. * * Prevents a callback from being injected during unserialization of an object. */ public function __wakeup() { } /** * Clears the cache for the theme. * * @since 3.4.0 */ public function cache_delete() { } /** * Gets a raw, unformatted theme header. * * The header is sanitized, but is not translated, and is not marked up for display. * To get a theme header for display, use the display() method. * * Use the get_template() method, not the 'Template' header, for finding the template. * The 'Template' header is only good for what was written in the style.css, while * get_template() takes into account where WordPress actually located the theme and * whether it is actually valid. * * @since 3.4.0 * * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags. * @return string|array|false String or array (for Tags header) on success, false on failure. * @phpstan-return ($header is 'Name'|'ThemeURI'|'Description'|'Author'|'AuthorURI'|'Version'|'Template'|'Status'|'Tags'|'TextDomain'|'DomainPath'|'RequiresWP'|'RequiresPHP'|'UpdateURI' ? ($header is 'Tags' ? string[] : string) : false) */ public function get($header) { } /** * Gets a theme header, formatted and translated for display. * * @since 3.4.0 * * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags. * @param bool $markup Optional. Whether to mark up the header. Defaults to true. * @param bool $translate Optional. Whether to translate the header. Defaults to true. * @return string|array|false Processed header. An array for Tags if `$markup` is false, string otherwise. * False on failure. */ public function display($header, $markup = \true, $translate = \true) { } /** * Returns the directory name of the theme's "stylesheet" files, inside the theme root. * * In the case of a child theme, this is directory name of the child theme. * Otherwise, get_stylesheet() is the same as get_template(). * * @since 3.4.0 * * @return string Stylesheet */ public function get_stylesheet() { } /** * Returns the directory name of the theme's "template" files, inside the theme root. * * In the case of a child theme, this is the directory name of the parent theme. * Otherwise, the get_template() is the same as get_stylesheet(). * * @since 3.4.0 * * @return string Template */ public function get_template() { } /** * Returns the absolute path to the directory of a theme's "stylesheet" files. * * In the case of a child theme, this is the absolute path to the directory * of the child theme's files. * * @since 3.4.0 * * @return string Absolute path of the stylesheet directory. */ public function get_stylesheet_directory() { } /** * Returns the absolute path to the directory of a theme's "template" files. * * In the case of a child theme, this is the absolute path to the directory * of the parent theme's files. * * @since 3.4.0 * * @return string Absolute path of the template directory. */ public function get_template_directory() { } /** * Returns the URL to the directory of a theme's "stylesheet" files. * * In the case of a child theme, this is the URL to the directory of the * child theme's files. * * @since 3.4.0 * * @return string URL to the stylesheet directory. */ public function get_stylesheet_directory_uri() { } /** * Returns the URL to the directory of a theme's "template" files. * * In the case of a child theme, this is the URL to the directory of the * parent theme's files. * * @since 3.4.0 * * @return string URL to the template directory. */ public function get_template_directory_uri() { } /** * Returns the absolute path to the directory of the theme root. * * This is typically the absolute path to wp-content/themes. * * @since 3.4.0 * * @return string Theme root. */ public function get_theme_root() { } /** * Returns the URL to the directory of the theme root. * * This is typically the absolute URL to wp-content/themes. This forms the basis * for all other URLs returned by WP_Theme, so we pass it to the public function * get_theme_root_uri() and allow it to run the {@see 'theme_root_uri'} filter. * * @since 3.4.0 * * @return string Theme root URI. */ public function get_theme_root_uri() { } /** * Returns the main screenshot file for the theme. * * The main screenshot is called screenshot.png. gif and jpg extensions are also allowed. * * Screenshots for a theme must be in the stylesheet directory. (In the case of child * themes, parent theme screenshots are not inherited.) * * @since 3.4.0 * * @param string $uri Type of URL to return, either 'relative' or an absolute URI. Defaults to absolute URI. * @return string|false Screenshot file. False if the theme does not have a screenshot. */ public function get_screenshot($uri = 'uri') { } /** * Returns files in the theme's directory. * * @since 3.4.0 * * @param string[]|string $type Optional. Array of extensions to find, string of a single extension, * or null for all extensions. Default null. * @param int $depth Optional. How deep to search for files. Defaults to a flat scan (0 depth). * -1 depth is infinite. * @param bool $search_parent Optional. Whether to return parent files. Default false. * @return string[] Array of files, keyed by the path to the file relative to the theme's directory, with the values * being absolute paths. */ public function get_files($type = \null, $depth = 0, $search_parent = \false) { } /** * Returns the theme's post templates. * * @since 4.7.0 * @since 5.8.0 Include block templates. * * @return array[] Array of page template arrays, keyed by post type and filename, * with the value of the translated header name. */ public function get_post_templates() { } /** * Returns the theme's post templates for a given post type. * * @since 3.4.0 * @since 4.7.0 Added the `$post_type` parameter. * * @param WP_Post|null $post Optional. The post being edited, provided for context. * @param string $post_type Optional. Post type to get the templates for. Default 'page'. * If a post is provided, its post type is used. * @return string[] Array of template header names keyed by the template file name. */ public function get_page_templates($post = \null, $post_type = 'page') { } /** * Loads the theme's textdomain. * * Translation files are not inherited from the parent theme. TODO: If this fails for the * child theme, it should probably try to load the parent theme's translations. * * @since 3.4.0 * * @return bool True if the textdomain was successfully loaded or has already been loaded. * False if no textdomain was specified in the file headers, or if the domain could not be loaded. */ public function load_textdomain() { } /** * Determines whether the theme is allowed (multisite only). * * @since 3.4.0 * * @param string $check Optional. Whether to check only the 'network'-wide settings, the 'site' * settings, or 'both'. Defaults to 'both'. * @param int $blog_id Optional. Ignored if only network-wide settings are checked. Defaults to current site. * @return bool Whether the theme is allowed for the network. Returns true in single-site. */ public function is_allowed($check = 'both', $blog_id = \null) { } /** * Returns whether this theme is a block-based theme or not. * * @since 5.9.0 * * @return bool */ public function is_block_theme() { } /** * Retrieves the path of a file in the theme. * * Searches in the stylesheet directory before the template directory so themes * which inherit from a parent theme can just override one file. * * @since 5.9.0 * * @param string $file Optional. File to search for in the stylesheet directory. * @return string The path of the file. */ public function get_file_path($file = '') { } /** * Determines the latest WordPress default theme that is installed. * * This hits the filesystem. * * @since 4.4.0 * * @return WP_Theme|false Object, or false if no theme is installed, which would be bad. */ public static function get_core_default_theme() { } /** * Returns array of stylesheet names of themes allowed on the site or network. * * @since 3.4.0 * * @param int $blog_id Optional. ID of the site. Defaults to the current site. * @return string[] Array of stylesheet names. */ public static function get_allowed($blog_id = \null) { } /** * Returns array of stylesheet names of themes allowed on the network. * * @since 3.4.0 * * @return string[] Array of stylesheet names. */ public static function get_allowed_on_network() { } /** * Returns array of stylesheet names of themes allowed on the site. * * @since 3.4.0 * * @param int $blog_id Optional. ID of the site. Defaults to the current site. * @return string[] Array of stylesheet names. */ public static function get_allowed_on_site($blog_id = \null) { } /** * Returns the folder names of the block template directories. * * @since 6.4.0 * * @return string[] { * Folder names used by block themes. * * @type string $wp_template Theme-relative directory name for block templates. * @type string $wp_template_part Theme-relative directory name for block template parts. * } * @phpstan-return array{ * wp_template: string, * wp_template_part: string, * } */ public function get_block_template_folders() { } /** * Gets block pattern data for a specified theme. * Each pattern is defined as a PHP file and defines * its metadata using plugin-style headers. The minimum required definition is: * * /** * * Title: My Pattern * * Slug: my-theme/my-pattern * * * * The output of the PHP source corresponds to the content of the pattern, e.g.: * * <main><p><?php echo "Hello"; ?></p></main> * * If applicable, this will collect from both parent and child theme. * * Other settable fields include: * * - Description * - Viewport Width * - Inserter (yes/no) * - Categories (comma-separated values) * - Keywords (comma-separated values) * - Block Types (comma-separated values) * - Post Types (comma-separated values) * - Template Types (comma-separated values) * * @since 6.4.0 * * @return array Block pattern data. */ public function get_block_patterns() { } /** * Clears block pattern cache. * * @since 6.4.0 * @since 6.6.0 Uses transients to cache regardless of site environment. */ public function delete_pattern_cache() { } /** * Enables a theme for all sites on the current network. * * @since 4.6.0 * * @param string|string[] $stylesheets Stylesheet name or array of stylesheet names. * @phpstan-return void */ public static function network_enable_theme($stylesheets) { } /** * Disables a theme for all sites on the current network. * * @since 4.6.0 * * @param string|string[] $stylesheets Stylesheet name or array of stylesheet names. * @phpstan-return void */ public static function network_disable_theme($stylesheets) { } /** * Sorts themes by name. * * @since 3.4.0 * * @param WP_Theme[] $themes Array of theme objects to sort (passed by reference). */ public static function sort_by_name(&$themes) { } } /** * WP_Token_Map class. * * Use this class in specific circumstances with a static set of lookup keys which map to * a static set of transformed values. For example, this class is used to map HTML named * character references to their equivalent UTF-8 values. * * This class works differently than code calling `in_array()` and other methods. It * internalizes lookup logic and provides helper interfaces to optimize lookup and * transformation. It provides a method for precomputing the lookup tables and storing * them as PHP source code. * * All tokens and substitutions must be shorter than 256 bytes. * * Example: * * $smilies = WP_Token_Map::from_array( array( * '8O' => '😯', * ':(' => '🙁', * ':)' => '🙂', * ':?' => '😕', * ) ); * * true === $smilies->contains( ':)' ); * false === $smilies->contains( 'simile' ); * * '😕' === $smilies->read_token( 'Not sure :?.', 9, $length_of_smily_syntax ); * 2 === $length_of_smily_syntax; * * ## Precomputing the Token Map. * * Creating the class involves some work sorting and organizing the tokens and their * replacement values. In order to skip this, it's possible for the class to export * its state and be used as actual PHP source code. * * Example: * * // Export with four spaces as the indent, only for the sake of this docblock. * // The default indent is a tab character. * $indent = ' '; * echo $smilies->precomputed_php_source_table( $indent ); * * // Output, to be pasted into a PHP source file: * WP_Token_Map::from_precomputed_table( * array( * "storage_version" => "6.6.0", * "key_length" => 2, * "groups" => "", * "long_words" => array(), * "small_words" => "8O\x00:)\x00:(\x00:?\x00", * "small_mappings" => array( "😯", "🙂", "🙁", "😕" ) * ) * ); * * ## Large vs. small words. * * This class uses a short prefix called the "key" to optimize lookup of its tokens. * This means that some tokens may be shorter than or equal in length to that key. * Those words that are longer than the key are called "large" while those shorter * than or equal to the key length are called "small." * * This separation of large and small words is incidental to the way this class * optimizes lookup, and should be considered an internal implementation detail * of the class. It may still be important to be aware of it, however. * * ## Determining Key Length. * * The choice of the size of the key length should be based on the data being stored in * the token map. It should divide the data as evenly as possible, but should not create * so many groups that a large fraction of the groups only contain a single token. * * For the HTML5 named character references, a key length of 2 was found to provide a * sufficient spread and should be a good default for relatively large sets of tokens. * * However, for some data sets this might be too long. For example, a list of smilies * may be too small for a key length of 2. Perhaps 1 would be more appropriate. It's * best to experiment and determine empirically which values are appropriate. * * ## Generate Pre-Computed Source Code. * * Since the `WP_Token_Map` is designed for relatively static lookups, it can be * advantageous to precompute the values and instantiate a table that has already * sorted and grouped the tokens and built the lookup strings. * * This can be done with `WP_Token_Map::precomputed_php_source_table()`. * * Note that if there is a leading character that all tokens need, such as `&` for * HTML named character references, it can be beneficial to exclude this from the * token map. Instead, find occurrences of the leading character and then use the * token map to see if the following characters complete the token. * * Example: * * $map = WP_Token_Map::from_array( array( 'simple_smile:' => '🙂', 'sob:' => '😭', 'soba:' => '🍜' ) ); * echo $map->precomputed_php_source_table(); * // Output * WP_Token_Map::from_precomputed_table( * array( * "storage_version" => "6.6.0", * "key_length" => 2, * "groups" => "si\x00so\x00", * "long_words" => array( * // simple_smile:[🙂]. * "\x0bmple_smile:\x04🙂", * // soba:[🍜] sob:[😭]. * "\x03ba:\x04🍜\x02b:\x04😭", * ), * "short_words" => "", * "short_mappings" => array() * } * ); * * This precomputed value can be stored directly in source code and will skip the * startup cost of generating the lookup strings. See `$html5_named_character_entities`. * * Note that any updates to the precomputed format should update the storage version * constant. It would also be best to provide an update function to take older known * versions and upgrade them in place when loading into `from_precomputed_table()`. * * ## Future Direction. * * It may be viable to dynamically increase the length limits such that there's no need to impose them. * The limit appears because of the packing structure, which indicates how many bytes each segment of * text in the lookup tables spans. If, however, care were taken to track the longest word length, then * the packing structure could change its representation to allow for that. Each additional byte storing * length, however, increases the memory overhead and lookup runtime. * * An alternative approach could be to borrow the UTF-8 variable-length encoding and store lengths of less * than 127 as a single byte with the high bit unset, storing longer lengths as the combination of * continuation bytes. * * Since it has not been shown during the development of this class that longer strings are required, this * update is deferred until such a need is clear. * * @since 6.6.0 */ class WP_Token_Map { /** * Denotes the version of the code which produces pre-computed source tables. * * This version will be used not only to verify pre-computed data, but also * to upgrade pre-computed data from older versions. Choosing a name that * corresponds to the WordPress release will help people identify where an * old copy of data came from. */ const STORAGE_VERSION = '6.6.0-trunk'; /** * Maximum length for each key and each transformed value in the table (in bytes). * * @since 6.6.0 */ const MAX_LENGTH = 256; /** * Create a token map using an associative array of key/value pairs as the input. * * Example: * * $smilies = WP_Token_Map::from_array( array( * '8O' => '😯', * ':(' => '🙁', * ':)' => '🙂', * ':?' => '😕', * ) ); * * @since 6.6.0 * * @param array $mappings The keys transform into the values, both are strings. * @param int $key_length Determines the group key length. Leave at the default value * of 2 unless there's an empirical reason to change it. * * @return WP_Token_Map|null Token map, unless unable to create it. */ public static function from_array(array $mappings, int $key_length = 2) : ?\WP_Token_Map { } /** * Creates a token map from a pre-computed table. * This skips the initialization cost of generating the table. * * This function should only be used to load data created with * WP_Token_Map::precomputed_php_source_tag(). * * @since 6.6.0 * * @param array $state { * Stores pre-computed state for directly loading into a Token Map. * * @type string $storage_version Which version of the code produced this state. * @type int $key_length Group key length. * @type string $groups Group lookup index. * @type array $large_words Large word groups and packed strings. * @type string $small_words Small words packed string. * @type array $small_mappings Small word mappings. * } * * @return WP_Token_Map Map with precomputed data loaded. * @phpstan-param array{ * storage_version?: string, * key_length?: int, * groups?: string, * large_words?: array, * small_words?: string, * small_mappings?: array, * } $state */ public static function from_precomputed_table($state) : ?\WP_Token_Map { } /** * Indicates if a given word is a lookup key in the map. * * Example: * * true === $smilies->contains( ':)' ); * false === $smilies->contains( 'simile' ); * * @since 6.6.0 * * @param string $word Determine if this word is a lookup key in the map. * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. * @return bool Whether there's an entry for the given word in the map. */ public function contains(string $word, string $case_sensitivity = 'case-sensitive') : bool { } /** * If the text starting at a given offset is a lookup key in the map, * return the corresponding transformation from the map, else `false`. * * This function returns the translated string, but accepts an optional * parameter `$matched_token_byte_length`, which communicates how many * bytes long the lookup key was, if it found one. This can be used to * advance a cursor in calling code if a lookup key was found. * * Example: * * false === $smilies->read_token( 'Not sure :?.', 0, $token_byte_length ); * '😕' === $smilies->read_token( 'Not sure :?.', 9, $token_byte_length ); * 2 === $token_byte_length; * * Example: * * while ( $at < strlen( $input ) ) { * $next_at = strpos( $input, ':', $at ); * if ( false === $next_at ) { * break; * } * * $smily = $smilies->read_token( $input, $next_at, $token_byte_length ); * if ( false === $next_at ) { * ++$at; * continue; * } * * $prefix = substr( $input, $at, $next_at - $at ); * $at += $token_byte_length; * $output .= "{$prefix}{$smily}"; * } * * @since 6.6.0 * * @param string $text String in which to search for a lookup key. * @param int $offset Optional. How many bytes into the string where the lookup key ought to start. Default 0. * @param int|null &$matched_token_byte_length Optional. Holds byte-length of found token matched, otherwise not set. Default null. * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. * * @return string|null Mapped value of lookup key if found, otherwise `null`. */ public function read_token(string $text, int $offset = 0, &$matched_token_byte_length = \null, $case_sensitivity = 'case-sensitive') : ?string { } /** * Exports the token map into an associate array of key/value pairs. * * Example: * * $smilies->to_array() === array( * '8O' => '😯', * ':(' => '🙁', * ':)' => '🙂', * ':?' => '😕', * ); * * @return array The lookup key/substitution values as an associate array. */ public function to_array() : array { } /** * Export the token map for quick loading in PHP source code. * * This function has a specific purpose, to make loading of static token maps fast. * It's used to ensure that the HTML character reference lookups add a minimal cost * to initializing the PHP process. * * Example: * * echo $smilies->precomputed_php_source_table(); * * // Output. * WP_Token_Map::from_precomputed_table( * array( * "storage_version" => "6.6.0", * "key_length" => 2, * "groups" => "", * "long_words" => array(), * "small_words" => "8O\x00:)\x00:(\x00:?\x00", * "small_mappings" => array( "😯", "🙂", "🙁", "😕" ) * ) * ); * * @since 6.6.0 * * @param string $indent Optional. Use this string for indentation, or rely on the default horizontal tab character. Default "\t". * @return string Value which can be pasted into a PHP source file for quick loading of table. */ public function precomputed_php_source_table(string $indent = "\t") : string { } } /** * Meta-based user sessions token manager. * * @since 4.0.0 * * @see WP_Session_Tokens */ class WP_User_Meta_Session_Tokens extends \WP_Session_Tokens { /** * Retrieves all sessions of the user. * * @since 4.0.0 * * @return array Sessions of the user. */ protected function get_sessions() { } /** * Converts an expiration to an array of session information. * * @param mixed $session Session or expiration. * @return array Session. */ protected function prepare_session($session) { } /** * Retrieves a session based on its verifier (token hash). * * @since 4.0.0 * * @param string $verifier Verifier for the session to retrieve. * @return array|null The session, or null if it does not exist */ protected function get_session($verifier) { } /** * Updates a session based on its verifier (token hash). * * @since 4.0.0 * * @param string $verifier Verifier for the session to update. * @param array $session Optional. Session. Omitting this argument destroys the session. */ protected function update_session($verifier, $session = \null) { } /** * Updates the user's sessions in the usermeta table. * * @since 4.0.0 * * @param array $sessions Sessions. */ protected function update_sessions($sessions) { } /** * Destroys all sessions for this user, except the single session with the given verifier. * * @since 4.0.0 * * @param string $verifier Verifier of the session to keep. */ protected function destroy_other_sessions($verifier) { } /** * Destroys all session tokens for the user. * * @since 4.0.0 */ protected function destroy_all_sessions() { } /** * Destroys all sessions for all users. * * @since 4.0.0 */ public static function drop_sessions() { } } /** * Core class used for querying users. * * @since 3.1.0 * * @see WP_User_Query::prepare_query() for information on accepted arguments. */ #[\AllowDynamicProperties] class WP_User_Query { /** * Query vars, after parsing * * @since 3.5.0 * @var array */ public $query_vars = array(); /** * Metadata query container. * * @since 4.2.0 * @var WP_Meta_Query */ public $meta_query = \false; /** * The SQL query used to fetch matching users. * * @since 4.4.0 * @var string */ public $request; public $query_fields; public $query_from; public $query_where; public $query_orderby; public $query_limit; /** * Constructor. * * @since 3.1.0 * * @param null|string|array $query Optional. The query variables. * See WP_User_Query::prepare_query() for information on accepted arguments. * @phpstan-param array{ * blog_id?: int, * role?: string|string[], * role__in?: string[], * role__not_in?: string[], * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * capability?: string|string[], * capability__in?: string[], * capability__not_in?: string[], * include?: int[], * exclude?: int[], * search?: string, * search_columns?: string[], * orderby?: string|array, * order?: string, * offset?: int, * number?: int, * paged?: int, * count_total?: bool, * fields?: string|string[], * who?: string, * has_published_posts?: bool|string[], * nicename?: string, * nicename__in?: string[], * nicename__not_in?: string[], * login?: string, * login__in?: string[], * login__not_in?: string[], * cache_results?: bool, * } $query See WP_User_Query::prepare_query() */ public function __construct($query = \null) { } /** * Fills in missing query variables with default values. * * @since 4.4.0 * * @param string|array $args Query vars, as passed to `WP_User_Query`. * @return array Complete query variables with undefined ones filled in with defaults. */ public static function fill_query_vars($args) { } /** * Prepares the query variables. * * @since 3.1.0 * @since 4.1.0 Added the ability to order by the `include` value. * @since 4.2.0 Added 'meta_value_num' support for `$orderby` parameter. Added multi-dimensional array syntax * for `$orderby` parameter. * @since 4.3.0 Added 'has_published_posts' parameter. * @since 4.4.0 Added 'paged', 'role__in', and 'role__not_in' parameters. The 'role' parameter was updated to * permit an array or comma-separated list of values. The 'number' parameter was updated to support * querying for all users with using -1. * @since 4.7.0 Added 'nicename', 'nicename__in', 'nicename__not_in', 'login', 'login__in', * and 'login__not_in' parameters. * @since 5.1.0 Introduced the 'meta_compare_key' parameter. * @since 5.3.0 Introduced the 'meta_type_key' parameter. * @since 5.9.0 Added 'capability', 'capability__in', and 'capability__not_in' parameters. * Deprecated the 'who' parameter. * @since 6.3.0 Added 'cache_results' parameter. * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Roles $wp_roles WordPress role management object. * * @param string|array $query { * Optional. Array or string of query parameters. * * @type int $blog_id The site ID. Default is the current site. * @type string|string[] $role An array or a comma-separated list of role names that users * must match to be included in results. Note that this is * an inclusive list: users must match *each* role. Default empty. * @type string[] $role__in An array of role names. Matched users must have at least one * of these roles. Default empty array. * @type string[] $role__not_in An array of role names to exclude. Users matching one or more * of these roles will not be included in results. Default empty array. * @type string|string[] $meta_key Meta key or keys to filter by. * @type string|string[] $meta_value Meta value or values to filter by. * @type string $meta_compare MySQL operator used for comparing the meta value. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_compare_key MySQL operator used for comparing the meta key. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons. * See WP_Meta_Query::__construct() for accepted values and default value. * @type array $meta_query An associative array of WP_Meta_Query arguments. * See WP_Meta_Query::__construct() for accepted values. * @type string|string[] $capability An array or a comma-separated list of capability names that users * must match to be included in results. Note that this is * an inclusive list: users must match *each* capability. * Does NOT work for capabilities not in the database or filtered * via {@see 'map_meta_cap'}. Default empty. * @type string[] $capability__in An array of capability names. Matched users must have at least one * of these capabilities. * Does NOT work for capabilities not in the database or filtered * via {@see 'map_meta_cap'}. Default empty array. * @type string[] $capability__not_in An array of capability names to exclude. Users matching one or more * of these capabilities will not be included in results. * Does NOT work for capabilities not in the database or filtered * via {@see 'map_meta_cap'}. Default empty array. * @type int[] $include An array of user IDs to include. Default empty array. * @type int[] $exclude An array of user IDs to exclude. Default empty array. * @type string $search Search keyword. Searches for possible string matches on columns. * When `$search_columns` is left empty, it tries to determine which * column to search in based on search string. Default empty. * @type string[] $search_columns Array of column names to be searched. Accepts 'ID', 'user_login', * 'user_email', 'user_url', 'user_nicename', 'display_name'. * Default empty array. * @type string|array $orderby Field(s) to sort the retrieved users by. May be a single value, * an array of values, or a multi-dimensional array with fields as * keys and orders ('ASC' or 'DESC') as values. Accepted values are: * - 'ID' * - 'display_name' (or 'name') * - 'include' * - 'user_login' (or 'login') * - 'login__in' * - 'user_nicename' (or 'nicename') * - 'nicename__in' * - 'user_email (or 'email') * - 'user_url' (or 'url') * - 'user_registered' (or 'registered') * - 'post_count' * - 'meta_value' * - 'meta_value_num' * - The value of `$meta_key` * - An array key of `$meta_query` * To use 'meta_value' or 'meta_value_num', `$meta_key` * must be also be defined. Default 'user_login'. * @type string $order Designates ascending or descending order of users. Order values * passed as part of an `$orderby` array take precedence over this * parameter. Accepts 'ASC', 'DESC'. Default 'ASC'. * @type int $offset Number of users to offset in retrieved results. Can be used in * conjunction with pagination. Default 0. * @type int $number Number of users to limit the query for. Can be used in * conjunction with pagination. Value -1 (all) is supported, but * should be used with caution on larger sites. * Default -1 (all users). * @type int $paged When used with number, defines the page of results to return. * Default 1. * @type bool $count_total Whether to count the total number of users found. If pagination * is not needed, setting this to false can improve performance. * Default true. * @type string|string[] $fields Which fields to return. Single or all fields (string), or array * of fields. Accepts: * - 'ID' * - 'display_name' * - 'user_login' * - 'user_nicename' * - 'user_email' * - 'user_url' * - 'user_registered' * - 'user_pass' * - 'user_activation_key' * - 'user_status' * - 'spam' (only available on multisite installs) * - 'deleted' (only available on multisite installs) * - 'all' for all fields and loads user meta. * - 'all_with_meta' Deprecated. Use 'all'. * Default 'all'. * @type string $who Deprecated, use `$capability` instead. * Type of users to query. Accepts 'authors'. * Default empty (all users). * @type bool|string[] $has_published_posts Pass an array of post types to filter results to users who have * published posts in those post types. `true` is an alias for all * public post types. * @type string $nicename The user nicename. Default empty. * @type string[] $nicename__in An array of nicenames to include. Users matching one of these * nicenames will be included in results. Default empty array. * @type string[] $nicename__not_in An array of nicenames to exclude. Users matching one of these * nicenames will not be included in results. Default empty array. * @type string $login The user login. Default empty. * @type string[] $login__in An array of logins to include. Users matching one of these * logins will be included in results. Default empty array. * @type string[] $login__not_in An array of logins to exclude. Users matching one of these * logins will not be included in results. Default empty array. * @type bool $cache_results Whether to cache user information. Default true. * } * @phpstan-param array{ * blog_id?: int, * role?: string|string[], * role__in?: string[], * role__not_in?: string[], * meta_key?: string|string[], * meta_value?: string|string[], * meta_compare?: string, * meta_compare_key?: string, * meta_type?: string, * meta_type_key?: string, * meta_query?: array, * capability?: string|string[], * capability__in?: string[], * capability__not_in?: string[], * include?: int[], * exclude?: int[], * search?: string, * search_columns?: string[], * orderby?: string|array, * order?: string, * offset?: int, * number?: int, * paged?: int, * count_total?: bool, * fields?: string|string[], * who?: string, * has_published_posts?: bool|string[], * nicename?: string, * nicename__in?: string[], * nicename__not_in?: string[], * login?: string, * login__in?: string[], * login__not_in?: string[], * cache_results?: bool, * } $query */ public function prepare_query($query = array()) { } /** * Executes the query, with the current variables. * * @since 3.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * @phpstan-return void */ public function query() { } /** * Retrieves query variable. * * @since 3.5.0 * * @param string $query_var Query variable key. * @return mixed */ public function get($query_var) { } /** * Sets query variable. * * @since 3.5.0 * * @param string $query_var Query variable key. * @param mixed $value Query variable value. */ public function set($query_var, $value) { } /** * Used internally to generate an SQL string for searching across multiple columns. * * @since 3.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $search Search string. * @param string[] $columns Array of columns to search. * @param bool $wild Whether to allow wildcard searches. Default is false for Network Admin, true for single site. * Single site allows leading and trailing wildcards, Network Admin only trailing. * @return string */ protected function get_search_sql($search, $columns, $wild = \false) { } /** * Returns the list of users. * * @since 3.1.0 * * @return array Array of results. */ public function get_results() { } /** * Returns the total number of users for the current query. * * @since 3.1.0 * * @return int Number of total users. */ public function get_total() { } /** * Parses and sanitizes 'orderby' keys passed to the user query. * * @since 4.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $orderby Alias for the field to order by. * @return string Value to used in the ORDER clause, if `$orderby` is valid. */ protected function parse_orderby($orderby) { } /** * Generate cache key. * * @since 6.3.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args Query arguments. * @param string $sql SQL statement. * @return string Cache key. */ protected function generate_cache_key(array $args, $sql) { } /** * Parses an 'order' query variable and casts it to ASC or DESC as necessary. * * @since 4.2.0 * * @param string $order The 'order' query variable. * @return string The sanitized 'order' query variable. */ protected function parse_order($order) { } /** * Makes private properties readable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Getting a dynamic property is deprecated. * * @param string $name Property to get. * @return mixed Property. */ public function __get($name) { } /** * Makes private properties settable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Setting a dynamic property is deprecated. * * @param string $name Property to check if set. * @param mixed $value Property value. * @phpstan-return void */ public function __set($name, $value) { } /** * Makes private properties checkable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Checking a dynamic property is deprecated. * * @param string $name Property to check if set. * @return bool Whether the property is set. */ public function __isset($name) { } /** * Makes private properties un-settable for backward compatibility. * * @since 4.0.0 * @since 6.4.0 Unsetting a dynamic property is deprecated. * * @param string $name Property to unset. * @phpstan-return void */ public function __unset($name) { } /** * Makes private/protected methods readable for backward compatibility. * * @since 4.0.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } } /** * WP_User_Request class. * * Represents user request data loaded from a WP_Post object. * * @since 4.9.6 */ #[\AllowDynamicProperties] final class WP_User_Request { /** * Request ID. * * @since 4.9.6 * @var int */ public $ID = 0; /** * User ID. * * @since 4.9.6 * @var int */ public $user_id = 0; /** * User email. * * @since 4.9.6 * @var string */ public $email = ''; /** * Action name. * * @since 4.9.6 * @var string */ public $action_name = ''; /** * Current status. * * @since 4.9.6 * @var string */ public $status = ''; /** * Timestamp this request was created. * * @since 4.9.6 * @var int|null */ public $created_timestamp = \null; /** * Timestamp this request was last modified. * * @since 4.9.6 * @var int|null */ public $modified_timestamp = \null; /** * Timestamp this request was confirmed. * * @since 4.9.6 * @var int|null */ public $confirmed_timestamp = \null; /** * Timestamp this request was completed. * * @since 4.9.6 * @var int|null */ public $completed_timestamp = \null; /** * Misc data assigned to this request. * * @since 4.9.6 * @var array */ public $request_data = array(); /** * Key used to confirm this request. * * @since 4.9.6 * @var string */ public $confirm_key = ''; /** * Constructor. * * @since 4.9.6 * * @param WP_Post|object $post Post object. */ public function __construct($post) { } } /** * Core class used to implement the WP_User object. * * @since 2.0.0 * * @property string $nickname * @property string $description * @property string $user_description * @property string $first_name * @property string $user_firstname * @property string $last_name * @property string $user_lastname * @property string $user_login * @property string $user_pass * @property string $user_nicename * @property string $user_email * @property string $user_url * @property string $user_registered * @property string $user_activation_key * @property string $user_status * @property int $user_level * @property string $display_name * @property string $spam * @property string $deleted * @property string $locale * @property string $rich_editing * @property string $syntax_highlighting * @property string $use_ssl */ #[\AllowDynamicProperties] class WP_User { /** * User data container. * * @since 2.0.0 * @var stdClass */ public $data; /** * The user's ID. * * @since 2.1.0 * @var int */ public $ID = 0; /** * Capabilities that the individual user has been granted outside of those inherited from their role. * * @since 2.0.0 * @var bool[] Array of key/value pairs where keys represent a capability name * and boolean values represent whether the user has that capability. */ public $caps = array(); /** * User metadata option name. * * @since 2.0.0 * @var string */ public $cap_key; /** * The roles the user is part of. * * @since 2.0.0 * @var string[] */ public $roles = array(); /** * All capabilities the user has, including individual and role based. * * @since 2.0.0 * @var bool[] Array of key/value pairs where keys represent a capability name * and boolean values represent whether the user has that capability. */ public $allcaps = array(); /** * The filter context applied to user data fields. * * @since 2.9.0 * @var string */ public $filter = \null; /** * Constructor. * * Retrieves the userdata and passes it to WP_User::init(). * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|string|stdClass|WP_User $id User's ID, a WP_User object, or a user object from the DB. * @param string $name Optional. User's username * @param int $site_id Optional Site ID, defaults to current site. * @phpstan-return void */ public function __construct($id = 0, $name = '', $site_id = '') { } /** * Sets up object properties, including capabilities. * * @since 3.3.0 * * @param object $data User DB row object. * @param int $site_id Optional. The site ID to initialize for. */ public function init($data, $site_id = '') { } /** * Returns only the main user fields. * * @since 3.3.0 * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $field The field to query against: Accepts 'id', 'ID', 'slug', 'email' or 'login'. * @param string|int $value The field value. * @return object|false Raw user object. * @phpstan-param 'id'|'ID'|'slug'|'email'|'login' $field */ public static function get_data_by($field, $value) { } /** * Magic method for checking the existence of a certain custom field. * * @since 3.3.0 * * @param string $key User meta key to check if set. * @return bool Whether the given user meta key is set. */ public function __isset($key) { } /** * Magic method for accessing custom fields. * * @since 3.3.0 * * @param string $key User meta key to retrieve. * @return mixed Value of the given user meta key (if set). If `$key` is 'id', the user ID. */ public function __get($key) { } /** * Magic method for setting custom user fields. * * This method does not update custom fields in the database. It only stores * the value on the WP_User instance. * * @since 3.3.0 * * @param string $key User meta key. * @param mixed $value User meta value. * @phpstan-return void */ public function __set($key, $value) { } /** * Magic method for unsetting a certain custom field. * * @since 4.4.0 * * @param string $key User meta key to unset. */ public function __unset($key) { } /** * Determines whether the user exists in the database. * * @since 3.4.0 * * @return bool True if user exists in the database, false if not. */ public function exists() { } /** * Retrieves the value of a property or meta key. * * Retrieves from the users and usermeta table. * * @since 3.3.0 * * @param string $key Property * @return mixed */ public function get($key) { } /** * Determines whether a property or meta key is set. * * Consults the users and usermeta tables. * * @since 3.3.0 * * @param string $key Property. * @return bool */ public function has_prop($key) { } /** * Returns an array representation. * * @since 3.5.0 * * @return array Array representation. */ public function to_array() { } /** * Makes private/protected methods readable for backward compatibility. * * @since 4.3.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed|false Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } /** * Sets up capability object properties. * * Will set the value for the 'cap_key' property to current database table * prefix, followed by 'capabilities'. Will then check to see if the * property matching the 'cap_key' exists and is an array. If so, it will be * used. * * @since 2.1.0 * @deprecated 4.9.0 Use WP_User::for_site() * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $cap_key Optional capability key */ protected function _init_caps($cap_key = '') { } /** * Retrieves all of the capabilities of the user's roles, and merges them with * individual user capabilities. * * All of the capabilities of the user's roles are merged with the user's individual * capabilities. This means that the user can be denied specific capabilities that * their role might have, but the user is specifically denied. * * @since 2.0.0 * * @return bool[] Array of key/value pairs where keys represent a capability name * and boolean values represent whether the user has that capability. */ public function get_role_caps() { } /** * Adds role to user. * * Updates the user's meta data option with capabilities and roles. * * @since 2.0.0 * * @param string $role Role name. * @phpstan-return void */ public function add_role($role) { } /** * Removes role from user. * * @since 2.0.0 * * @param string $role Role name. * @phpstan-return void */ public function remove_role($role) { } /** * Sets the role of the user. * * This will remove the previous roles of the user and assign the user the * new one. You can set the role to an empty string and it will remove all * of the roles from the user. * * @since 2.0.0 * * @param string $role Role name. * @phpstan-return void */ public function set_role($role) { } /** * Chooses the maximum level the user has. * * Will compare the level from the $item parameter against the $max * parameter. If the item is incorrect, then just the $max parameter value * will be returned. * * Used to get the max level based on the capabilities the user has. This * is also based on roles, so if the user is assigned the Administrator role * then the capability 'level_10' will exist and the user will get that * value. * * @since 2.0.0 * * @param int $max Max level of user. * @param string $item Level capability name. * @return int Max Level. */ public function level_reduction($max, $item) { } /** * Updates the maximum user level for the user. * * Updates the 'user_level' user metadata (includes prefix that is the * database table prefix) with the maximum user level. Gets the value from * the all of the capabilities that the user has. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. */ public function update_user_level_from_caps() { } /** * Adds capability and grant or deny access to capability. * * @since 2.0.0 * * @param string $cap Capability name. * @param bool $grant Whether to grant capability to user. */ public function add_cap($cap, $grant = \true) { } /** * Removes capability from user. * * @since 2.0.0 * * @param string $cap Capability name. * @phpstan-return void */ public function remove_cap($cap) { } /** * Removes all of the capabilities of the user. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. */ public function remove_all_caps() { } /** * Returns whether the user has the specified capability. * * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`. * * Example usage: * * $user->has_cap( 'edit_posts' ); * $user->has_cap( 'edit_post', $post->ID ); * $user->has_cap( 'edit_post_meta', $post->ID, $meta_key ); * * While checking against a role in place of a capability is supported in part, this practice is discouraged as it * may produce unreliable results. * * @since 2.0.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * * @see map_meta_cap() * * @param string $cap Capability name. * @param mixed ...$args Optional further parameters, typically starting with an object ID. * @return bool Whether the user has the given capability, or, if an object ID is passed, whether the user has * the given capability for that object. */ public function has_cap($cap, ...$args) { } /** * Converts numeric level to level capability name. * * Prepends 'level_' to level number. * * @since 2.0.0 * * @param int $level Level number, 1 to 10. * @return string */ public function translate_level_to_cap($level) { } /** * Sets the site to operate on. Defaults to the current site. * * @since 3.0.0 * @deprecated 4.9.0 Use WP_User::for_site() * * @param int $blog_id Optional. Site ID, defaults to current site. */ public function for_blog($blog_id = '') { } /** * Sets the site to operate on. Defaults to the current site. * * @since 4.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $site_id Site ID to initialize user capabilities for. Default is the current site. */ public function for_site($site_id = '') { } /** * Gets the ID of the site for which the user's capabilities are currently initialized. * * @since 4.9.0 * * @return int Site ID. */ public function get_site_id() { } } /** * Singleton that registers and instantiates WP_Widget classes. * * @since 2.8.0 * @since 4.4.0 Moved to its own file from wp-includes/widgets.php */ #[\AllowDynamicProperties] class WP_Widget_Factory { /** * Widgets array. * * @since 2.8.0 * @var array * @phpstan-var array<string, \WP_Widget> */ public $widgets = array(); /** * PHP5 constructor. * * @since 4.3.0 */ public function __construct() { } /** * PHP4 constructor. * * @since 2.8.0 * @deprecated 4.3.0 Use __construct() instead. * * @see WP_Widget_Factory::__construct() */ public function WP_Widget_Factory() { } /** * Registers a widget subclass. * * @since 2.8.0 * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object * instead of simply a `WP_Widget` subclass name. * * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass. * @phpstan-param class-string<\WP_Widget>|\WP_Widget $widget */ public function register($widget) { } /** * Un-registers a widget subclass. * * @since 2.8.0 * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object * instead of simply a `WP_Widget` subclass name. * * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass. * @phpstan-param class-string<\WP_Widget>|\WP_Widget $widget */ public function unregister($widget) { } /** * Serves as a utility method for adding widgets to the registered widgets global. * * @since 2.8.0 * * @global array $wp_registered_widgets */ public function _register_widgets() { } /** * Returns the registered WP_Widget object for the given widget type. * * @since 5.8.0 * * @param string $id_base Widget type ID. * @return WP_Widget|null */ public function get_widget_object($id_base) { } /** * Returns the registered key for the given widget type. * * @since 5.8.0 * * @param string $id_base Widget type ID. * @return string */ public function get_widget_key($id_base) { } } /** * Core base class extended to register widgets. * * This class must be extended for each widget, and WP_Widget::widget() must be overridden. * * If adding widget options, WP_Widget::update() and WP_Widget::form() should also be overridden. * * @since 2.8.0 * @since 4.4.0 Moved to its own file from wp-includes/widgets.php * @phpstan-template T of array<string, mixed> */ #[\AllowDynamicProperties] class WP_Widget { /** * Root ID for all widgets of this type. * * @since 2.8.0 * @var mixed|string */ public $id_base; /** * Name for this widget type. * * @since 2.8.0 * @var string */ public $name; /** * Option name for this widget type. * * @since 2.8.0 * @var string */ public $option_name; /** * Alt option name for this widget type. * * @since 2.8.0 * @var string */ public $alt_option_name; /** * Option array passed to wp_register_sidebar_widget(). * * @since 2.8.0 * @var array */ public $widget_options; /** * Option array passed to wp_register_widget_control(). * * @since 2.8.0 * @var array */ public $control_options; /** * Unique ID number of the current instance. * * @since 2.8.0 * @var bool|int */ public $number = \false; /** * Unique ID string of the current instance (id_base-number). * * @since 2.8.0 * @var bool|string */ public $id = \false; /** * Whether the widget data has been updated. * * Set to true when the data is updated after a POST submit - ensures it does * not happen twice. * * @since 2.8.0 * @var bool */ public $updated = \false; /** * Echoes the widget content. * * Subclasses should override this function to generate their widget code. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance The settings for the particular instance of the widget. * @phpstan-param T $instance * @phpstan-param array{name:string,id:string,description:string,class:string,before_widget:string,after_widget:string,before_title:string,after_title:string,before_sidebar:string,after_sidebar:string,show_in_rest:boolean,widget_id:string,widget_name:string} $args */ public function widget($args, $instance) { } /** * Updates a particular instance of a widget. * * This function should check that `$new_instance` is set correctly. The newly-calculated * value of `$instance` should be returned. If false is returned, the instance won't be * saved/updated. * * @since 2.8.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Settings to save or bool false to cancel saving. * @phpstan-param T $new_instance * @phpstan-param T $old_instance */ public function update($new_instance, $old_instance) { } /** * Outputs the settings update form. * * @since 2.8.0 * * @param array $instance The settings for the particular instance of the widget. * @return string Default return is 'noform'. * @phpstan-param T $instance */ public function form($instance) { } /** * PHP5 constructor. * * @since 2.8.0 * * @param string $id_base Base ID for the widget, lowercase and unique. If left empty, * a portion of the widget's PHP class name will be used. Has to be unique. * @param string $name Name for the widget displayed on the configuration page. * @param array $widget_options Optional. Widget options. See wp_register_sidebar_widget() for * information on accepted arguments. Default empty array. * @param array $control_options Optional. Widget control options. See wp_register_widget_control() for * information on accepted arguments. Default empty array. * @phpstan-param array{ * classname?: string, * description?: string, * show_instance_in_rest?: bool, * } $widget_options See wp_register_sidebar_widget() * @phpstan-param array{ * height?: int, * width?: int, * id_base?: int|string, * } $control_options See wp_register_widget_control() */ public function __construct($id_base, $name, $widget_options = array(), $control_options = array()) { } /** * PHP4 constructor. * * @since 2.8.0 * @deprecated 4.3.0 Use __construct() instead. * * @see WP_Widget::__construct() * * @param string $id_base Base ID for the widget, lowercase and unique. If left empty, * a portion of the widget's PHP class name will be used. Has to be unique. * @param string $name Name for the widget displayed on the configuration page. * @param array $widget_options Optional. Widget options. See wp_register_sidebar_widget() for * information on accepted arguments. Default empty array. * @param array $control_options Optional. Widget control options. See wp_register_widget_control() for * information on accepted arguments. Default empty array. * @phpstan-param array{ * classname?: string, * description?: string, * show_instance_in_rest?: bool, * } $widget_options See wp_register_sidebar_widget() * @phpstan-param array{ * height?: int, * width?: int, * id_base?: int|string, * } $control_options See wp_register_widget_control() */ public function WP_Widget($id_base, $name, $widget_options = array(), $control_options = array()) { } /** * Constructs name attributes for use in form() fields * * This function should be used in form() methods to create name attributes for fields * to be saved by update() * * @since 2.8.0 * @since 4.4.0 Array format field names are now accepted. * * @param string $field_name Field name. * @return string Name attribute for `$field_name`. */ public function get_field_name($field_name) { } /** * Constructs id attributes for use in WP_Widget::form() fields. * * This function should be used in form() methods to create id attributes * for fields to be saved by WP_Widget::update(). * * @since 2.8.0 * @since 4.4.0 Array format field IDs are now accepted. * * @param string $field_name Field name. * @return string ID attribute for `$field_name`. */ public function get_field_id($field_name) { } /** * Register all widget instances of this widget class. * * @since 2.8.0 */ public function _register() { } /** * Sets the internal order number for the widget instance. * * @since 2.8.0 * * @param int $number The unique order number of this widget instance compared to other * instances of the same class. */ public function _set($number) { } /** * Retrieves the widget display callback. * * @since 2.8.0 * * @return callable Display callback. */ public function _get_display_callback() { } /** * Retrieves the widget update callback. * * @since 2.8.0 * * @return callable Update callback. */ public function _get_update_callback() { } /** * Retrieves the form callback. * * @since 2.8.0 * * @return callable Form callback. */ public function _get_form_callback() { } /** * Determines whether the current request is inside the Customizer preview. * * If true -- the current request is inside the Customizer preview, then * the object cache gets suspended and widgets should check this to decide * whether they should store anything persistently to the object cache, * to transients, or anywhere else. * * @since 3.9.0 * * @global WP_Customize_Manager $wp_customize * * @return bool True if within the Customizer preview, false if not. */ public function is_preview() { } /** * Generates the actual widget content (Do NOT override). * * Finds the instance and calls WP_Widget::widget(). * * @since 2.8.0 * * @param array $args Display arguments. See WP_Widget::widget() for information * on accepted arguments. * @param int|array $widget_args { * Optional. Internal order number of the widget instance, or array of multi-widget arguments. * Default 1. * * @type int $number Number increment used for multiples of the same widget. * } * @phpstan-param int|array{ * number?: int, * } $widget_args * @phpstan-return void */ public function display_callback($args, $widget_args = 1) { } /** * Handles changed settings (Do NOT override). * * @since 2.8.0 * * @global array $wp_registered_widgets * * @param int $deprecated Not used. * @phpstan-return void */ public function update_callback($deprecated = 1) { } /** * Generates the widget control form (Do NOT override). * * @since 2.8.0 * * @param int|array $widget_args { * Optional. Internal order number of the widget instance, or array of multi-widget arguments. * Default 1. * * @type int $number Number increment used for multiples of the same widget. * } * @return string|null * @phpstan-param int|array{ * number?: int, * } $widget_args */ public function form_callback($widget_args = 1) { } /** * Registers an instance of the widget class. * * @since 2.8.0 * * @param int $number Optional. The unique order number of this widget instance * compared to other instances of the same class. Default -1. */ public function _register_one($number = -1) { } /** * Saves the settings for all instances of the widget class. * * @since 2.8.0 * * @param array $settings Multi-dimensional array of widget instance settings. */ public function save_settings($settings) { } /** * Retrieves the settings for all instances of the widget class. * * @since 2.8.0 * * @return array Multi-dimensional array of widget instance settings. */ public function get_settings() { } } /** * WordPress XMLRPC server implementation. * * Implements compatibility for Blogger API, MetaWeblog API, MovableType, and * pingback. Additional WordPress API for managing comments, pages, posts, * options, etc. * * As of WordPress 3.5.0, XML-RPC is enabled by default. It can be disabled * via the {@see 'xmlrpc_enabled'} filter found in wp_xmlrpc_server::set_is_enabled(). * * @since 1.5.0 * * @see IXR_Server */ #[\AllowDynamicProperties] class wp_xmlrpc_server extends \IXR_Server { /** * Methods. * * @var array */ public $methods; /** * Blog options. * * @var array */ public $blog_options; /** * IXR_Error instance. * * @var IXR_Error */ public $error; /** * Flags that the user authentication has failed in this instance of wp_xmlrpc_server. * * @var bool */ protected $auth_failed = \false; /** * Registers all of the XMLRPC methods that XMLRPC server understands. * * Sets up server and method property. Passes XMLRPC methods through the * {@see 'xmlrpc_methods'} filter to allow plugins to extend or replace * XML-RPC methods. * * @since 1.5.0 */ public function __construct() { } /** * Makes private/protected methods readable for backward compatibility. * * @since 4.0.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return array|IXR_Error|false Return value of the callback, false otherwise. */ public function __call($name, $arguments) { } /** * Serves the XML-RPC request. * * @since 2.9.0 */ public function serve_request() { } /** * Tests XMLRPC API by saying, "Hello!" to client. * * @since 1.5.0 * * @return string Hello string response. */ public function sayHello() { } /** * Tests XMLRPC API by adding two numbers for client. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 A number to add. * @type int $1 A second number to add. * } * @return int Sum of the two given numbers. * @phpstan-param array{ * 0: int, * 1: int, * } $args */ public function addTwoNumbers($args) { } /** * Logs user in. * * @since 2.8.0 * * @param string $username User's username. * @param string $password User's password. * @return WP_User|false WP_User object if authentication passed, false otherwise. */ public function login($username, $password) { } /** * Checks user's credentials. Deprecated. * * @since 1.5.0 * @deprecated 2.8.0 Use wp_xmlrpc_server::login() * @see wp_xmlrpc_server::login() * * @param string $username User's username. * @param string $password User's password. * @return bool Whether authentication passed. */ public function login_pass_ok($username, $password) { } /** * Escapes string or array of strings for database. * * @since 1.5.2 * * @param string|array $data Escape single string or array of strings. * @return string|void Returns with string is passed, alters by-reference * when array is passed. */ public function escape(&$data) { } /** * Sends error response to client. * * Sends an XML error response to the client. If the endpoint is enabled * an HTTP 200 response is always sent per the XML-RPC specification. * * @since 5.7.3 * * @param IXR_Error|string $error Error code or an error object. * @param false $message Error message. Optional. */ public function error($error, $message = \false) { } /** * Retrieves custom fields for post. * * @since 2.5.0 * * @param int $post_id Post ID. * @return array Custom fields, if exist. */ public function get_custom_fields($post_id) { } /** * Sets custom fields for post. * * @since 2.5.0 * * @param int $post_id Post ID. * @param array $fields Custom fields. */ public function set_custom_fields($post_id, $fields) { } /** * Retrieves custom fields for a term. * * @since 4.9.0 * * @param int $term_id Term ID. * @return array Array of custom fields, if they exist. */ public function get_term_custom_fields($term_id) { } /** * Sets custom fields for a term. * * @since 4.9.0 * * @param int $term_id Term ID. * @param array $fields Custom fields. */ public function set_term_custom_fields($term_id, $fields) { } /** * Sets up blog options property. * * Passes property through {@see 'xmlrpc_blog_options'} filter. * * @since 2.6.0 */ public function initialise_blog_option_info() { } /** * Retrieves the blogs of the user. * * @since 2.6.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type string $0 Username. * @type string $1 Password. * } * @return array|IXR_Error Array contains: * - 'isAdmin' * - 'isPrimary' - whether the blog is the user's primary blog * - 'url' * - 'blogid' * - 'blogName' * - 'xmlrpc' - url of xmlrpc endpoint * @phpstan-param array{ * 0: string, * 1: string, * } $args */ public function wp_getUsersBlogs($args) { } /** * Checks if the method received at least the minimum number of arguments. * * @since 3.4.0 * * @param array $args An array of arguments to check. * @param int $count Minimum number of arguments. * @return bool True if `$args` contains at least `$count` arguments, false otherwise. */ protected function minimum_args($args, $count) { } /** * Prepares taxonomy data for return in an XML-RPC object. * * @param WP_Taxonomy $taxonomy The unprepared taxonomy data. * @param array $fields The subset of taxonomy fields to return. * @return array The prepared taxonomy data. */ protected function _prepare_taxonomy($taxonomy, $fields) { } /** * Prepares term data for return in an XML-RPC object. * * @param array|object $term The unprepared term data. * @return array The prepared term data. */ protected function _prepare_term($term) { } /** * Converts a WordPress date string to an IXR_Date object. * * @param string $date Date string to convert. * @return IXR_Date IXR_Date object. */ protected function _convert_date($date) { } /** * Converts a WordPress GMT date string to an IXR_Date object. * * @param string $date_gmt WordPress GMT date string. * @param string $date Date string. * @return IXR_Date IXR_Date object. */ protected function _convert_date_gmt($date_gmt, $date) { } /** * Prepares post data for return in an XML-RPC object. * * @param array $post The unprepared post data. * @param array $fields The subset of post type fields to return. * @return array The prepared post data. */ protected function _prepare_post($post, $fields) { } /** * Prepares post data for return in an XML-RPC object. * * @since 3.4.0 * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * * @param WP_Post_Type $post_type Post type object. * @param array $fields The subset of post fields to return. * @return array The prepared post type data. */ protected function _prepare_post_type($post_type, $fields) { } /** * Prepares media item data for return in an XML-RPC object. * * @param WP_Post $media_item The unprepared media item data. * @param string $thumbnail_size The image size to use for the thumbnail URL. * @return array The prepared media item data. */ protected function _prepare_media_item($media_item, $thumbnail_size = 'thumbnail') { } /** * Prepares page data for return in an XML-RPC object. * * @param WP_Post $page The unprepared page data. * @return array The prepared page data. */ protected function _prepare_page($page) { } /** * Prepares comment data for return in an XML-RPC object. * * @param WP_Comment $comment The unprepared comment data. * @return array The prepared comment data. */ protected function _prepare_comment($comment) { } /** * Prepares user data for return in an XML-RPC object. * * @param WP_User $user The unprepared user object. * @param array $fields The subset of user fields to return. * @return array The prepared user data. */ protected function _prepare_user($user, $fields) { } /** * Creates a new post for any registered post type. * * @since 3.4.0 * * @link https://en.wikipedia.org/wiki/RSS_enclosure for information on RSS enclosures. * * @param array $args { * Method arguments. Note: top-level arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 { * Content struct for adding a new post. See wp_insert_post() for information on * additional post fields * * @type string $post_type Post type. Default 'post'. * @type string $post_status Post status. Default 'draft' * @type string $post_title Post title. * @type int $post_author Post author ID. * @type string $post_excerpt Post excerpt. * @type string $post_content Post content. * @type string $post_date_gmt Post date in GMT. * @type string $post_date Post date. * @type string $post_password Post password (20-character limit). * @type string $comment_status Post comment enabled status. Accepts 'open' or 'closed'. * @type string $ping_status Post ping status. Accepts 'open' or 'closed'. * @type bool $sticky Whether the post should be sticky. Automatically false if * `$post_status` is 'private'. * @type int $post_thumbnail ID of an image to use as the post thumbnail/featured image. * @type array $custom_fields Array of meta key/value pairs to add to the post. * @type array $terms Associative array with taxonomy names as keys and arrays * of term IDs as values. * @type array $terms_names Associative array with taxonomy names as keys and arrays * of term names as values. * @type array $enclosure { * Array of feed enclosure data to add to post meta. * * @type string $url URL for the feed enclosure. * @type int $length Size in bytes of the enclosure. * @type string $type Mime-type for the enclosure. * } * } * } * @return int|IXR_Error Post ID on success, IXR_Error instance otherwise. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array{ * post_type?: string, * post_status?: string, * post_title: string, * post_author: int, * post_excerpt: string, * post_content: string, * post_date_gmt: string, * post_date: string, * post_password: string, * comment_status: string, * ping_status: string, * sticky: bool, * post_thumbnail: int, * custom_fields: array, * terms: array, * terms_names: array, * enclosure: array{ * url: string, * length: int, * type: string, * }, * }, * } $args */ public function wp_newPost($args) { } /** * Helper method for wp_newPost() and wp_editPost(), containing shared logic. * * @since 3.4.0 * * @see wp_insert_post() * * @param WP_User $user The post author if post_author isn't set in $content_struct. * @param array|IXR_Error $content_struct Post data to insert. * @return IXR_Error|string */ protected function _insert_post($user, $content_struct) { } /** * Edits a post for any registered post type. * * The $content_struct parameter only needs to contain fields that * should be changed. All other fields will retain their existing values. * * @since 3.4.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Post ID. * @type array $4 Extra content arguments. * } * @return true|IXR_Error True on success, IXR_Error on failure. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * 4: array, * } $args */ public function wp_editPost($args) { } /** * Deletes a post for any registered post type. * * @since 3.4.0 * * @see wp_delete_post() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Post ID. * } * @return true|IXR_Error True on success, IXR_Error instance on failure. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_deletePost($args) { } /** * Retrieves a post. * * @since 3.4.0 * * The optional $fields parameter specifies what fields will be included * in the response array. This should be a list of field names. 'post_id' will * always be included in the response regardless of the value of $fields. * * Instead of, or in addition to, individual field names, conceptual group * names can be used to specify multiple fields. The available conceptual * groups are 'post' (all basic fields), 'taxonomies', 'custom_fields', * and 'enclosure'. * * @see get_post() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Post ID. * @type array $4 Optional. The subset of post type fields to return. * } * @return array|IXR_Error Array contains (based on $fields parameter): * - 'post_id' * - 'post_title' * - 'post_date' * - 'post_date_gmt' * - 'post_modified' * - 'post_modified_gmt' * - 'post_status' * - 'post_type' * - 'post_name' * - 'post_author' * - 'post_password' * - 'post_excerpt' * - 'post_content' * - 'link' * - 'comment_status' * - 'ping_status' * - 'sticky' * - 'custom_fields' * - 'terms' * - 'categories' * - 'tags' * - 'enclosure' * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * 4: array, * } $args */ public function wp_getPost($args) { } /** * Retrieves posts. * * @since 3.4.0 * * @see wp_get_recent_posts() * @see wp_getPost() for more on `$fields` * @see get_posts() for more on `$filter` values * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Optional. Modifies the query used to retrieve posts. Accepts 'post_type', * 'post_status', 'number', 'offset', 'orderby', 's', and 'order'. * Default empty array. * @type array $4 Optional. The subset of post type fields to return in the response array. * } * @return array|IXR_Error Array containing a collection of posts. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * 4: array, * } $args */ public function wp_getPosts($args) { } /** * Creates a new term. * * @since 3.4.0 * * @see wp_insert_term() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Content struct for adding a new term. The struct must contain * the term 'name' and 'taxonomy'. Optional accepted values include * 'parent', 'description', and 'slug'. * } * @return int|IXR_Error The term ID on success, or an IXR_Error object on failure. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_newTerm($args) { } /** * Edits a term. * * @since 3.4.0 * * @see wp_update_term() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Term ID. * @type array $4 Content struct for editing a term. The struct must contain the * term 'taxonomy'. Optional accepted values include 'name', 'parent', * 'description', and 'slug'. * } * @return true|IXR_Error True on success, IXR_Error instance on failure. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * 4: array, * } $args */ public function wp_editTerm($args) { } /** * Deletes a term. * * @since 3.4.0 * * @see wp_delete_term() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type string $3 Taxonomy name. * @type int $4 Term ID. * } * @return true|IXR_Error True on success, IXR_Error instance on failure. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: string, * 4: int, * } $args */ public function wp_deleteTerm($args) { } /** * Retrieves a term. * * @since 3.4.0 * * @see get_term() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type string $3 Taxonomy name. * @type int $4 Term ID. * } * @return array|IXR_Error IXR_Error on failure, array on success, containing: * - 'term_id' * - 'name' * - 'slug' * - 'term_group' * - 'term_taxonomy_id' * - 'taxonomy' * - 'description' * - 'parent' * - 'count' * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: string, * 4: int, * } $args */ public function wp_getTerm($args) { } /** * Retrieves all terms for a taxonomy. * * @since 3.4.0 * * The optional $filter parameter modifies the query used to retrieve terms. * Accepted keys are 'number', 'offset', 'orderby', 'order', 'hide_empty', and 'search'. * * @see get_terms() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type string $3 Taxonomy name. * @type array $4 Optional. Modifies the query used to retrieve posts. Accepts 'number', * 'offset', 'orderby', 'order', 'hide_empty', and 'search'. Default empty array. * } * @return array|IXR_Error An associative array of terms data on success, IXR_Error instance otherwise. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: string, * 4: array, * } $args */ public function wp_getTerms($args) { } /** * Retrieves a taxonomy. * * @since 3.4.0 * * @see get_taxonomy() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type string $3 Taxonomy name. * @type array $4 Optional. Array of taxonomy fields to limit to in the return. * Accepts 'labels', 'cap', 'menu', and 'object_type'. * Default empty array. * } * @return array|IXR_Error An array of taxonomy data on success, IXR_Error instance otherwise. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: string, * 4: array, * } $args */ public function wp_getTaxonomy($args) { } /** * Retrieves all taxonomies. * * @since 3.4.0 * * @see get_taxonomies() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Optional. An array of arguments for retrieving taxonomies. * @type array $4 Optional. The subset of taxonomy fields to return. * } * @return array|IXR_Error An associative array of taxonomy data with returned fields determined * by `$fields`, or an IXR_Error instance on failure. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * 4: array, * } $args */ public function wp_getTaxonomies($args) { } /** * Retrieves a user. * * The optional $fields parameter specifies what fields will be included * in the response array. This should be a list of field names. 'user_id' will * always be included in the response regardless of the value of $fields. * * Instead of, or in addition to, individual field names, conceptual group * names can be used to specify multiple fields. The available conceptual * groups are 'basic' and 'all'. * * @uses get_userdata() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 User ID. * @type array $4 Optional. Array of fields to return. * } * @return array|IXR_Error Array contains (based on $fields parameter): * - 'user_id' * - 'username' * - 'first_name' * - 'last_name' * - 'registered' * - 'bio' * - 'email' * - 'nickname' * - 'nicename' * - 'url' * - 'display_name' * - 'roles' * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * 4: array, * } $args */ public function wp_getUser($args) { } /** * Retrieves users. * * The optional $filter parameter modifies the query used to retrieve users. * Accepted keys are 'number' (default: 50), 'offset' (default: 0), 'role', * 'who', 'orderby', and 'order'. * * The optional $fields parameter specifies what fields will be included * in the response array. * * @uses get_users() * @see wp_getUser() for more on $fields and return values * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Optional. Arguments for the user query. * @type array $4 Optional. Fields to return. * } * @return array|IXR_Error users data * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * 4: array, * } $args */ public function wp_getUsers($args) { } /** * Retrieves information about the requesting user. * * @uses get_userdata() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username * @type string $2 Password * @type array $3 Optional. Fields to return. * } * @return array|IXR_Error (@see wp_getUser) * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_getProfile($args) { } /** * Edits user's profile. * * @uses wp_update_user() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Content struct. It can optionally contain: * - 'first_name' * - 'last_name' * - 'website' * - 'display_name' * - 'nickname' * - 'nicename' * - 'bio' * } * @return true|IXR_Error True, on success. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_editProfile($args) { } /** * Retrieves a page. * * @since 2.2.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type int $1 Page ID. * @type string $2 Username. * @type string $3 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: int, * 2: string, * 3: string, * } $args */ public function wp_getPage($args) { } /** * Retrieves Pages. * * @since 2.2.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Optional. Number of pages. Default 10. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_getPages($args) { } /** * Creates a new page. * * @since 2.2.0 * * @see wp_xmlrpc_server::mw_newPost() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Content struct. * } * @return int|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_newPage($args) { } /** * Deletes a page. * * @since 2.2.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Page ID. * } * @return true|IXR_Error True, if success. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_deletePage($args) { } /** * Edits a page. * * @since 2.2.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type int $1 Page ID. * @type string $2 Username. * @type string $3 Password. * @type string $4 Content. * @type int $5 Publish flag. 0 for draft, 1 for publish. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: int, * 2: string, * 3: string, * 4: string, * 5: int, * } $args */ public function wp_editPage($args) { } /** * Retrieves page list. * * @since 2.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getPageList($args) { } /** * Retrieves authors list. * * @since 2.2.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getAuthors($args) { } /** * Gets the list of all tags. * * @since 2.7.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getTags($args) { } /** * Creates a new category. * * @since 2.2.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Category. * } * @return int|IXR_Error Category ID. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_newCategory($args) { } /** * Deletes a category. * * @since 2.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Category ID. * } * @return bool|IXR_Error See wp_delete_term() for return info. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_deleteCategory($args) { } /** * Retrieves category list. * * @since 2.2.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Category * @type int $4 Max number of results. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * 4: int, * } $args */ public function wp_suggestCategories($args) { } /** * Retrieves a comment. * * @since 2.7.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Comment ID. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_getComment($args) { } /** * Retrieves comments. * * Besides the common blog_id (unused), username, and password arguments, * it takes a filter array as the last argument. * * Accepted 'filter' keys are 'status', 'post_id', 'offset', and 'number'. * * The defaults are as follows: * - 'status' - Default is ''. Filter by status (e.g., 'approve', 'hold') * - 'post_id' - Default is ''. The post where the comment is posted. * Empty string shows all comments. * - 'number' - Default is 10. Total number of media items to retrieve. * - 'offset' - Default is 0. See WP_Query::query() for more. * * @since 2.7.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Optional. Query arguments. * } * @return array|IXR_Error Array containing a collection of comments. * See wp_xmlrpc_server::wp_getComment() for a description * of each item contents. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_getComments($args) { } /** * Deletes a comment. * * By default, the comment will be moved to the Trash instead of deleted. * See wp_delete_comment() for more information on this behavior. * * @since 2.7.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Comment ID. * } * @return bool|IXR_Error See wp_delete_comment(). * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_deleteComment($args) { } /** * Edits a comment. * * Besides the common blog_id (unused), username, and password arguments, * it takes a comment_id integer and a content_struct array as the last argument. * * The allowed keys in the content_struct array are: * - 'author' * - 'author_url' * - 'author_email' * - 'content' * - 'date_created_gmt' * - 'status'. Common statuses are 'approve', 'hold', 'spam'. See get_comment_statuses() for more details. * * @since 2.7.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Comment ID. * @type array $4 Content structure. * } * @return true|IXR_Error True, on success. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * 4: array, * } $args */ public function wp_editComment($args) { } /** * Creates a new comment. * * @since 2.7.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type string|int $3 Post ID or URL. * @type array $4 Content structure. * } * @return int|IXR_Error See wp_new_comment(). * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: string|int, * 4: array, * } $args */ public function wp_newComment($args) { } /** * Retrieves all of the comment status. * * @since 2.7.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getCommentStatusList($args) { } /** * Retrieves comment counts. * * @since 2.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Post ID. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_getCommentCount($args) { } /** * Retrieves post statuses. * * @since 2.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getPostStatusList($args) { } /** * Retrieves page statuses. * * @since 2.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getPageStatusList($args) { } /** * Retrieves page templates. * * @since 2.6.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getPageTemplates($args) { } /** * Retrieves blog options. * * @since 2.6.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Optional. Options. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_getOptions($args) { } /** * Retrieves blog options value from list. * * @since 2.6.0 * * @param array $options Options to retrieve. * @return array */ public function _getOptions($options) { } /** * Updates blog options. * * @since 2.6.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Options. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_setOptions($args) { } /** * Retrieves a media item by ID. * * @since 3.1.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Attachment ID. * } * @return array|IXR_Error Associative array contains: * - 'date_created_gmt' * - 'parent' * - 'link' * - 'thumbnail' * - 'title' * - 'caption' * - 'description' * - 'metadata' * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_getMediaItem($args) { } /** * Retrieves a collection of media library items (or attachments). * * Besides the common blog_id (unused), username, and password arguments, * it takes a filter array as the last argument. * * Accepted 'filter' keys are 'parent_id', 'mime_type', 'offset', and 'number'. * * The defaults are as follows: * - 'number' - Default is 5. Total number of media items to retrieve. * - 'offset' - Default is 0. See WP_Query::query() for more. * - 'parent_id' - Default is ''. The post where the media item is attached. * Empty string shows all media items. 0 shows unattached media items. * - 'mime_type' - Default is ''. Filter by mime type (e.g., 'image/jpeg', 'application/pdf') * * @since 3.1.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Optional. Query arguments. * } * @return array|IXR_Error Array containing a collection of media items. * See wp_xmlrpc_server::wp_getMediaItem() for a description * of each item contents. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function wp_getMediaLibrary($args) { } /** * Retrieves a list of post formats used by the site. * * @since 3.1.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error List of post formats, otherwise IXR_Error object. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function wp_getPostFormats($args) { } /** * Retrieves a post type. * * @since 3.4.0 * * @see get_post_type_object() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type string $3 Post type name. * @type array $4 Optional. Fields to fetch. * } * @return array|IXR_Error Array contains: * - 'labels' * - 'description' * - 'capability_type' * - 'cap' * - 'map_meta_cap' * - 'hierarchical' * - 'menu_position' * - 'taxonomies' * - 'supports' * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: string, * 4: array, * } $args */ public function wp_getPostType($args) { } /** * Retrieves post types. * * @since 3.4.0 * * @see get_post_types() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Optional. Query arguments. * @type array $4 Optional. Fields to fetch. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * 4: array, * } $args */ public function wp_getPostTypes($args) { } /** * Retrieves revisions for a specific post. * * @since 3.5.0 * * The optional $fields parameter specifies what fields will be included * in the response array. * * @uses wp_get_post_revisions() * @see wp_getPost() for more on $fields * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Post ID. * @type array $4 Optional. Fields to fetch. * } * @return array|IXR_Error Array containing a collection of posts. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * 4: array, * } $args */ public function wp_getRevisions($args) { } /** * Restores a post revision. * * @since 3.5.0 * * @uses wp_restore_post_revision() * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Revision ID. * } * @return bool|IXR_Error false if there was an error restoring, true if success. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function wp_restoreRevision($args) { } /** * Retrieves blogs that user owns. * * Will make more sense once we support multiple blogs. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function blogger_getUsersBlogs($args) { } /** * Private function for retrieving a users blogs for multisite setups. * * @since 3.0.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ protected function _multisite_getUsersBlogs($args) { } /** * Retrieves user's data. * * Gives your client some info about you, so you don't have to. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function blogger_getUserInfo($args) { } /** * Retrieves a post. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type int $1 Post ID. * @type string $2 Username. * @type string $3 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: int, * 2: string, * 3: string, * } $args */ public function blogger_getPost($args) { } /** * Retrieves the list of recent posts. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type string $0 App key (unused). * @type int $1 Blog ID (unused). * @type string $2 Username. * @type string $3 Password. * @type int $4 Optional. Number of posts. * } * @return array|IXR_Error * @phpstan-param array{ * 0: string, * 1: int, * 2: string, * 3: string, * 4: int, * } $args */ public function blogger_getRecentPosts($args) { } /** * Deprecated. * * @since 1.5.0 * @deprecated 3.5.0 * * @param array $args Unused. * @return IXR_Error Error object. */ public function blogger_getTemplate($args) { } /** * Deprecated. * * @since 1.5.0 * @deprecated 3.5.0 * * @param array $args Unused. * @return IXR_Error Error object. */ public function blogger_setTemplate($args) { } /** * Creates a new post. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type string $0 App key (unused). * @type int $1 Blog ID (unused). * @type string $2 Username. * @type string $3 Password. * @type string $4 Content. * @type int $5 Publish flag. 0 for draft, 1 for publish. * } * @return int|IXR_Error * @phpstan-param array{ * 0: string, * 1: int, * 2: string, * 3: string, * 4: string, * 5: int, * } $args */ public function blogger_newPost($args) { } /** * Edits a post. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type int $1 Post ID. * @type string $2 Username. * @type string $3 Password. * @type string $4 Content * @type int $5 Publish flag. 0 for draft, 1 for publish. * } * @return true|IXR_Error true when done. * @phpstan-param array{ * 0: int, * 1: int, * 2: string, * 3: string, * 4: string, * 5: int, * } $args */ public function blogger_editPost($args) { } /** * Deletes a post. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type int $1 Post ID. * @type string $2 Username. * @type string $3 Password. * } * @return true|IXR_Error True when post is deleted. * @phpstan-param array{ * 0: int, * 1: int, * 2: string, * 3: string, * } $args */ public function blogger_deletePost($args) { } /** * Creates a new post. * * The 'content_struct' argument must contain: * - title * - description * - mt_excerpt * - mt_text_more * - mt_keywords * - mt_tb_ping_urls * - categories * * Also, it can optionally contain: * - wp_slug * - wp_password * - wp_page_parent_id * - wp_page_order * - wp_author_id * - post_status | page_status - can be 'draft', 'private', 'publish', or 'pending' * - mt_allow_comments - can be 'open' or 'closed' * - mt_allow_pings - can be 'open' or 'closed' * - date_created_gmt * - dateCreated * - wp_post_thumbnail * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Content structure. * @type int $4 Optional. Publish flag. 0 for draft, 1 for publish. Default 0. * } * @return int|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * 4: int, * } $args */ public function mw_newPost($args) { } /** * Adds an enclosure to a post if it's new. * * @since 2.8.0 * * @param int $post_id Post ID. * @param array $enclosure Enclosure data. */ public function add_enclosure_if_new($post_id, $enclosure) { } /** * Attaches an upload to a post. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $post_id Post ID. * @param string $post_content Post Content for attachment. */ public function attach_uploads($post_id, $post_content) { } /** * Edits a post. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Post ID. * @type string $1 Username. * @type string $2 Password. * @type array $3 Content structure. * @type int $4 Optional. Publish flag. 0 for draft, 1 for publish. Default 0. * } * @return true|IXR_Error True on success. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * 4: int, * } $args */ public function mw_editPost($args) { } /** * Retrieves a post. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Post ID. * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function mw_getPost($args) { } /** * Retrieves list of recent posts. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Optional. Number of posts. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function mw_getRecentPosts($args) { } /** * Retrieves the list of categories on a given blog. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function mw_getCategories($args) { } /** * Uploads a file, following your settings. * * Adapted from a patch by Johann Richard. * * @link http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/ * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type array $3 Data. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function mw_newMediaObject($args) { } /** * Retrieves the post titles of recent posts. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * @type int $3 Optional. Number of posts. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: int, * } $args */ public function mt_getRecentPostTitles($args) { } /** * Retrieves the list of all categories on a blog. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Blog ID (unused). * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function mt_getCategoryList($args) { } /** * Retrieves post categories. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Post ID. * @type string $1 Username. * @type string $2 Password. * } * @return array|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function mt_getPostCategories($args) { } /** * Sets categories for a post. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Post ID. * @type string $1 Username. * @type string $2 Password. * @type array $3 Categories. * } * @return true|IXR_Error True on success. * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * 3: array, * } $args */ public function mt_setPostCategories($args) { } /** * Retrieves an array of methods supported by this server. * * @since 1.5.0 * * @return array */ public function mt_supportedMethods() { } /** * Retrieves an empty array because we don't support per-post text filters. * * @since 1.5.0 */ public function mt_supportedTextFilters() { } /** * Retrieves trackbacks sent to a given post. * * @since 1.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $post_id * @return array|IXR_Error */ public function mt_getTrackbackPings($post_id) { } /** * Sets a post's publish status to 'publish'. * * @since 1.5.0 * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type int $0 Post ID. * @type string $1 Username. * @type string $2 Password. * } * @return int|IXR_Error * @phpstan-param array{ * 0: int, * 1: string, * 2: string, * } $args */ public function mt_publishPost($args) { } /** * Retrieves a pingback and registers it. * * @since 1.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args { * Method arguments. Note: arguments must be ordered as documented. * * @type string $0 URL of page linked from. * @type string $1 URL of page linked to. * } * @return string|IXR_Error * @phpstan-param array{ * 0: string, * 1: string, * } $args */ public function pingback_ping($args) { } /** * Retrieves an array of URLs that pingbacked the given URL. * * Specs on http://www.aquarionics.com/misc/archives/blogite/0198.html * * @since 1.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $url * @return array|IXR_Error */ public function pingback_extensions_getPingbacks($url) { } /** * Sends a pingback error based on the given error code and message. * * @since 3.6.0 * * @param int $code Error code. * @param string $message Error message. * @return IXR_Error Error object. */ protected function pingback_error($code, $message) { } } /** * WordPress environment setup class. * * @package WordPress * @since 2.0.0 */ #[\AllowDynamicProperties] class WP { /** * Public query variables. * * Long list of public query variables. * * @since 2.0.0 * @var string[] */ public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'favicon', 'taxonomy', 'term', 'cpage', 'post_type', 'embed'); /** * Private query variables. * * Long list of private query variables. * * @since 2.0.0 * @var string[] */ public $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent', 'post_parent__in', 'post_parent__not_in', 'title', 'fields'); /** * Extra query variables set by the user. * * @since 2.1.0 * @var array */ public $extra_query_vars = array(); /** * Query variables for setting up the WordPress Query Loop. * * @since 2.0.0 * @var array */ public $query_vars = array(); /** * String parsed to set the query variables. * * @since 2.0.0 * @var string */ public $query_string = ''; /** * The request path, e.g. 2015/05/06. * * @since 2.0.0 * @var string */ public $request = ''; /** * Rewrite rule the request matched. * * @since 2.0.0 * @var string */ public $matched_rule = ''; /** * Rewrite query the request matched. * * @since 2.0.0 * @var string */ public $matched_query = ''; /** * Whether already did the permalink. * * @since 2.0.0 * @var bool */ public $did_permalink = \false; /** * Adds a query variable to the list of public query variables. * * @since 2.1.0 * * @param string $qv Query variable name. */ public function add_query_var($qv) { } /** * Removes a query variable from a list of public query variables. * * @since 4.5.0 * * @param string $name Query variable name. */ public function remove_query_var($name) { } /** * Sets the value of a query variable. * * @since 2.3.0 * * @param string $key Query variable name. * @param mixed $value Query variable value. */ public function set_query_var($key, $value) { } /** * Parses the request to find the correct WordPress query. * * Sets up the query variables based on the request. There are also many * filters and actions that can be used to further manipulate the result. * * @since 2.0.0 * @since 6.0.0 A return value was added. * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param array|string $extra_query_vars Set the extra query variables. * @return bool Whether the request was parsed. */ public function parse_request($extra_query_vars = '') { } /** * Sends additional HTTP headers for caching, content type, etc. * * Sets the Content-Type header. Sets the 'error' status (if passed) and optionally exits. * If showing a feed, it will also send Last-Modified, ETag, and 304 status if needed. * * @since 2.0.0 * @since 4.4.0 `X-Pingback` header is added conditionally for single posts that allow pings. * @since 6.1.0 Runs after posts have been queried. * * @global WP_Query $wp_query WordPress Query object. */ public function send_headers() { } /** * Sets the query string property based off of the query variable property. * * The {@see 'query_string'} filter is deprecated, but still works. Plugins should * use the {@see 'request'} filter instead. * * @since 2.0.0 */ public function build_query_string() { } /** * Set up the WordPress Globals. * * The query_vars property will be extracted to the GLOBALS. So care should * be taken when naming global variables that might interfere with the * WordPress environment. * * @since 2.0.0 * * @global WP_Query $wp_query WordPress Query object. * @global string $query_string Query string for the loop. * @global array $posts The found posts. * @global WP_Post|null $post The current post, if available. * @global string $request The SQL statement for the request. * @global int $more Only set, if single page or post. * @global int $single If single page or post. Only set, if single page or post. * @global WP_User $authordata Only set, if author archive. */ public function register_globals() { } /** * Set up the current user. * * @since 2.0.0 */ public function init() { } /** * Set up the Loop based on the query variables. * * @since 2.0.0 * * @global WP_Query $wp_the_query WordPress Query object. */ public function query_posts() { } /** * Set the Headers for 404, if nothing is found for requested URL. * * Issue a 404 if a request doesn't match any posts and doesn't match any object * (e.g. an existing-but-empty category, tag, author) and a 404 was not already issued, * and if the request was not a search or the homepage. * * Otherwise, issue a 200. * * This sets headers after posts have been queried. handle_404() really means "handle status". * By inspecting the result of querying posts, seemingly successful requests can be switched to * a 404 so that canonical redirection logic can kick in. * * @since 2.0.0 * * @global WP_Query $wp_query WordPress Query object. * @phpstan-return void */ public function handle_404() { } /** * Sets up all of the variables required by the WordPress environment. * * The action {@see 'wp'} has one parameter that references the WP object. It * allows for accessing the properties and methods to further manipulate the * object. * * @since 2.0.0 * * @param string|array $query_args Passed to parse_request(). */ public function main($query_args = '') { } } /** * WordPress database access abstraction class. * * This class is used to interact with a database without needing to use raw SQL statements. * By default, WordPress uses this class to instantiate the global $wpdb object, providing * access to the WordPress database. * * It is possible to replace this class with your own by setting the $wpdb global variable * in wp-content/db.php file to your class. The wpdb class will still be included, so you can * extend it or simply use your own. * * @link https://developer.wordpress.org/reference/classes/wpdb/ * * @since 0.71 */ #[\AllowDynamicProperties] class wpdb { /** * Whether to show SQL/DB errors. * * Default is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY evaluate to true. * * @since 0.71 * * @var bool */ public $show_errors = \false; /** * Whether to suppress errors during the DB bootstrapping. Default false. * * @since 2.5.0 * * @var bool */ public $suppress_errors = \false; /** * The error encountered during the last query. * * @since 2.5.0 * * @var string */ public $last_error = ''; /** * The number of queries made. * * @since 1.2.0 * * @var int */ public $num_queries = 0; /** * Count of rows returned by the last query. * * @since 0.71 * * @var int */ public $num_rows = 0; /** * Count of rows affected by the last query. * * @since 0.71 * * @var int */ public $rows_affected = 0; /** * The ID generated for an AUTO_INCREMENT column by the last query (usually INSERT). * * @since 0.71 * * @var int */ public $insert_id = 0; /** * The last query made. * * @since 0.71 * * @var string */ public $last_query; /** * Results of the last query. * * @since 0.71 * * @var stdClass[]|null */ public $last_result; /** * Database query result. * * Possible values: * * - `mysqli_result` instance for successful SELECT, SHOW, DESCRIBE, or EXPLAIN queries * - `true` for other query types that were successful * - `null` if a query is yet to be made or if the result has since been flushed * - `false` if the query returned an error * * @since 0.71 * * @var mysqli_result|bool|null */ protected $result; /** * Cached column info, for confidence checking data before inserting. * * @since 4.2.0 * * @var array */ protected $col_meta = array(); /** * Calculated character sets keyed by table name. * * @since 4.2.0 * * @var string[] */ protected $table_charset = array(); /** * Whether text fields in the current query need to be confidence checked. * * @since 4.2.0 * * @var bool */ protected $check_current_query = \true; /** * Saved info on the table column. * * @since 0.71 * * @var array */ protected $col_info; /** * Log of queries that were executed, for debugging purposes. * * @since 1.5.0 * @since 2.5.0 The third element in each query log was added to record the calling functions. * @since 5.1.0 The fourth element in each query log was added to record the start time. * @since 5.3.0 The fifth element in each query log was added to record custom data. * * @var array[] { * Array of arrays containing information about queries that were executed. * * @type array ...$0 { * Data for each query. * * @type string $0 The query's SQL. * @type float $1 Total time spent on the query, in seconds. * @type string $2 Comma-separated list of the calling functions. * @type float $3 Unix timestamp of the time at the start of the query. * @type array $4 Custom query data. * } * } * @phpstan-var array<int|string, array{ * 0: string, * 1: float, * 2: string, * 3: float, * 4: array, * }> */ public $queries; /** * The number of times to retry reconnecting before dying. Default 5. * * @since 3.9.0 * * @see wpdb::check_connection() * @var int */ protected $reconnect_retries = 5; /** * WordPress table prefix. * * You can set this to have multiple WordPress installations in a single database. * The second reason is for possible security precautions. * * @since 2.5.0 * * @var string */ public $prefix = ''; /** * WordPress base table prefix. * * @since 3.0.0 * * @var string */ public $base_prefix; /** * Whether the database queries are ready to start executing. * * @since 2.3.2 * * @var bool */ public $ready = \false; /** * Blog ID. * * @since 3.0.0 * * @var int */ public $blogid = 0; /** * Site ID. * * @since 3.0.0 * * @var int */ public $siteid = 0; /** * List of WordPress per-site tables. * * @since 2.5.0 * * @see wpdb::tables() * @var string[] */ public $tables = array('posts', 'comments', 'links', 'options', 'postmeta', 'terms', 'term_taxonomy', 'term_relationships', 'termmeta', 'commentmeta'); /** * List of deprecated WordPress tables. * * 'categories', 'post2cat', and 'link2cat' were deprecated in 2.3.0, db version 5539. * * @since 2.9.0 * * @see wpdb::tables() * @var string[] */ public $old_tables = array('categories', 'post2cat', 'link2cat'); /** * List of WordPress global tables. * * @since 3.0.0 * * @see wpdb::tables() * @var string[] */ public $global_tables = array('users', 'usermeta'); /** * List of Multisite global tables. * * @since 3.0.0 * * @see wpdb::tables() * @var string[] */ public $ms_global_tables = array('blogs', 'blogmeta', 'signups', 'site', 'sitemeta', 'registration_log'); /** * List of deprecated WordPress Multisite global tables. * * @since 6.1.0 * * @see wpdb::tables() * @var string[] */ public $old_ms_global_tables = array('sitecategories'); /** * WordPress Comments table. * * @since 1.5.0 * * @var string */ public $comments; /** * WordPress Comment Metadata table. * * @since 2.9.0 * * @var string */ public $commentmeta; /** * WordPress Links table. * * @since 1.5.0 * * @var string */ public $links; /** * WordPress Options table. * * @since 1.5.0 * * @var string */ public $options; /** * WordPress Post Metadata table. * * @since 1.5.0 * * @var string */ public $postmeta; /** * WordPress Posts table. * * @since 1.5.0 * * @var string */ public $posts; /** * WordPress Terms table. * * @since 2.3.0 * * @var string */ public $terms; /** * WordPress Term Relationships table. * * @since 2.3.0 * * @var string */ public $term_relationships; /** * WordPress Term Taxonomy table. * * @since 2.3.0 * * @var string */ public $term_taxonomy; /** * WordPress Term Meta table. * * @since 4.4.0 * * @var string */ public $termmeta; /** * WordPress User Metadata table. * * @since 2.3.0 * * @var string */ public $usermeta; /** * WordPress Users table. * * @since 1.5.0 * * @var string */ public $users; /** * Multisite Blogs table. * * @since 3.0.0 * * @var string */ public $blogs; /** * Multisite Blog Metadata table. * * @since 5.1.0 * * @var string */ public $blogmeta; /** * Multisite Registration Log table. * * @since 3.0.0 * * @var string */ public $registration_log; /** * Multisite Signups table. * * @since 3.0.0 * * @var string */ public $signups; /** * Multisite Sites table. * * @since 3.0.0 * * @var string */ public $site; /** * Multisite Sitewide Terms table. * * @since 3.0.0 * * @var string */ public $sitecategories; /** * Multisite Site Metadata table. * * @since 3.0.0 * * @var string */ public $sitemeta; /** * Format specifiers for DB columns. * * Columns not listed here default to %s. Initialized during WP load. * Keys are column names, values are format types: 'ID' => '%d'. * * @since 2.8.0 * * @see wpdb::prepare() * @see wpdb::insert() * @see wpdb::update() * @see wpdb::delete() * @see wp_set_wpdb_vars() * @var array */ public $field_types = array(); /** * Database table columns charset. * * @since 2.2.0 * * @var string */ public $charset; /** * Database table columns collate. * * @since 2.2.0 * * @var string */ public $collate; /** * Database Username. * * @since 2.9.0 * * @var string */ protected $dbuser; /** * Database Password. * * @since 3.1.0 * * @var string */ protected $dbpassword; /** * Database Name. * * @since 3.1.0 * * @var string */ protected $dbname; /** * Database Host. * * @since 3.1.0 * * @var string */ protected $dbhost; /** * Database handle. * * Possible values: * * - `mysqli` instance during normal operation * - `null` if the connection is yet to be made or has been closed * - `false` if the connection has failed * * @since 0.71 * * @var mysqli|false|null */ protected $dbh; /** * A textual description of the last query/get_row/get_var call. * * @since 3.0.0 * * @var string */ public $func_call; /** * Whether MySQL is used as the database engine. * * Set in wpdb::db_connect() to true, by default. This is used when checking * against the required MySQL version for WordPress. Normally, a replacement * database drop-in (db.php) will skip these checks, but setting this to true * will force the checks to occur. * * @since 3.3.0 * * @var bool */ public $is_mysql = \null; /** * A list of incompatible SQL modes. * * @since 3.9.0 * * @var string[] */ protected $incompatible_modes = array('NO_ZERO_DATE', 'ONLY_FULL_GROUP_BY', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'TRADITIONAL', 'ANSI'); /** * Time when the last query was performed. * * Only set when `SAVEQUERIES` is defined and truthy. * * @since 1.5.0 * * @var float */ public $time_start = \null; /** * The last SQL error that was encountered. * * @since 2.5.0 * * @var WP_Error|string */ public $error = \null; /** * Connects to the database server and selects a database. * * Does the actual setting up * of the class properties and connection to the database. * * @since 2.0.8 * * @link https://core.trac.wordpress.org/ticket/3354 * * @param string $dbuser Database user. * @param string $dbpassword Database password. * @param string $dbname Database name. * @param string $dbhost Database host. * @phpstan-return void */ public function __construct($dbuser, $dbpassword, $dbname, $dbhost) { } /** * Makes private properties readable for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to get, and optionally process. * @return mixed The private member. */ public function __get($name) { } /** * Makes private properties settable for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to set. * @param mixed $value The value to set. * @phpstan-return void */ public function __set($name, $value) { } /** * Makes private properties check-able for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to check. * @return bool If the member is set or not. */ public function __isset($name) { } /** * Makes private properties un-settable for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to unset */ public function __unset($name) { } /** * Sets $this->charset and $this->collate. * * @since 3.1.0 */ public function init_charset() { } /** * Determines the best charset and collation to use given a charset and collation. * * For example, when able, utf8mb4 should be used instead of utf8. * * @since 4.6.0 * * @param string $charset The character set to check. * @param string $collate The collation to check. * @return array { * The most appropriate character set and collation to use. * * @type string $charset Character set. * @type string $collate Collation. * } * @phpstan-return array{ * charset: string, * collate: string, * } */ public function determine_charset($charset, $collate) { } /** * Sets the connection's character set. * * @since 3.1.0 * * @param mysqli $dbh The connection returned by `mysqli_connect()`. * @param string $charset Optional. The character set. Default null. * @param string $collate Optional. The collation. Default null. */ public function set_charset($dbh, $charset = \null, $collate = \null) { } /** * Changes the current SQL mode, and ensures its WordPress compatibility. * * If no modes are passed, it will ensure the current MySQL server modes are compatible. * * @since 3.9.0 * * @param array $modes Optional. A list of SQL modes to set. Default empty array. * @phpstan-return void */ public function set_sql_mode($modes = array()) { } /** * Sets the table prefix for the WordPress tables. * * @since 2.5.0 * * @param string $prefix Alphanumeric name for the new prefix. * @param bool $set_table_names Optional. Whether the table names, e.g. wpdb::$posts, * should be updated or not. Default true. * @return string|WP_Error Old prefix or WP_Error on error. */ public function set_prefix($prefix, $set_table_names = \true) { } /** * Sets blog ID. * * @since 3.0.0 * * @param int $blog_id * @param int $network_id Optional. Network ID. Default 0. * @return int Previous blog ID. */ public function set_blog_id($blog_id, $network_id = 0) { } /** * Gets blog prefix. * * @since 3.0.0 * * @param int $blog_id Optional. Blog ID to retrieve the table prefix for. * Defaults to the current blog ID. * @return string Blog prefix. */ public function get_blog_prefix($blog_id = \null) { } /** * Returns an array of WordPress tables. * * Also allows for the `CUSTOM_USER_TABLE` and `CUSTOM_USER_META_TABLE` to override the WordPress users * and usermeta tables that would otherwise be determined by the prefix. * * The `$scope` argument can take one of the following: * * - 'all' - returns 'all' and 'global' tables. No old tables are returned. * - 'blog' - returns the blog-level tables for the queried blog. * - 'global' - returns the global tables for the installation, returning multisite tables only on multisite. * - 'ms_global' - returns the multisite global tables, regardless if current installation is multisite. * - 'old' - returns tables which are deprecated. * * @since 3.0.0 * @since 6.1.0 `old` now includes deprecated multisite global tables only on multisite. * * @uses wpdb::$tables * @uses wpdb::$old_tables * @uses wpdb::$global_tables * @uses wpdb::$ms_global_tables * @uses wpdb::$old_ms_global_tables * * @param string $scope Optional. Possible values include 'all', 'global', 'ms_global', 'blog', * or 'old' tables. Default 'all'. * @param bool $prefix Optional. Whether to include table prefixes. If blog prefix is requested, * then the custom users and usermeta tables will be mapped. Default true. * @param int $blog_id Optional. The blog_id to prefix. Used only when prefix is requested. * Defaults to `wpdb::$blogid`. * @return string[] Table names. When a prefix is requested, the key is the unprefixed table name. */ public function tables($scope = 'all', $prefix = \true, $blog_id = 0) { } /** * Selects a database using the current or provided database connection. * * The database name will be changed based on the current database connection. * On failure, the execution will bail and display a DB error. * * @since 0.71 * * @param string $db Database name. * @param mysqli $dbh Optional. Database connection. * Defaults to the current database handle. */ public function select($db, $dbh = \null) { } /** * Do not use, deprecated. * * Use esc_sql() or wpdb::prepare() instead. * * @since 2.8.0 * @deprecated 3.6.0 Use wpdb::prepare() * @see wpdb::prepare() * @see esc_sql() * * @param string $data * @return string */ public function _weak_escape($data) { } /** * Real escape using mysqli_real_escape_string(). * * @since 2.8.0 * * @see mysqli_real_escape_string() * * @param string $data String to escape. * @return string Escaped string. */ public function _real_escape($data) { } /** * Escapes data. Works on arrays. * * @since 2.8.0 * * @uses wpdb::_real_escape() * * @param string|array $data Data to escape. * @return string|array Escaped data, in the same type as supplied. */ public function _escape($data) { } /** * Do not use, deprecated. * * Use esc_sql() or wpdb::prepare() instead. * * @since 0.71 * @deprecated 3.6.0 Use wpdb::prepare() * @see wpdb::prepare() * @see esc_sql() * * @param string|array $data Data to escape. * @return string|array Escaped data, in the same type as supplied. */ public function escape($data) { } /** * Escapes content by reference for insertion into the database, for security. * * @uses wpdb::_real_escape() * * @since 2.3.0 * * @param string $data String to escape. */ public function escape_by_ref(&$data) { } /** * Quotes an identifier for a MySQL database, e.g. table/field names. * * @since 6.2.0 * * @param string $identifier Identifier to escape. * @return string Escaped identifier. */ public function quote_identifier($identifier) { } /** * Prepares a SQL query for safe execution. * * Uses `sprintf()`-like syntax. The following placeholders can be used in the query string: * * - `%d` (integer) * - `%f` (float) * - `%s` (string) * - `%i` (identifier, e.g. table/field names) * * All placeholders MUST be left unquoted in the query string. A corresponding argument * MUST be passed for each placeholder. * * Note: There is one exception to the above: for compatibility with old behavior, * numbered or formatted string placeholders (eg, `%1$s`, `%5s`) will not have quotes * added by this function, so should be passed with appropriate quotes around them. * * Literal percentage signs (`%`) in the query string must be written as `%%`. Percentage wildcards * (for example, to use in LIKE syntax) must be passed via a substitution argument containing * the complete LIKE string, these cannot be inserted directly in the query string. * Also see wpdb::esc_like(). * * Arguments may be passed as individual arguments to the method, or as a single array * containing all arguments. A combination of the two is not supported. * * Examples: * * $wpdb->prepare( * "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d OR `other_field` LIKE %s", * array( 'foo', 1337, '%bar' ) * ); * * $wpdb->prepare( * "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", * 'foo' * ); * * @since 2.3.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by updating the function signature. The second parameter was changed * from `$args` to `...$args`. * @since 6.2.0 Added `%i` for identifiers, e.g. table or field names. * Check support via `wpdb::has_cap( 'identifier_placeholders' )`. * This preserves compatibility with `sprintf()`, as the C version uses * `%d` and `$i` as a signed integer, whereas PHP only supports `%d`. * * @link https://www.php.net/sprintf Description of syntax. * * @param string $query Query statement with `sprintf()`-like placeholders. * @param array|mixed $args The array of variables to substitute into the query's placeholders * if being called with an array of arguments, or the first variable * to substitute into the query's placeholders if being called with * individual arguments. * @param mixed ...$args Further variables to substitute into the query's placeholders * if being called with individual arguments. * @return string|void Sanitized query string, if there is a query to prepare. * @phpstan-param literal-string $query */ public function prepare($query, ...$args) { } /** * First half of escaping for `LIKE` special characters `%` and `_` before preparing for SQL. * * Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security. * * Example Prepared Statement: * * $wild = '%'; * $find = 'only 43% of planets'; * $like = $wild . $wpdb->esc_like( $find ) . $wild; * $sql = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_content LIKE %s", $like ); * * Example Escape Chain: * * $sql = esc_sql( $wpdb->esc_like( $input ) ); * * @since 4.0.0 * * @param string $text The raw text to be escaped. The input typed by the user * should have no extra or deleted slashes. * @return string Text in the form of a LIKE phrase. The output is not SQL safe. * Call wpdb::prepare() or wpdb::_real_escape() next. */ public function esc_like($text) { } /** * Prints SQL/DB error. * * @since 0.71 * * @global array $EZSQL_ERROR Stores error information of query and error string. * * @param string $str The error to display. * @return void|false Void if the showing of errors is enabled, false if disabled. */ public function print_error($str = '') { } /** * Enables showing of database errors. * * This function should be used only to enable showing of errors. * wpdb::hide_errors() should be used instead for hiding errors. * * @since 0.71 * * @see wpdb::hide_errors() * * @param bool $show Optional. Whether to show errors. Default true. * @return bool Whether showing of errors was previously active. */ public function show_errors($show = \true) { } /** * Disables showing of database errors. * * By default database errors are not shown. * * @since 0.71 * * @see wpdb::show_errors() * * @return bool Whether showing of errors was previously active. */ public function hide_errors() { } /** * Enables or disables suppressing of database errors. * * By default database errors are suppressed. * * @since 2.5.0 * * @see wpdb::hide_errors() * * @param bool $suppress Optional. Whether to suppress errors. Default true. * @return bool Whether suppressing of errors was previously active. */ public function suppress_errors($suppress = \true) { } /** * Kills cached query results. * * @since 0.71 * @phpstan-return void */ public function flush() { } /** * Connects to and selects database. * * If `$allow_bail` is false, the lack of database connection will need to be handled manually. * * @since 3.0.0 * @since 3.9.0 $allow_bail parameter added. * * @param bool $allow_bail Optional. Allows the function to bail. Default true. * @return bool True with a successful connection, false on failure. */ public function db_connect($allow_bail = \true) { } /** * Parses the DB_HOST setting to interpret it for mysqli_real_connect(). * * mysqli_real_connect() doesn't support the host param including a port or socket * like mysql_connect() does. This duplicates how mysql_connect() detects a port * and/or socket file. * * @since 4.9.0 * * @param string $host The DB_HOST setting to parse. * @return array|false { * Array containing the host, the port, the socket and * whether it is an IPv6 address, in that order. * False if the host couldn't be parsed. * * @type string $0 Host name. * @type string|null $1 Port. * @type string|null $2 Socket. * @type bool $3 Whether it is an IPv6 address. * } * @phpstan-return false|array{ * 0: string, * 1: string|null, * 2: string|null, * 3: bool, * } */ public function parse_db_host($host) { } /** * Checks that the connection to the database is still up. If not, try to reconnect. * * If this function is unable to reconnect, it will forcibly die, or if called * after the {@see 'template_redirect'} hook has been fired, return false instead. * * If `$allow_bail` is false, the lack of database connection will need to be handled manually. * * @since 3.9.0 * * @param bool $allow_bail Optional. Allows the function to bail. Default true. * @return bool|void True if the connection is up. */ public function check_connection($allow_bail = \true) { } /** * Performs a database query, using current database connection. * * More information can be found on the documentation page. * * @since 0.71 * * @link https://developer.wordpress.org/reference/classes/wpdb/ * * @param string $query Database query. * @return int|bool Boolean true for CREATE, ALTER, TRUNCATE and DROP queries. Number of rows * affected/selected for all other queries. Boolean false on error. */ public function query($query) { } /** * Logs query data. * * @since 5.3.0 * * @param string $query The query's SQL. * @param float $query_time Total time spent on the query, in seconds. * @param string $query_callstack Comma-separated list of the calling functions. * @param float $query_start Unix timestamp of the time at the start of the query. * @param array $query_data Custom query data. */ public function log_query($query, $query_time, $query_callstack, $query_start, $query_data) { } /** * Generates and returns a placeholder escape string for use in queries returned by ::prepare(). * * @since 4.8.3 * * @return string String to escape placeholders. */ public function placeholder_escape() { } /** * Adds a placeholder escape string, to escape anything that resembles a printf() placeholder. * * @since 4.8.3 * * @param string $query The query to escape. * @return string The query with the placeholder escape string inserted where necessary. */ public function add_placeholder_escape($query) { } /** * Removes the placeholder escape strings from a query. * * @since 4.8.3 * * @param string $query The query from which the placeholder will be removed. * @return string The query with the placeholder removed. */ public function remove_placeholder_escape($query) { } /** * Inserts a row into the table. * * Examples: * * $wpdb->insert( * 'table', * array( * 'column1' => 'foo', * 'column2' => 'bar', * ) * ); * $wpdb->insert( * 'table', * array( * 'column1' => 'foo', * 'column2' => 1337, * ), * array( * '%s', * '%d', * ) * ); * * @since 2.5.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to insert (in column => value pairs). * Both `$data` columns and `$data` values should be "raw" (neither should be SQL escaped). * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param string[]|string $format Optional. An array of formats to be mapped to each of the value in `$data`. * If string, that format will be used for all of the values in `$data`. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in `$data` will be treated as strings unless otherwise * specified in wpdb::$field_types. Default null. * @return int|false The number of rows inserted, or false on error. */ public function insert($table, $data, $format = \null) { } /** * Replaces a row in the table or inserts it if it does not exist, based on a PRIMARY KEY or a UNIQUE index. * * A REPLACE works exactly like an INSERT, except that if an old row in the table has the same value as a new row * for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the new row is inserted. * * Examples: * * $wpdb->replace( * 'table', * array( * 'ID' => 123, * 'column1' => 'foo', * 'column2' => 'bar', * ) * ); * $wpdb->replace( * 'table', * array( * 'ID' => 456, * 'column1' => 'foo', * 'column2' => 1337, * ), * array( * '%d', * '%s', * '%d', * ) * ); * * @since 3.0.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to insert (in column => value pairs). * Both `$data` columns and `$data` values should be "raw" (neither should be SQL escaped). * A primary key or unique index is required to perform a replace operation. * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param string[]|string $format Optional. An array of formats to be mapped to each of the value in `$data`. * If string, that format will be used for all of the values in `$data`. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in `$data` will be treated as strings unless otherwise * specified in wpdb::$field_types. Default null. * @return int|false The number of rows affected, or false on error. */ public function replace($table, $data, $format = \null) { } /** * Helper function for insert and replace. * * Runs an insert or replace query based on `$type` argument. * * @since 3.0.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to insert (in column => value pairs). * Both `$data` columns and `$data` values should be "raw" (neither should be SQL escaped). * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param string[]|string $format Optional. An array of formats to be mapped to each of the value in `$data`. * If string, that format will be used for all of the values in `$data`. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in `$data` will be treated as strings unless otherwise * specified in wpdb::$field_types. Default null. * @param string $type Optional. Type of operation. Either 'INSERT' or 'REPLACE'. * Default 'INSERT'. * @return int|false The number of rows affected, or false on error. * @phpstan-param 'INSERT'|'REPLACE' $type */ public function _insert_replace_helper($table, $data, $format = \null, $type = 'INSERT') { } /** * Updates a row in the table. * * Examples: * * $wpdb->update( * 'table', * array( * 'column1' => 'foo', * 'column2' => 'bar', * ), * array( * 'ID' => 1, * ) * ); * $wpdb->update( * 'table', * array( * 'column1' => 'foo', * 'column2' => 1337, * ), * array( * 'ID' => 1, * ), * array( * '%s', * '%d', * ), * array( * '%d', * ) * ); * * @since 2.5.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to update (in column => value pairs). * Both $data columns and $data values should be "raw" (neither should be SQL escaped). * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param array $where A named array of WHERE clauses (in column => value pairs). * Multiple clauses will be joined with ANDs. * Both $where columns and $where values should be "raw". * Sending a null value will create an IS NULL comparison - the corresponding * format will be ignored in this case. * @param string[]|string $format Optional. An array of formats to be mapped to each of the values in $data. * If string, that format will be used for all of the values in $data. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $data will be treated as strings unless otherwise * specified in wpdb::$field_types. Default null. * @param string[]|string $where_format Optional. An array of formats to be mapped to each of the values in $where. * If string, that format will be used for all of the items in $where. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $where will be treated as strings unless otherwise * specified in wpdb::$field_types. Default null. * @return int|false The number of rows updated, or false on error. */ public function update($table, $data, $where, $format = \null, $where_format = \null) { } /** * Deletes a row in the table. * * Examples: * * $wpdb->delete( * 'table', * array( * 'ID' => 1, * ) * ); * $wpdb->delete( * 'table', * array( * 'ID' => 1, * ), * array( * '%d', * ) * ); * * @since 3.4.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $where A named array of WHERE clauses (in column => value pairs). * Multiple clauses will be joined with ANDs. * Both $where columns and $where values should be "raw". * Sending a null value will create an IS NULL comparison - the corresponding * format will be ignored in this case. * @param string[]|string $where_format Optional. An array of formats to be mapped to each of the values in $where. * If string, that format will be used for all of the items in $where. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $data will be treated as strings unless otherwise * specified in wpdb::$field_types. Default null. * @return int|false The number of rows deleted, or false on error. */ public function delete($table, $where, $where_format = \null) { } /** * Processes arrays of field/value pairs and field formats. * * This is a helper method for wpdb's CRUD methods, which take field/value pairs * for inserts, updates, and where clauses. This method first pairs each value * with a format. Then it determines the charset of that field, using that * to determine if any invalid text would be stripped. If text is stripped, * then field processing is rejected and the query fails. * * @since 4.2.0 * * @param string $table Table name. * @param array $data Array of values keyed by their field names. * @param string[]|string $format Formats or format to be mapped to the values in the data. * @return array|false An array of fields that contain paired value and formats. * False for invalid values. */ protected function process_fields($table, $data, $format) { } /** * Prepares arrays of value/format pairs as passed to wpdb CRUD methods. * * @since 4.2.0 * * @param array $data Array of values keyed by their field names. * @param string[]|string $format Formats or format to be mapped to the values in the data. * @return array { * Array of values and formats keyed by their field names. * * @type mixed $value The value to be formatted. * @type string $format The format to be mapped to the value. * } * @phpstan-return array{ * value: mixed, * format: string, * } */ protected function process_field_formats($data, $format) { } /** * Adds field charsets to field/value/format arrays generated by wpdb::process_field_formats(). * * @since 4.2.0 * * @param array $data { * Array of values and formats keyed by their field names, * as it comes from the wpdb::process_field_formats() method. * * @type array ...$0 { * Value and format for this field. * * @type mixed $value The value to be formatted. * @type string $format The format to be mapped to the value. * } * } * @param string $table Table name. * @return array|false { * The same array of data with additional 'charset' keys, or false if * the charset for the table cannot be found. * * @type array ...$0 { * Value, format, and charset for this field. * * @type mixed $value The value to be formatted. * @type string $format The format to be mapped to the value. * @type string|false $charset The charset to be used for the value. * } * } * @phpstan-param array<int|string, array{ * value: mixed, * format: string, * }> $data * @phpstan-return false|array<int|string, array{ * value: mixed, * format: string, * charset: string|false, * }> */ protected function process_field_charsets($data, $table) { } /** * For string fields, records the maximum string length that field can safely save. * * @since 4.2.1 * * @param array $data { * Array of values, formats, and charsets keyed by their field names, * as it comes from the wpdb::process_field_charsets() method. * * @type array ...$0 { * Value, format, and charset for this field. * * @type mixed $value The value to be formatted. * @type string $format The format to be mapped to the value. * @type string|false $charset The charset to be used for the value. * } * } * @param string $table Table name. * @return array|false { * The same array of data with additional 'length' keys, or false if * information for the table cannot be found. * * @type array ...$0 { * Value, format, charset, and length for this field. * * @type mixed $value The value to be formatted. * @type string $format The format to be mapped to the value. * @type string|false $charset The charset to be used for the value. * @type array|false $length { * Information about the maximum length of the value. * False if the column has no length. * * @type string $type One of 'byte' or 'char'. * @type int $length The column length. * } * } * } * @phpstan-param array<int|string, array{ * value: mixed, * format: string, * charset: string|false, * }> $data * @phpstan-return false|array<int|string, array{ * value: mixed, * format: string, * charset: string|false, * length: false|array{ * type: string, * length: int, * }, * }> */ protected function process_field_lengths($data, $table) { } /** * Retrieves one value from the database. * * Executes a SQL query and returns the value from the SQL result. * If the SQL result contains more than one column and/or more than one row, * the value in the column and row specified is returned. If $query is null, * the value in the specified column and row from the previous SQL result is returned. * * @since 0.71 * * @param string|null $query Optional. SQL query. Defaults to null, use the result from the previous query. * @param int $x Optional. Column of value to return. Indexed from 0. Default 0. * @param int $y Optional. Row of value to return. Indexed from 0. Default 0. * @return string|null Database query result (as string), or null on failure. */ public function get_var($query = \null, $x = 0, $y = 0) { } /** * Retrieves one row from the database. * * Executes a SQL query and returns the row from the SQL result. * * @since 0.71 * * @param string|null $query SQL query. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to an stdClass object, an associative array, or a numeric array, * respectively. Default OBJECT. * @param int $y Optional. Row to return. Indexed from 0. Default 0. * @return array|object|null|void Database query result in format specified by $output or null on failure. * @phpstan-param 'OBJECT'|'ARRAY_A'|'ARRAY_N' $output * @phpstan-param int<0, max> $y * @phpstan-return null|void|($output is 'ARRAY_A' ? array<array-key, mixed> : ($output is 'ARRAY_N' ? list<mixed> : \stdClass)) */ public function get_row($query = \null, $output = \OBJECT, $y = 0) { } /** * Retrieves one column from the database. * * Executes a SQL query and returns the column from the SQL result. * If the SQL result contains more than one column, the column specified is returned. * If $query is null, the specified column from the previous SQL result is returned. * * @since 0.71 * * @param string|null $query Optional. SQL query. Defaults to previous query. * @param int $x Optional. Column to return. Indexed from 0. Default 0. * @return array Database query result. Array indexed from 0 by SQL result row number. */ public function get_col($query = \null, $x = 0) { } /** * Retrieves an entire SQL result set from the database (i.e., many rows). * * Executes a SQL query and returns the entire SQL result. * * @since 0.71 * * @param string $query SQL query. * @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants. * With one of the first three, return an array of rows indexed * from 0 by SQL result row number. Each row is an associative array * (column => value, ...), a numerically indexed array (0 => value, ...), * or an object ( ->column = value ), respectively. With OBJECT_K, * return an associative array of row objects keyed by the value * of each row's first column's value. Duplicate keys are discarded. * Default OBJECT. * @return array|object|null Database query results. * @phpstan-param 'OBJECT'|'OBJECT_K'|'ARRAY_A'|'ARRAY_N' $output * @phpstan-return null|($output is 'ARRAY_A' ? list<array<array-key, mixed>> : ($output is 'ARRAY_N' ? list<array<int, mixed>> : ($output is 'OBJECT_K' ? array<array-key, \stdClass> : list<\stdClass>))) */ public function get_results($query = \null, $output = \OBJECT) { } /** * Retrieves the character set for the given table. * * @since 4.2.0 * * @param string $table Table name. * @return string|WP_Error Table character set, WP_Error object if it couldn't be found. */ protected function get_table_charset($table) { } /** * Retrieves the character set for the given column. * * @since 4.2.0 * * @param string $table Table name. * @param string $column Column name. * @return string|false|WP_Error Column character set as a string. False if the column has * no character set. WP_Error object if there was an error. */ public function get_col_charset($table, $column) { } /** * Retrieves the maximum string length allowed in a given column. * * The length may either be specified as a byte length or a character length. * * @since 4.2.1 * * @param string $table Table name. * @param string $column Column name. * @return array|false|WP_Error { * Array of column length information, false if the column has no length (for * example, numeric column), WP_Error object if there was an error. * * @type string $type One of 'byte' or 'char'. * @type int $length The column length. * } * @phpstan-return false|\WP_Error|array{ * type: string, * length: int, * } */ public function get_col_length($table, $column) { } /** * Checks if a string is ASCII. * * The negative regex is faster for non-ASCII strings, as it allows * the search to finish as soon as it encounters a non-ASCII character. * * @since 4.2.0 * * @param string $input_string String to check. * @return bool True if ASCII, false if not. */ protected function check_ascii($input_string) { } /** * Checks if the query is accessing a collation considered safe on the current version of MySQL. * * @since 4.2.0 * * @param string $query The query to check. * @return bool True if the collation is safe, false if it isn't. */ protected function check_safe_collation($query) { } /** * Strips any invalid characters based on value/charset pairs. * * @since 4.2.0 * * @param array $data Array of value arrays. Each value array has the keys 'value', 'charset', and 'length'. * An optional 'ascii' key can be set to false to avoid redundant ASCII checks. * @return array|WP_Error The $data parameter, with invalid characters removed from each value. * This works as a passthrough: any additional keys such as 'field' are * retained in each value array. If we cannot remove invalid characters, * a WP_Error object is returned. */ protected function strip_invalid_text($data) { } /** * Strips any invalid characters from the query. * * @since 4.2.0 * * @param string $query Query to convert. * @return string|WP_Error The converted query, or a WP_Error object if the conversion fails. */ protected function strip_invalid_text_from_query($query) { } /** * Strips any invalid characters from the string for a given table and column. * * @since 4.2.0 * * @param string $table Table name. * @param string $column Column name. * @param string $value The text to check. * @return string|WP_Error The converted string, or a WP_Error object if the conversion fails. */ public function strip_invalid_text_for_column($table, $column, $value) { } /** * Finds the first table name referenced in a query. * * @since 4.2.0 * * @param string $query The query to search. * @return string|false The table name found, or false if a table couldn't be found. */ protected function get_table_from_query($query) { } /** * Loads the column metadata from the last query. * * @since 3.5.0 * @phpstan-return void */ protected function load_col_info() { } /** * Retrieves column metadata from the last query. * * @since 0.71 * * @param string $info_type Optional. Possible values include 'name', 'table', 'def', 'max_length', * 'not_null', 'primary_key', 'multiple_key', 'unique_key', 'numeric', * 'blob', 'type', 'unsigned', 'zerofill'. Default 'name'. * @param int $col_offset Optional. 0: col name. 1: which table the col's in. 2: col's max length. * 3: if the col is numeric. 4: col's type. Default -1. * @return mixed Column results. */ public function get_col_info($info_type = 'name', $col_offset = -1) { } /** * Starts the timer, for debugging purposes. * * @since 1.5.0 * * @return true */ public function timer_start() { } /** * Stops the debugging timer. * * @since 1.5.0 * * @return float Total time spent on the query, in seconds. */ public function timer_stop() { } /** * Wraps errors in a nice header and footer and dies. * * Will not die if wpdb::$show_errors is false. * * @since 1.5.0 * * @param string $message The error message. * @param string $error_code Optional. A computer-readable string to identify the error. * Default '500'. * @return void|false Void if the showing of errors is enabled, false if disabled. */ public function bail($message, $error_code = '500') { } /** * Closes the current database connection. * * @since 4.5.0 * * @return bool True if the connection was successfully closed, * false if it wasn't, or if the connection doesn't exist. */ public function close() { } /** * Determines whether MySQL database is at least the required minimum version. * * @since 2.5.0 * * @global string $required_mysql_version The required MySQL version string. * @return void|WP_Error */ public function check_database_version() { } /** * Determines whether the database supports collation. * * Called when WordPress is generating the table scheme. * * Use `wpdb::has_cap( 'collation' )`. * * @since 2.5.0 * @deprecated 3.5.0 Use wpdb::has_cap() * * @return bool True if collation is supported, false if not. */ public function supports_collation() { } /** * Retrieves the database character collate. * * @since 3.5.0 * * @return string The database character collate. */ public function get_charset_collate() { } /** * Determines whether the database or WPDB supports a particular feature. * * Capability sniffs for the database server and current version of WPDB. * * Database sniffs are based on the version of MySQL the site is using. * * WPDB sniffs are added as new features are introduced to allow theme and plugin * developers to determine feature support. This is to account for drop-ins which may * introduce feature support at a different time to WordPress. * * @since 2.7.0 * @since 4.1.0 Added support for the 'utf8mb4' feature. * @since 4.6.0 Added support for the 'utf8mb4_520' feature. * @since 6.2.0 Added support for the 'identifier_placeholders' feature. * @since 6.6.0 The `utf8mb4` feature now always returns true. * * @see wpdb::db_version() * * @param string $db_cap The feature to check for. Accepts 'collation', 'group_concat', * 'subqueries', 'set_charset', 'utf8mb4', 'utf8mb4_520', * or 'identifier_placeholders'. * @return bool True when the database feature is supported, false otherwise. * @phpstan-param 'collation'|'group_concat'|'subqueries'|'set_charset'|'utf8mb4'|'utf8mb4_520'|'identifier_placeholders' $db_cap */ public function has_cap($db_cap) { } /** * Retrieves a comma-separated list of the names of the functions that called wpdb. * * @since 2.5.0 * * @return string Comma-separated list of the calling functions. */ public function get_caller() { } /** * Retrieves the database server version. * * @since 2.7.0 * * @return string|null Version number on success, null on failure. */ public function db_version() { } /** * Returns the version of the MySQL server. * * @since 5.5.0 * * @return string Server version as a string. */ public function db_server_info() { } } /** * Customize Media Control class. * * @since 4.2.0 * * @see WP_Customize_Control */ class WP_Customize_Media_Control extends \WP_Customize_Control { /** * Control type. * * @since 4.2.0 * @var string */ public $type = 'media'; /** * Media control mime type. * * @since 4.2.0 * @var string */ public $mime_type = ''; /** * Button labels. * * @since 4.2.0 * @var array */ public $button_labels = array(); /** * Constructor. * * @since 4.1.0 * @since 4.2.0 Moved from WP_Customize_Upload_Control. * * @see WP_Customize_Control::__construct() * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Optional. Arguments to override class property defaults. * See WP_Customize_Control::__construct() for information * on accepted arguments. Default empty array. * @phpstan-param array{ * instance_number?: int, * manager?: WP_Customize_Manager, * id?: string, * settings?: array, * setting?: string, * capability?: string, * priority?: int, * section?: string, * label?: string, * description?: string, * choices?: array, * input_attrs?: array, * allow_addition?: bool, * json?: array, * type?: string, * active_callback?: callable, * } $args See WP_Customize_Control::__construct() */ public function __construct($manager, $id, $args = array()) { } /** * Enqueue control related scripts/styles. * * @since 3.4.0 * @since 4.2.0 Moved from WP_Customize_Upload_Control. */ public function enqueue() { } /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 3.4.0 * @since 4.2.0 Moved from WP_Customize_Upload_Control. * * @see WP_Customize_Control::to_json() */ public function to_json() { } /** * Don't render any content for this control from PHP. * * @since 3.4.0 * @since 4.2.0 Moved from WP_Customize_Upload_Control. * * @see WP_Customize_Media_Control::content_template() */ public function render_content() { } /** * Render a JS template for the content of the media control. * * @since 4.1.0 * @since 4.2.0 Moved from WP_Customize_Upload_Control. */ public function content_template() { } /** * Get default button labels. * * Provides an array of the default button labels based on the mime type of the current control. * * @since 4.9.0 * * @return string[] An associative array of default button labels keyed by the button name. */ public function get_default_button_labels() { } } /** * Customize Upload Control Class. * * @since 3.4.0 * * @see WP_Customize_Media_Control */ class WP_Customize_Upload_Control extends \WP_Customize_Media_Control { /** * Control type. * * @since 3.4.0 * @var string */ public $type = 'upload'; /** * Media control mime type. * * @since 4.1.0 * @var string */ public $mime_type = ''; /** * Button labels. * * @since 4.1.0 * @var array */ public $button_labels = array(); public $removed = ''; public $context; public $extensions = array(); /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 3.4.0 * * @uses WP_Customize_Media_Control::to_json() */ public function to_json() { } } /** * Customize Image Control class. * * @since 3.4.0 * * @see WP_Customize_Upload_Control */ class WP_Customize_Image_Control extends \WP_Customize_Upload_Control { /** * Control type. * * @since 3.4.0 * @var string */ public $type = 'image'; /** * Media control mime type. * * @since 4.1.0 * @var string */ public $mime_type = 'image'; /** * @since 3.4.2 * @deprecated 4.1.0 */ public function prepare_control() { } /** * @since 3.4.0 * @deprecated 4.1.0 * * @param string $id * @param string $label * @param mixed $callback */ public function add_tab($id, $label, $callback) { } /** * @since 3.4.0 * @deprecated 4.1.0 * * @param string $id */ public function remove_tab($id) { } /** * @since 3.4.0 * @deprecated 4.1.0 * * @param string $url * @param string $thumbnail_url */ public function print_tab_image($url, $thumbnail_url = \null) { } } /** * Customize Background Image Control class. * * @since 3.4.0 * * @see WP_Customize_Image_Control */ class WP_Customize_Background_Image_Control extends \WP_Customize_Image_Control { /** * Customize control type. * * @since 4.1.0 * @var string */ public $type = 'background'; /** * Constructor. * * @since 3.4.0 * @uses WP_Customize_Image_Control::__construct() * * @param WP_Customize_Manager $manager Customizer bootstrap instance. */ public function __construct($manager) { } /** * Enqueue control related scripts/styles. * * @since 4.1.0 */ public function enqueue() { } } /** * Customizer Background Image Setting class. * * @since 3.4.0 * * @see WP_Customize_Setting */ final class WP_Customize_Background_Image_Setting extends \WP_Customize_Setting { /** * Unique string identifier for the setting. * * @since 3.4.0 * @var string */ public $id = 'background_image_thumb'; /** * @since 3.4.0 * * @param mixed $value The value to update. Not used. */ public function update($value) { } } /** * Customize Background Position Control class. * * @since 4.7.0 * * @see WP_Customize_Control */ class WP_Customize_Background_Position_Control extends \WP_Customize_Control { /** * Type. * * @since 4.7.0 * @var string */ public $type = 'background_position'; /** * Don't render the control content from PHP, as it's rendered via JS on load. * * @since 4.7.0 */ public function render_content() { } /** * Render a JS template for the content of the position control. * * @since 4.7.0 */ public function content_template() { } } /** * Customize Code Editor Control class. * * @since 4.9.0 * * @see WP_Customize_Control */ class WP_Customize_Code_Editor_Control extends \WP_Customize_Control { /** * Customize control type. * * @since 4.9.0 * @var string */ public $type = 'code_editor'; /** * Type of code that is being edited. * * @since 4.9.0 * @var string */ public $code_type = ''; /** * Code editor settings. * * @see wp_enqueue_code_editor() * @since 4.9.0 * @var array|false */ public $editor_settings = array(); /** * Enqueue control related scripts/styles. * * @since 4.9.0 */ public function enqueue() { } /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 4.9.0 * * @see WP_Customize_Control::json() * * @return array Array of parameters passed to the JavaScript. */ public function json() { } /** * Don't render the control content from PHP, as it's rendered via JS on load. * * @since 4.9.0 */ public function render_content() { } /** * Render a JS template for control display. * * @since 4.9.0 */ public function content_template() { } } /** * Customize Color Control class. * * @since 3.4.0 * * @see WP_Customize_Control */ class WP_Customize_Color_Control extends \WP_Customize_Control { /** * Type. * * @var string */ public $type = 'color'; /** * Statuses. * * @var array */ public $statuses; /** * Mode. * * @since 4.7.0 * @var string */ public $mode = 'full'; /** * Constructor. * * @since 3.4.0 * * @see WP_Customize_Control::__construct() * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Optional. Arguments to override class property defaults. * See WP_Customize_Control::__construct() for information * on accepted arguments. Default empty array. * @phpstan-param array{ * instance_number?: int, * manager?: WP_Customize_Manager, * id?: string, * settings?: array, * setting?: string, * capability?: string, * priority?: int, * section?: string, * label?: string, * description?: string, * choices?: array, * input_attrs?: array, * allow_addition?: bool, * json?: array, * type?: string, * active_callback?: callable, * } $args See WP_Customize_Control::__construct() */ public function __construct($manager, $id, $args = array()) { } /** * Enqueue scripts/styles for the color picker. * * @since 3.4.0 */ public function enqueue() { } /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 3.4.0 * @uses WP_Customize_Control::to_json() */ public function to_json() { } /** * Don't render the control content from PHP, as it's rendered via JS on load. * * @since 3.4.0 */ public function render_content() { } /** * Render a JS template for the content of the color picker control. * * @since 4.1.0 */ public function content_template() { } } /** * Customize Cropped Image Control class. * * @since 4.3.0 * * @see WP_Customize_Image_Control */ class WP_Customize_Cropped_Image_Control extends \WP_Customize_Image_Control { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'cropped_image'; /** * Suggested width for cropped image. * * @since 4.3.0 * @var int */ public $width = 150; /** * Suggested height for cropped image. * * @since 4.3.0 * @var int */ public $height = 150; /** * Whether the width is flexible. * * @since 4.3.0 * @var bool */ public $flex_width = \false; /** * Whether the height is flexible. * * @since 4.3.0 * @var bool */ public $flex_height = \false; /** * Enqueue control related scripts/styles. * * @since 4.3.0 */ public function enqueue() { } /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 4.3.0 * * @see WP_Customize_Control::to_json() */ public function to_json() { } } /** * Custom Setting to handle WP Custom CSS. * * @since 4.7.0 * * @see WP_Customize_Setting */ final class WP_Customize_Custom_CSS_Setting extends \WP_Customize_Setting { /** * The setting type. * * @since 4.7.0 * @var string */ public $type = 'custom_css'; /** * Setting Transport * * @since 4.7.0 * @var string */ public $transport = 'postMessage'; /** * Capability required to edit this setting. * * @since 4.7.0 * @var string */ public $capability = 'edit_css'; /** * Stylesheet * * @since 4.7.0 * @var string */ public $stylesheet = ''; /** * WP_Customize_Custom_CSS_Setting constructor. * * @since 4.7.0 * * @throws Exception If the setting ID does not match the pattern `custom_css[$stylesheet]`. * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID of the setting. * Can be a theme mod or option name. * @param array $args Setting arguments. */ public function __construct($manager, $id, $args = array()) { } /** * Add filter to preview post value. * * @since 4.7.9 * * @return bool False when preview short-circuits due no change needing to be previewed. */ public function preview() { } /** * Filters `wp_get_custom_css` for applying the customized value. * * This is used in the preview when `wp_get_custom_css()` is called for rendering the styles. * * @since 4.7.0 * * @see wp_get_custom_css() * * @param string $css Original CSS. * @param string $stylesheet Current stylesheet. * @return string CSS. */ public function filter_previewed_wp_get_custom_css($css, $stylesheet) { } /** * Fetch the value of the setting. Will return the previewed value when `preview()` is called. * * @since 4.7.0 * * @see WP_Customize_Setting::value() * * @return string */ public function value() { } /** * Validate a received value for being valid CSS. * * Checks for imbalanced braces, brackets, and comments. * Notifications are rendered when the customizer state is saved. * * @since 4.7.0 * @since 4.9.0 Checking for balanced characters has been moved client-side via linting in code editor. * @since 5.9.0 Renamed `$css` to `$value` for PHP 8 named parameter support. * * @param string $value CSS to validate. * @return true|WP_Error True if the input was validated, otherwise WP_Error. */ public function validate($value) { } /** * Store the CSS setting value in the custom_css custom post type for the stylesheet. * * @since 4.7.0 * @since 5.9.0 Renamed `$css` to `$value` for PHP 8 named parameter support. * * @param string $value CSS to update. * @return int|false The post ID or false if the value could not be saved. */ public function update($value) { } } /** * Customize Date Time Control class. * * @since 4.9.0 * * @see WP_Customize_Control */ class WP_Customize_Date_Time_Control extends \WP_Customize_Control { /** * Customize control type. * * @since 4.9.0 * @var string */ public $type = 'date_time'; /** * Minimum Year. * * @since 4.9.0 * @var int */ public $min_year = 1000; /** * Maximum Year. * * @since 4.9.0 * @var int */ public $max_year = 9999; /** * Allow past date, if set to false user can only select future date. * * @since 4.9.0 * @var bool */ public $allow_past_date = \true; /** * Whether hours, minutes, and meridian should be shown. * * @since 4.9.0 * @var bool */ public $include_time = \true; /** * If set to false the control will appear in 24 hour format, * the value will still be saved in Y-m-d H:i:s format. * * @since 4.9.0 * @var bool */ public $twelve_hour_format = \true; /** * Don't render the control's content - it's rendered with a JS template. * * @since 4.9.0 */ public function render_content() { } /** * Export data to JS. * * @since 4.9.0 * @return array */ public function json() { } /** * Renders a JS template for the content of date time control. * * @since 4.9.0 */ public function content_template() { } /** * Generate options for the month Select. * * Based on touch_time(). * * @since 4.9.0 * * @see touch_time() * * @global WP_Locale $wp_locale WordPress date and time locale object. * * @return array */ public function get_month_choices() { } /** * Get timezone info. * * @since 4.9.0 * * @return array { * Timezone info. All properties are optional. * * @type string $abbr Timezone abbreviation. Examples: PST or CEST. * @type string $description Human-readable timezone description as HTML. * } * @phpstan-return array{ * abbr: string, * description: string, * } */ public function get_timezone_info() { } /** * Format GMT Offset. * * @since 4.9.0 * * @see wp_timezone_choice() * * @param float $offset Offset in hours. * @return string Formatted offset. */ public function format_gmt_offset($offset) { } } /** * A setting that is used to filter a value, but will not save the results. * * Results should be properly handled using another setting or callback. * * @since 3.4.0 * * @see WP_Customize_Setting */ class WP_Customize_Filter_Setting extends \WP_Customize_Setting { /** * Saves the value of the setting, using the related API. * * @since 3.4.0 * * @param mixed $value The value to update. */ public function update($value) { } } /** * Customize Header Image Control class. * * @since 3.4.0 * * @see WP_Customize_Image_Control */ class WP_Customize_Header_Image_Control extends \WP_Customize_Image_Control { /** * Customize control type. * * @since 4.2.0 * @var string */ public $type = 'header'; /** * Uploaded header images. * * @since 3.9.0 * @var string */ public $uploaded_headers; /** * Default header images. * * @since 3.9.0 * @var string */ public $default_headers; /** * Constructor. * * @since 3.4.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. */ public function __construct($manager) { } /** */ public function enqueue() { } /** * @global Custom_Image_Header $custom_image_header * @phpstan-return void */ public function prepare_control() { } /** */ public function print_header_image_template() { } /** * @return string|void */ public function get_current_image_src() { } /** */ public function render_content() { } } /** * A setting that is used to filter a value, but will not save the results. * * Results should be properly handled using another setting or callback. * * @since 3.4.0 * * @see WP_Customize_Setting */ final class WP_Customize_Header_Image_Setting extends \WP_Customize_Setting { /** * Unique string identifier for the setting. * * @since 3.4.0 * @var string */ public $id = 'header_image_data'; /** * @since 3.4.0 * * @global Custom_Image_Header $custom_image_header * * @param mixed $value The value to update. */ public function update($value) { } } /** * Customize control to represent the auto_add field for a given menu. * * @since 4.3.0 * * @see WP_Customize_Control */ class WP_Customize_Nav_Menu_Auto_Add_Control extends \WP_Customize_Control { /** * Type of control, used by JS. * * @since 4.3.0 * @var string */ public $type = 'nav_menu_auto_add'; /** * No-op since we're using JS template. * * @since 4.3.0 */ protected function render_content() { } /** * Render the Underscore template for this control. * * @since 4.3.0 */ protected function content_template() { } } /** * Customize Nav Menu Control Class. * * @since 4.3.0 * * @see WP_Customize_Control */ class WP_Customize_Nav_Menu_Control extends \WP_Customize_Control { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'nav_menu'; /** * Don't render the control's content - it uses a JS template instead. * * @since 4.3.0 */ public function render_content() { } /** * JS/Underscore template for the control UI. * * @since 4.3.0 */ public function content_template() { } /** * Return parameters for this control. * * @since 4.3.0 * * @return array Exported parameters. */ public function json() { } } /** * Customize control to represent the name field for a given menu. * * @since 4.3.0 * * @see WP_Customize_Control */ class WP_Customize_Nav_Menu_Item_Control extends \WP_Customize_Control { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'nav_menu_item'; /** * The nav menu item setting. * * @since 4.3.0 * @var WP_Customize_Nav_Menu_Item_Setting */ public $setting; /** * Constructor. * * @since 4.3.0 * * @see WP_Customize_Control::__construct() * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id The control ID. * @param array $args Optional. Arguments to override class property defaults. * See WP_Customize_Control::__construct() for information * on accepted arguments. Default empty array. * @phpstan-param array{ * instance_number?: int, * manager?: WP_Customize_Manager, * id?: string, * settings?: array, * setting?: string, * capability?: string, * priority?: int, * section?: string, * label?: string, * description?: string, * choices?: array, * input_attrs?: array, * allow_addition?: bool, * json?: array, * type?: string, * active_callback?: callable, * } $args See WP_Customize_Control::__construct() */ public function __construct($manager, $id, $args = array()) { } /** * Don't render the control's content - it's rendered with a JS template. * * @since 4.3.0 */ public function render_content() { } /** * JS/Underscore template for the control UI. * * @since 4.3.0 */ public function content_template() { } /** * Return parameters for this control. * * @since 4.3.0 * * @return array Exported parameters. */ public function json() { } } /** * Customize Setting to represent a nav_menu. * * Subclass of WP_Customize_Setting to represent a nav_menu taxonomy term, and * the IDs for the nav_menu_items associated with the nav menu. * * @since 4.3.0 * * @see WP_Customize_Setting */ class WP_Customize_Nav_Menu_Item_Setting extends \WP_Customize_Setting { const ID_PATTERN = '/^nav_menu_item\\[(?P<id>-?\\d+)\\]$/'; const POST_TYPE = 'nav_menu_item'; const TYPE = 'nav_menu_item'; /** * Setting type. * * @since 4.3.0 * @var string */ public $type = self::TYPE; /** * Default setting value. * * @since 4.3.0 * @var array * * @see wp_setup_nav_menu_item() */ public $default = array( // The $menu_item_data for wp_update_nav_menu_item(). 'object_id' => 0, 'object' => '', // Taxonomy name. 'menu_item_parent' => 0, // A.K.A. menu-item-parent-id; note that post_parent is different, and not included. 'position' => 0, // A.K.A. menu_order. 'type' => 'custom', // Note that type_label is not included here. 'title' => '', 'url' => '', 'target' => '', 'attr_title' => '', 'description' => '', 'classes' => '', 'xfn' => '', 'status' => 'publish', 'original_title' => '', 'nav_menu_term_id' => 0, // This will be supplied as the $menu_id arg for wp_update_nav_menu_item(). '_invalid' => \false, ); /** * Default transport. * * @since 4.3.0 * @since 4.5.0 Default changed to 'refresh' * @var string */ public $transport = 'refresh'; /** * The post ID represented by this setting instance. This is the db_id. * * A negative value represents a placeholder ID for a new menu not yet saved. * * @since 4.3.0 * @var int */ public $post_id; /** * Storage of pre-setup menu item to prevent wasted calls to wp_setup_nav_menu_item(). * * @since 4.3.0 * @var array|null */ protected $value; /** * Previous (placeholder) post ID used before creating a new menu item. * * This value will be exported to JS via the customize_save_response filter * so that JavaScript can update the settings to refer to the newly-assigned * post ID. This value is always negative to indicate it does not refer to * a real post. * * @since 4.3.0 * @var int * * @see WP_Customize_Nav_Menu_Item_Setting::update() * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response() */ public $previous_post_id; /** * When previewing or updating a menu item, this stores the previous nav_menu_term_id * which ensures that we can apply the proper filters. * * @since 4.3.0 * @var int */ public $original_nav_menu_term_id; /** * Whether or not update() was called. * * @since 4.3.0 * @var bool */ protected $is_updated = \false; /** * Status for calling the update method, used in customize_save_response filter. * * See {@see 'customize_save_response'}. * * When status is inserted, the placeholder post ID is stored in $previous_post_id. * When status is error, the error is stored in $update_error. * * @since 4.3.0 * @var string updated|inserted|deleted|error * * @see WP_Customize_Nav_Menu_Item_Setting::update() * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response() */ public $update_status; /** * Any error object returned by wp_update_nav_menu_item() when setting is updated. * * @since 4.3.0 * @var WP_Error * * @see WP_Customize_Nav_Menu_Item_Setting::update() * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response() */ public $update_error; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 4.3.0 * * @throws Exception If $id is not valid for this setting type. * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID of the setting. * Can be a theme mod or option name. * @param array $args Optional. Setting arguments. */ public function __construct(\WP_Customize_Manager $manager, $id, array $args = array()) { } /** * Clear the cached value when this nav menu item is updated. * * @since 4.3.0 * * @param int $menu_id The term ID for the menu. * @param int $menu_item_id The post ID for the menu item. */ public function flush_cached_value($menu_id, $menu_item_id) { } /** * Get the instance data for a given nav_menu_item setting. * * @since 4.3.0 * * @see wp_setup_nav_menu_item() * * @return array|false Instance data array, or false if the item is marked for deletion. */ public function value() { } /** * Get original title. * * @since 4.7.0 * * @param object $item Nav menu item. * @return string The original title. */ protected function get_original_title($item) { } /** * Get type label. * * @since 4.7.0 * * @param object $item Nav menu item. * @return string The type label. */ protected function get_type_label($item) { } /** * Ensure that the value is fully populated with the necessary properties. * * Translates some properties added by wp_setup_nav_menu_item() and removes others. * * @since 4.3.0 * * @see WP_Customize_Nav_Menu_Item_Setting::value() * @phpstan-return void */ protected function populate_value() { } /** * Handle previewing the setting. * * @since 4.3.0 * @since 4.4.0 Added boolean return value. * * @see WP_Customize_Manager::post_value() * * @return bool False if method short-circuited due to no-op. */ public function preview() { } /** * Filters the wp_get_nav_menu_items() result to supply the previewed menu items. * * @since 4.3.0 * * @see wp_get_nav_menu_items() * * @param WP_Post[] $items An array of menu item post objects. * @param WP_Term $menu The menu object. * @param array $args An array of arguments used to retrieve menu item objects. * @return WP_Post[] Array of menu item objects. */ public function filter_wp_get_nav_menu_items($items, $menu, $args) { } /** * Re-apply the tail logic also applied on $items by wp_get_nav_menu_items(). * * @since 4.3.0 * * @see wp_get_nav_menu_items() * * @param WP_Post[] $items An array of menu item post objects. * @param WP_Term $menu The menu object. * @param array $args An array of arguments used to retrieve menu item objects. * @return WP_Post[] Array of menu item objects. */ public static function sort_wp_get_nav_menu_items($items, $menu, $args) { } /** * Get the value emulated into a WP_Post and set up as a nav_menu_item. * * @since 4.3.0 * * @return WP_Post With wp_setup_nav_menu_item() applied. */ public function value_as_wp_post_nav_menu_item() { } /** * Sanitize an input. * * Note that parent::sanitize() erroneously does wp_unslash() on $value, but * we remove that in this override. * * @since 4.3.0 * @since 5.9.0 Renamed `$menu_item_value` to `$value` for PHP 8 named parameter support. * * @param array $value The menu item value to sanitize. * @return array|false|null|WP_Error Null or WP_Error if an input isn't valid. False if it is marked for deletion. * Otherwise the sanitized value. */ public function sanitize($value) { } /** * Creates/updates the nav_menu_item post for this setting. * * Any created menu items will have their assigned post IDs exported to the client * via the {@see 'customize_save_response'} filter. Likewise, any errors will be * exported to the client via the customize_save_response() filter. * * To delete a menu, the client can send false as the value. * * @since 4.3.0 * * @see wp_update_nav_menu_item() * * @param array|false $value The menu item array to update. If false, then the menu item will be deleted * entirely. See WP_Customize_Nav_Menu_Item_Setting::$default for what the value * should consist of. * @return null|void * @phpstan-return void */ protected function update($value) { } /** * Export data for the JS client. * * @since 4.3.0 * * @see WP_Customize_Nav_Menu_Item_Setting::update() * * @param array $data Additional information passed back to the 'saved' event on `wp.customize`. * @return array Save response data. */ public function amend_customize_save_response($data) { } } /** * Customize Menu Location Control Class. * * This custom control is only needed for JS. * * @since 4.3.0 * * @see WP_Customize_Control */ class WP_Customize_Nav_Menu_Location_Control extends \WP_Customize_Control { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'nav_menu_location'; /** * Location ID. * * @since 4.3.0 * @var string */ public $location_id = ''; /** * Refresh the parameters passed to JavaScript via JSON. * * @since 4.3.0 * * @see WP_Customize_Control::to_json() */ public function to_json() { } /** * Render content just like a normal select control. * * @since 4.3.0 * @since 4.9.0 Added a button to create menus. * @phpstan-return void */ public function render_content() { } } /** * Customize Nav Menu Locations Control Class. * * @since 4.9.0 * * @see WP_Customize_Control */ class WP_Customize_Nav_Menu_Locations_Control extends \WP_Customize_Control { /** * Control type. * * @since 4.9.0 * @var string */ public $type = 'nav_menu_locations'; /** * Don't render the control's content - it uses a JS template instead. * * @since 4.9.0 */ public function render_content() { } /** * JS/Underscore template for the control UI. * * @since 4.9.0 */ public function content_template() { } } /** * Customize control to represent the name field for a given menu. * * @since 4.3.0 * * @see WP_Customize_Control */ class WP_Customize_Nav_Menu_Name_Control extends \WP_Customize_Control { /** * Type of control, used by JS. * * @since 4.3.0 * @var string */ public $type = 'nav_menu_name'; /** * No-op since we're using JS template. * * @since 4.3.0 */ protected function render_content() { } /** * Render the Underscore template for this control. * * @since 4.3.0 */ protected function content_template() { } } /** * Customize Menu Section Class * * Custom section only needed in JS. * * @since 4.3.0 * * @see WP_Customize_Section */ class WP_Customize_Nav_Menu_Section extends \WP_Customize_Section { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'nav_menu'; /** * Get section parameters for JS. * * @since 4.3.0 * @return array Exported parameters. */ public function json() { } } /** * Customize Setting to represent a nav_menu. * * Subclass of WP_Customize_Setting to represent a nav_menu taxonomy term, and * the IDs for the nav_menu_items associated with the nav menu. * * @since 4.3.0 * * @see wp_get_nav_menu_object() * @see WP_Customize_Setting */ class WP_Customize_Nav_Menu_Setting extends \WP_Customize_Setting { const ID_PATTERN = '/^nav_menu\\[(?P<id>-?\\d+)\\]$/'; const TAXONOMY = 'nav_menu'; const TYPE = 'nav_menu'; /** * Setting type. * * @since 4.3.0 * @var string */ public $type = self::TYPE; /** * Default setting value. * * @since 4.3.0 * @var array * * @see wp_get_nav_menu_object() */ public $default = array('name' => '', 'description' => '', 'parent' => 0, 'auto_add' => \false); /** * Default transport. * * @since 4.3.0 * @var string */ public $transport = 'postMessage'; /** * The term ID represented by this setting instance. * * A negative value represents a placeholder ID for a new menu not yet saved. * * @since 4.3.0 * @var int */ public $term_id; /** * Previous (placeholder) term ID used before creating a new menu. * * This value will be exported to JS via the {@see 'customize_save_response'} filter * so that JavaScript can update the settings to refer to the newly-assigned * term ID. This value is always negative to indicate it does not refer to * a real term. * * @since 4.3.0 * @var int * * @see WP_Customize_Nav_Menu_Setting::update() * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response() */ public $previous_term_id; /** * Whether or not update() was called. * * @since 4.3.0 * @var bool */ protected $is_updated = \false; /** * Status for calling the update method, used in customize_save_response filter. * * See {@see 'customize_save_response'}. * * When status is inserted, the placeholder term ID is stored in `$previous_term_id`. * When status is error, the error is stored in `$update_error`. * * @since 4.3.0 * @var string updated|inserted|deleted|error * * @see WP_Customize_Nav_Menu_Setting::update() * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response() */ public $update_status; /** * Any error object returned by wp_update_nav_menu_object() when setting is updated. * * @since 4.3.0 * @var WP_Error * * @see WP_Customize_Nav_Menu_Setting::update() * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response() */ public $update_error; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 4.3.0 * * @throws Exception If $id is not valid for this setting type. * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID of the setting. * Can be a theme mod or option name. * @param array $args Optional. Setting arguments. */ public function __construct(\WP_Customize_Manager $manager, $id, array $args = array()) { } /** * Get the instance data for a given widget setting. * * @since 4.3.0 * * @see wp_get_nav_menu_object() * * @return array Instance data. */ public function value() { } /** * Handle previewing the setting. * * @since 4.3.0 * @since 4.4.0 Added boolean return value * * @see WP_Customize_Manager::post_value() * * @return bool False if method short-circuited due to no-op. */ public function preview() { } /** * Filters the wp_get_nav_menus() result to ensure the inserted menu object is included, and the deleted one is removed. * * @since 4.3.0 * * @see wp_get_nav_menus() * * @param WP_Term[] $menus An array of menu objects. * @param array $args An array of arguments used to retrieve menu objects. * @return WP_Term[] Array of menu objects. */ public function filter_wp_get_nav_menus($menus, $args) { } /** * Temporary non-closure passing of orderby value to function. * * @since 4.3.0 * @var string * * @see WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus() * @see WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby() */ protected $_current_menus_sort_orderby; /** * Sort menu objects by the class-supplied orderby property. * * This is a workaround for a lack of closures. * * @since 4.3.0 * @deprecated 4.7.0 Use wp_list_sort() * * @param object $menu1 * @param object $menu2 * @return int * * @see WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus() */ protected function _sort_menus_by_orderby($menu1, $menu2) { } /** * Filters the wp_get_nav_menu_object() result to supply the previewed menu object. * * Requesting a nav_menu object by anything but ID is not supported. * * @since 4.3.0 * * @see wp_get_nav_menu_object() * * @param object|null $menu_obj Object returned by wp_get_nav_menu_object(). * @param string $menu_id ID of the nav_menu term. Requests by slug or name will be ignored. * @return object|null */ public function filter_wp_get_nav_menu_object($menu_obj, $menu_id) { } /** * Filters the nav_menu_options option to include this menu's auto_add preference. * * @since 4.3.0 * * @param array $nav_menu_options Nav menu options including auto_add. * @return array (Maybe) modified nav menu options. */ public function filter_nav_menu_options($nav_menu_options) { } /** * Sanitize an input. * * Note that parent::sanitize() erroneously does wp_unslash() on $value, but * we remove that in this override. * * @since 4.3.0 * * @param array $value The menu value to sanitize. * @return array|false|null Null if an input isn't valid. False if it is marked for deletion. * Otherwise the sanitized value. */ public function sanitize($value) { } /** * Storage for data to be sent back to client in customize_save_response filter. * * See {@see 'customize_save_response'}. * * @since 4.3.0 * @var array * * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response() */ protected $_widget_nav_menu_updates = array(); /** * Create/update the nav_menu term for this setting. * * Any created menus will have their assigned term IDs exported to the client * via the {@see 'customize_save_response'} filter. Likewise, any errors will be exported * to the client via the customize_save_response() filter. * * To delete a menu, the client can send false as the value. * * @since 4.3.0 * * @see wp_update_nav_menu_object() * * @param array|false $value { * The value to update. Note that slug cannot be updated via wp_update_nav_menu_object(). * If false, then the menu will be deleted entirely. * * @type string $name The name of the menu to save. * @type string $description The term description. Default empty string. * @type int $parent The id of the parent term. Default 0. * @type bool $auto_add Whether pages will auto_add to this menu. Default false. * } * @return null|void * @phpstan-param false|array{ * name?: string, * description?: string, * parent?: int, * auto_add?: bool, * } $value * @phpstan-return void */ protected function update($value) { } /** * Updates a nav_menu_options array. * * @since 4.3.0 * * @see WP_Customize_Nav_Menu_Setting::filter_nav_menu_options() * @see WP_Customize_Nav_Menu_Setting::update() * * @param array $nav_menu_options Array as returned by get_option( 'nav_menu_options' ). * @param int $menu_id The term ID for the given menu. * @param bool $auto_add Whether to auto-add or not. * @return array (Maybe) modified nav_menu_options array. */ protected function filter_nav_menu_options_value($nav_menu_options, $menu_id, $auto_add) { } /** * Export data for the JS client. * * @since 4.3.0 * * @see WP_Customize_Nav_Menu_Setting::update() * * @param array $data Additional information passed back to the 'saved' event on `wp.customize`. * @return array Export data. */ public function amend_customize_save_response($data) { } } /** * Customize Nav Menus Panel Class * * Needed to add screen options. * * @since 4.3.0 * * @see WP_Customize_Panel */ class WP_Customize_Nav_Menus_Panel extends \WP_Customize_Panel { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'nav_menus'; /** * Render screen options for Menus. * * @since 4.3.0 */ public function render_screen_options() { } /** * Returns the advanced options for the nav menus page. * * Link title attribute added as it's a relatively advanced concept for new users. * * @since 4.3.0 * @deprecated 4.5.0 Deprecated in favor of wp_nav_menu_manage_columns(). */ public function wp_nav_menu_manage_columns() { } /** * An Underscore (JS) template for this panel's content (but not its container). * * Class variables for this panel class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Panel::json(). * * @since 4.3.0 * * @see WP_Customize_Panel::print_template() */ protected function content_template() { } } /** * Customize control class for new menus. * * @since 4.3.0 * @deprecated 4.9.0 This class is no longer used as of the menu creation UX introduced in #40104. * * @see WP_Customize_Control */ class WP_Customize_New_Menu_Control extends \WP_Customize_Control { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'new_menu'; /** * Constructor. * * @since 4.9.0 * @deprecated 4.9.0 * * @see WP_Customize_Control::__construct() * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id The control ID. * @param array $args Optional. Arguments to override class property defaults. * See WP_Customize_Control::__construct() for information * on accepted arguments. Default empty array. * @phpstan-param array{ * instance_number?: int, * manager?: WP_Customize_Manager, * id?: string, * settings?: array, * setting?: string, * capability?: string, * priority?: int, * section?: string, * label?: string, * description?: string, * choices?: array, * input_attrs?: array, * allow_addition?: bool, * json?: array, * type?: string, * active_callback?: callable, * } $args See WP_Customize_Control::__construct() */ public function __construct(\WP_Customize_Manager $manager, $id, array $args = array()) { } /** * Render the control's content. * * @since 4.3.0 * @deprecated 4.9.0 */ public function render_content() { } } /** * Customize Menu Section Class * * @since 4.3.0 * @deprecated 4.9.0 This class is no longer used as of the menu creation UX introduced in #40104. * * @see WP_Customize_Section */ class WP_Customize_New_Menu_Section extends \WP_Customize_Section { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'new_menu'; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 4.9.0 * @deprecated 4.9.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID of the section. * @param array $args Section arguments. */ public function __construct(\WP_Customize_Manager $manager, $id, array $args = array()) { } /** * Render the section, and the controls that have been added to it. * * @since 4.3.0 * @deprecated 4.9.0 */ protected function render() { } } /** * Core Customizer class for implementing selective refresh partials. * * Representation of a rendered region in the previewed page that gets * selectively refreshed when an associated setting is changed. * This class is analogous of WP_Customize_Control. * * @since 4.5.0 */ #[\AllowDynamicProperties] class WP_Customize_Partial { /** * Component. * * @since 4.5.0 * @var WP_Customize_Selective_Refresh */ public $component; /** * Unique identifier for the partial. * * If the partial is used to display a single setting, this would generally * be the same as the associated setting's ID. * * @since 4.5.0 * @var string */ public $id; /** * Parsed ID. * * @since 4.5.0 * @var array { * @type string $base ID base. * @type array $keys Keys for multidimensional. * } * @phpstan-var array{ * base: string, * keys: array, * } */ protected $id_data = array(); /** * Type of this partial. * * @since 4.5.0 * @var string */ public $type = 'default'; /** * The jQuery selector to find the container element for the partial. * * @since 4.5.0 * @var string */ public $selector; /** * IDs for settings tied to the partial. * * @since 4.5.0 * @var string[] */ public $settings; /** * The ID for the setting that this partial is primarily responsible for rendering. * * If not supplied, it will default to the ID of the first setting. * * @since 4.5.0 * @var string */ public $primary_setting; /** * Capability required to edit this partial. * * Normally this is empty and the capability is derived from the capabilities * of the associated `$settings`. * * @since 4.5.0 * @var string */ public $capability; /** * Render callback. * * @since 4.5.0 * * @see WP_Customize_Partial::render() * @var callable Callback is called with one argument, the instance of * WP_Customize_Partial. The callback can either echo the * partial or return the partial as a string, or return false if error. */ public $render_callback; /** * Whether the container element is included in the partial, or if only the contents are rendered. * * @since 4.5.0 * @var bool */ public $container_inclusive = \false; /** * Whether to refresh the entire preview in case a partial cannot be refreshed. * * A partial render is considered a failure if the render_callback returns false. * * @since 4.5.0 * @var bool */ public $fallback_refresh = \true; /** * Constructor. * * Supplied `$args` override class property defaults. * * If `$args['settings']` is not defined, use the $id as the setting ID. * * @since 4.5.0 * * @param WP_Customize_Selective_Refresh $component Customize Partial Refresh plugin instance. * @param string $id Control ID. * @param array $args { * Optional. Array of properties for the new Partials object. Default empty array. * * @type string $type Type of the partial to be created. * @type string $selector The jQuery selector to find the container element for the partial, that is, * a partial's placement. * @type string[] $settings IDs for settings tied to the partial. If undefined, `$id` will be used. * @type string $primary_setting The ID for the setting that this partial is primarily responsible for * rendering. If not supplied, it will default to the ID of the first setting. * @type string $capability Capability required to edit this partial. * Normally this is empty and the capability is derived from the capabilities * of the associated `$settings`. * @type callable $render_callback Render callback. * Callback is called with one argument, the instance of WP_Customize_Partial. * The callback can either echo the partial or return the partial as a string, * or return false if error. * @type bool $container_inclusive Whether the container element is included in the partial, or if only * the contents are rendered. * @type bool $fallback_refresh Whether to refresh the entire preview in case a partial cannot be refreshed. * A partial render is considered a failure if the render_callback returns * false. * } * @phpstan-param array{ * type?: string, * selector?: string, * settings?: string[], * primary_setting?: string, * capability?: string, * render_callback?: callable, * container_inclusive?: bool, * fallback_refresh?: bool, * } $args */ public function __construct(\WP_Customize_Selective_Refresh $component, $id, $args = array()) { } /** * Retrieves parsed ID data for multidimensional setting. * * @since 4.5.0 * * @return array { * ID data for multidimensional partial. * * @type string $base ID base. * @type array $keys Keys for multidimensional array. * } * @phpstan-return array{ * base: string, * keys: array, * } */ public final function id_data() { } /** * Renders the template partial involving the associated settings. * * @since 4.5.0 * * @param array $container_context Optional. Array of context data associated with the target container (placement). * Default empty array. * @return string|array|false The rendered partial as a string, raw data array (for client-side JS template), * or false if no render applied. */ public final function render($container_context = array()) { } /** * Default callback used when invoking WP_Customize_Control::render(). * * Note that this method may echo the partial *or* return the partial as * a string or array, but not both. Output buffering is performed when this * is called. Subclasses can override this with their specific logic, or they * may provide an 'render_callback' argument to the constructor. * * This method may return an HTML string for straight DOM injection, or it * may return an array for supporting Partial JS subclasses to render by * applying to client-side templating. * * @since 4.5.0 * * @param WP_Customize_Partial $partial Partial. * @param array $context Context. * @return string|array|false */ public function render_callback(\WP_Customize_Partial $partial, $context = array()) { } /** * Retrieves the data to export to the client via JSON. * * @since 4.5.0 * * @return array Array of parameters passed to the JavaScript. */ public function json() { } /** * Checks if the user can refresh this partial. * * Returns false if the user cannot manipulate one of the associated settings, * or if one of the associated settings does not exist. * * @since 4.5.0 * * @return bool False if user can't edit one of the related settings, * or if one of the associated settings does not exist. */ public final function check_capabilities() { } } /** * Core Customizer class for implementing selective refresh. * * @since 4.5.0 */ #[\AllowDynamicProperties] final class WP_Customize_Selective_Refresh { /** * Query var used in requests to render partials. * * @since 4.5.0 */ const RENDER_QUERY_VAR = 'wp_customize_render_partials'; /** * Customize manager. * * @since 4.5.0 * @var WP_Customize_Manager */ public $manager; /** * Plugin bootstrap for Partial Refresh functionality. * * @since 4.5.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. */ public function __construct(\WP_Customize_Manager $manager) { } /** * Retrieves the registered partials. * * @since 4.5.0 * * @return array Partials. */ public function partials() { } /** * Adds a partial. * * @since 4.5.0 * * @see WP_Customize_Partial::__construct() * * @param WP_Customize_Partial|string $id Customize Partial object, or Partial ID. * @param array $args Optional. Array of properties for the new Partials object. * See WP_Customize_Partial::__construct() for information * on accepted arguments. Default empty array. * @return WP_Customize_Partial The instance of the partial that was added. * @phpstan-param array{ * type?: string, * selector?: string, * settings?: string[], * primary_setting?: string, * capability?: string, * render_callback?: callable, * container_inclusive?: bool, * fallback_refresh?: bool, * } $args See WP_Customize_Partial::__construct() */ public function add_partial($id, $args = array()) { } /** * Retrieves a partial. * * @since 4.5.0 * * @param string $id Customize Partial ID. * @return WP_Customize_Partial|null The partial, if set. Otherwise null. */ public function get_partial($id) { } /** * Removes a partial. * * @since 4.5.0 * * @param string $id Customize Partial ID. */ public function remove_partial($id) { } /** * Initializes the Customizer preview. * * @since 4.5.0 */ public function init_preview() { } /** * Enqueues preview scripts. * * @since 4.5.0 */ public function enqueue_preview_scripts() { } /** * Exports data in preview after it has finished rendering so that partials can be added at runtime. * * @since 4.5.0 */ public function export_preview_data() { } /** * Registers dynamically-created partials. * * @since 4.5.0 * * @see WP_Customize_Manager::add_dynamic_settings() * * @param string[] $partial_ids Array of the partial IDs to add. * @return WP_Customize_Partial[] Array of added WP_Customize_Partial instances. */ public function add_dynamic_partials($partial_ids) { } /** * Checks whether the request is for rendering partials. * * Note that this will not consider whether the request is authorized or valid, * just that essentially the route is a match. * * @since 4.5.0 * * @return bool Whether the request is for rendering partials. */ public function is_render_partials_request() { } /** * Handles PHP errors triggered during rendering the partials. * * These errors will be relayed back to the client in the Ajax response. * * @since 4.5.0 * * @param int $errno Error number. * @param string $errstr Error string. * @param string $errfile Error file. * @param int $errline Error line. * @return true Always true. */ public function handle_error($errno, $errstr, $errfile = \null, $errline = \null) { } /** * Handles the Ajax request to return the rendered partials for the requested placements. * * @since 4.5.0 * @phpstan-return void */ public function handle_render_partials_request() { } } /** * Customizer section representing widget area (sidebar). * * @since 4.1.0 * * @see WP_Customize_Section */ class WP_Customize_Sidebar_Section extends \WP_Customize_Section { /** * Type of this section. * * @since 4.1.0 * @var string */ public $type = 'sidebar'; /** * Unique identifier. * * @since 4.1.0 * @var string */ public $sidebar_id; /** * Gather the parameters passed to client JavaScript via JSON. * * @since 4.1.0 * * @return array The array to be exported to the client as JSON. */ public function json() { } /** * Whether the current sidebar is rendered on the page. * * @since 4.1.0 * * @return bool Whether sidebar is rendered. */ public function active_callback() { } } /** * Customize Site Icon control class. * * Used only for custom functionality in JavaScript. * * @since 4.3.0 * * @see WP_Customize_Cropped_Image_Control */ class WP_Customize_Site_Icon_Control extends \WP_Customize_Cropped_Image_Control { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'site_icon'; /** * Constructor. * * @since 4.3.0 * * @see WP_Customize_Control::__construct() * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Optional. Arguments to override class property defaults. * See WP_Customize_Control::__construct() for information * on accepted arguments. Default empty array. * @phpstan-param array{ * instance_number?: int, * manager?: WP_Customize_Manager, * id?: string, * settings?: array, * setting?: string, * capability?: string, * priority?: int, * section?: string, * label?: string, * description?: string, * choices?: array, * input_attrs?: array, * allow_addition?: bool, * json?: array, * type?: string, * active_callback?: callable, * } $args See WP_Customize_Control::__construct() */ public function __construct($manager, $id, $args = array()) { } /** * Renders a JS template for the content of the site icon control. * * @since 4.5.0 */ public function content_template() { } } /** * Customize Theme Control class. * * @since 4.2.0 * * @see WP_Customize_Control */ class WP_Customize_Theme_Control extends \WP_Customize_Control { /** * Customize control type. * * @since 4.2.0 * @var string */ public $type = 'theme'; /** * Theme object. * * @since 4.2.0 * @var WP_Theme */ public $theme; /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 4.2.0 * * @see WP_Customize_Control::to_json() */ public function to_json() { } /** * Don't render the control content from PHP, as it's rendered via JS on load. * * @since 4.2.0 */ public function render_content() { } /** * Render a JS template for theme display. * * @since 4.2.0 */ public function content_template() { } } /** * Customize Themes Panel Class * * @since 4.9.0 * * @see WP_Customize_Panel */ class WP_Customize_Themes_Panel extends \WP_Customize_Panel { /** * Panel type. * * @since 4.9.0 * @var string */ public $type = 'themes'; /** * An Underscore (JS) template for rendering this panel's container. * * The themes panel renders a custom panel heading with the active theme and a switch themes button. * * @see WP_Customize_Panel::print_template() * * @since 4.9.0 */ protected function render_template() { } /** * An Underscore (JS) template for this panel's content (but not its container). * * Class variables for this panel class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Panel::json(). * * @since 4.9.0 * * @see WP_Customize_Panel::print_template() */ protected function content_template() { } } /** * Customize Themes Section class. * * A UI container for theme controls, which are displayed within sections. * * @since 4.2.0 * * @see WP_Customize_Section */ class WP_Customize_Themes_Section extends \WP_Customize_Section { /** * Section type. * * @since 4.2.0 * @var string */ public $type = 'themes'; /** * Theme section action. * * Defines the type of themes to load (installed, wporg, etc.). * * @since 4.9.0 * @var string */ public $action = ''; /** * Theme section filter type. * * Determines whether filters are applied to loaded (local) themes or by initiating a new remote query (remote). * When filtering is local, the initial themes query is not paginated by default. * * @since 4.9.0 * @var string */ public $filter_type = 'local'; /** * Gets section parameters for JS. * * @since 4.9.0 * @return array Exported parameters. */ public function json() { } /** * Renders a themes section as a JS template. * * The template is only rendered by PHP once, so all actions are prepared at once on the server side. * * @since 4.9.0 */ protected function render_template() { } /** * Renders the filter bar portion of a themes section as a JS template. * * The template is only rendered by PHP once, so all actions are prepared at once on the server side. * The filter bar container is rendered by {@see render_template()}. * * @since 4.9.0 */ protected function filter_bar_content_template() { } /** * Renders the filter drawer portion of a themes section as a JS template. * * The filter bar container is rendered by {@see render_template()}. * * @since 4.9.0 */ protected function filter_drawer_content_template() { } } /** * Core class used to implement the widgets block editor control in the * customizer. * * @since 5.8.0 * * @see WP_Customize_Control */ class WP_Sidebar_Block_Editor_Control extends \WP_Customize_Control { /** * The control type. * * @since 5.8.0 * * @var string */ public $type = 'sidebar_block_editor'; /** * Render the widgets block editor container. * * @since 5.8.0 */ public function render_content() { } } /** * Widget Area Customize Control class. * * @since 3.9.0 * * @see WP_Customize_Control */ class WP_Widget_Area_Customize_Control extends \WP_Customize_Control { /** * Customize control type. * * @since 3.9.0 * @var string */ public $type = 'sidebar_widgets'; /** * Sidebar ID. * * @since 3.9.0 * @var int|string */ public $sidebar_id; /** * Refreshes the parameters passed to the JavaScript via JSON. * * @since 3.9.0 */ public function to_json() { } /** * Renders the control's content. * * @since 3.9.0 */ public function render_content() { } } /** * Widget Form Customize Control class. * * @since 3.9.0 * * @see WP_Customize_Control */ class WP_Widget_Form_Customize_Control extends \WP_Customize_Control { /** * Customize control type. * * @since 3.9.0 * @var string */ public $type = 'widget_form'; /** * Widget ID. * * @since 3.9.0 * @var string */ public $widget_id; /** * Widget ID base. * * @since 3.9.0 * @var string */ public $widget_id_base; /** * Sidebar ID. * * @since 3.9.0 * @var string */ public $sidebar_id; /** * Widget status. * * @since 3.9.0 * @var bool True if new, false otherwise. Default false. */ public $is_new = \false; /** * Widget width. * * @since 3.9.0 * @var int */ public $width; /** * Widget height. * * @since 3.9.0 * @var int */ public $height; /** * Widget mode. * * @since 3.9.0 * @var bool True if wide, false otherwise. Default false. */ public $is_wide = \false; /** * Gather control params for exporting to JavaScript. * * @since 3.9.0 * * @global array $wp_registered_widgets */ public function to_json() { } /** * Override render_content to be no-op since content is exported via to_json for deferred embedding. * * @since 3.9.0 */ public function render_content() { } /** * Whether the current widget is rendered on the page. * * @since 4.0.0 * * @return bool Whether the widget is rendered. */ public function active_callback() { } } /** * Font Collection class. * * @since 6.5.0 * * @see wp_register_font_collection() */ final class WP_Font_Collection { /** * The unique slug for the font collection. * * @since 6.5.0 * @var string */ public $slug; /** * WP_Font_Collection constructor. * * @since 6.5.0 * * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes, * and underscores. See sanitize_title(). * @param array $args Font collection data. See wp_register_font_collection() for information on accepted arguments. * @phpstan-param array{ * name?: string, * description?: string, * font_families?: array|string, * categories?: array, * } $args See wp_register_font_collection() */ public function __construct(string $slug, array $args) { } /** * Retrieves the font collection data. * * @since 6.5.0 * * @return array|WP_Error An array containing the font collection data, or a WP_Error on failure. */ public function get_data() { } } /** * The Font Face Resolver abstracts the processing of different data sources * (such as theme.json) for processing within the Font Face. * * This class is for internal core usage and is not supposed to be used by * extenders (plugins and/or themes). * * @access private */ class WP_Font_Face_Resolver { /** * Gets fonts defined in theme.json. * * @since 6.4.0 * * @return array Returns the font-families, each with their font-face variations. */ public static function get_fonts_from_theme_json() { } /** * Gets fonts defined in style variations. * * @since 6.7.0 * * @return array Returns an array of font-families. */ public static function get_fonts_from_style_variations() { } } /** * Font Face generates and prints `@font-face` styles for given fonts. * * @since 6.4.0 */ class WP_Font_Face { /** * Creates and initializes an instance of WP_Font_Face. * * @since 6.4.0 */ public function __construct() { } /** * Generates and prints the `@font-face` styles for the given fonts. * * @since 6.4.0 * * @param array[][] $fonts Optional. The font-families and their font variations. * See {@see wp_print_font_faces()} for the supported fields. * Default empty array. * @phpstan-param array[]<int|string, array{ * ?: array<array-key, array{ * font-family: string, * src: string|string[], * font-style?: string, * font-weight?: string, * font-display?: string, * ascent-override?: string, * descent-override?: string, * font-stretch?: string, * font-variant?: string, * font-feature-settings?: string, * font-variation-settings?: string, * line-gap-override?: string, * size-adjust?: string, * unicode-range?: string, * }>, * }> $fonts See wp_print_font_faces() * @phpstan-return void */ public function generate_and_print(array $fonts) { } } /** * Font Library class. * * @since 6.5.0 */ class WP_Font_Library { /** * Register a new font collection. * * @since 6.5.0 * * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes, * and underscores. See sanitize_title(). * @param array $args Font collection data. See wp_register_font_collection() for information on accepted arguments. * @return WP_Font_Collection|WP_Error A font collection if it was registered successfully, * or WP_Error object on failure. * @phpstan-param array{ * name?: string, * description?: string, * font_families?: array|string, * categories?: array, * } $args See wp_register_font_collection() */ public function register_font_collection(string $slug, array $args) { } /** * Unregisters a previously registered font collection. * * @since 6.5.0 * * @param string $slug Font collection slug. * @return bool True if the font collection was unregistered successfully and false otherwise. */ public function unregister_font_collection(string $slug) { } /** * Gets all the font collections available. * * @since 6.5.0 * * @return array List of font collections. */ public function get_font_collections() { } /** * Gets a font collection. * * @since 6.5.0 * * @param string $slug Font collection slug. * @return WP_Font_Collection|null Font collection object, or null if the font collection doesn't exist. */ public function get_font_collection(string $slug) { } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 6.5.0 * * @return WP_Font_Library The main instance. */ public static function get_instance() { } } /** * A class of utilities for working with the Font Library. * * These utilities may change or be removed in the future and are intended for internal use only. * * @since 6.5.0 * @access private */ class WP_Font_Utils { /** * Sanitizes and formats font family names. * * - Applies `sanitize_text_field`. * - Adds surrounding quotes to names containing any characters that are not alphabetic or dashes. * * It follows the recommendations from the CSS Fonts Module Level 4. * @link https://www.w3.org/TR/css-fonts-4/#font-family-prop * * @since 6.5.0 * @access private * * @see sanitize_text_field() * * @param string $font_family Font family name(s), comma-separated. * @return string Sanitized and formatted font family name(s). */ public static function sanitize_font_family($font_family) { } /** * Generates a slug from font face properties, e.g. `open sans;normal;400;100%;U+0-10FFFF` * * Used for comparison with other font faces in the same family, to prevent duplicates * that would both match according the CSS font matching spec. Uses only simple case-insensitive * matching for fontFamily and unicodeRange, so does not handle overlapping font-family lists or * unicode ranges. * * @since 6.5.0 * @access private * * @link https://drafts.csswg.org/css-fonts/#font-style-matching * * @param array $settings { * Font face settings. * * @type string $fontFamily Font family name. * @type string $fontStyle Optional font style, defaults to 'normal'. * @type string $fontWeight Optional font weight, defaults to 400. * @type string $fontStretch Optional font stretch, defaults to '100%'. * @type string $unicodeRange Optional unicode range, defaults to 'U+0-10FFFF'. * } * @return string Font face slug. * @phpstan-param array{ * fontFamily?: string, * fontStyle?: string, * fontWeight?: string, * fontStretch?: string, * unicodeRange?: string, * } $settings */ public static function get_font_face_slug($settings) { } /** * Sanitizes a tree of data using a schema. * * The schema structure should mirror the data tree. Each value provided in the * schema should be a callable that will be applied to sanitize the corresponding * value in the data tree. Keys that are in the data tree, but not present in the * schema, will be removed in the sanitized data. Nested arrays are traversed recursively. * * @since 6.5.0 * * @access private * * @param array $tree The data to sanitize. * @param array $schema The schema used for sanitization. * @return array The sanitized data. */ public static function sanitize_from_schema($tree, $schema) { } /** * Returns the expected mime-type values for font files, depending on PHP version. * * This is needed because font mime types vary by PHP version, so checking the PHP version * is necessary until a list of valid mime-types for each file extension can be provided to * the 'upload_mimes' filter. * * @since 6.5.0 * * @access private * * @return string[] A collection of mime types keyed by file extension. */ public static function get_allowed_font_mime_types() { } } /** * Core class used by the HTML processor during HTML parsing * for managing the stack of active formatting elements. * * This class is designed for internal use by the HTML processor. * * > Initially, the list of active formatting elements is empty. * > It is used to handle mis-nested formatting element tags. * > * > The list contains elements in the formatting category, and markers. * > The markers are inserted when entering applet, object, marquee, * > template, td, th, and caption elements, and are used to prevent * > formatting from "leaking" into applet, object, marquee, template, * > td, th, and caption elements. * > * > In addition, each element in the list of active formatting elements * > is associated with the token for which it was created, so that * > further elements can be created for that token if necessary. * * @since 6.4.0 * * @access private * * @see https://html.spec.whatwg.org/#list-of-active-formatting-elements * @see WP_HTML_Processor */ class WP_HTML_Active_Formatting_Elements { /** * Reports if a specific node is in the stack of active formatting elements. * * @since 6.4.0 * * @param WP_HTML_Token $token Look for this node in the stack. * @return bool Whether the referenced node is in the stack of active formatting elements. */ public function contains_node(\WP_HTML_Token $token) { } /** * Returns how many nodes are currently in the stack of active formatting elements. * * @since 6.4.0 * * @return int How many node are in the stack of active formatting elements. */ public function count() { } /** * Returns the node at the end of the stack of active formatting elements, * if one exists. If the stack is empty, returns null. * * @since 6.4.0 * * @return WP_HTML_Token|null Last node in the stack of active formatting elements, if one exists, otherwise null. */ public function current_node() { } /** * Inserts a "marker" at the end of the list of active formatting elements. * * > The markers are inserted when entering applet, object, marquee, * > template, td, th, and caption elements, and are used to prevent * > formatting from "leaking" into applet, object, marquee, template, * > td, th, and caption elements. * * @see https://html.spec.whatwg.org/#concept-parser-marker * * @since 6.7.0 */ public function insert_marker() : void { } /** * Pushes a node onto the stack of active formatting elements. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#push-onto-the-list-of-active-formatting-elements * * @param WP_HTML_Token $token Push this node onto the stack. */ public function push(\WP_HTML_Token $token) { } /** * Removes a node from the stack of active formatting elements. * * @since 6.4.0 * * @param WP_HTML_Token $token Remove this node from the stack, if it's there already. * @return bool Whether the node was found and removed from the stack of active formatting elements. */ public function remove_node(\WP_HTML_Token $token) { } /** * Steps through the stack of active formatting elements, starting with the * top element (added first) and walking downwards to the one added last. * * This generator function is designed to be used inside a "foreach" loop. * * Example: * * $html = '<em><strong><a>We are here'; * foreach ( $stack->walk_down() as $node ) { * echo "{$node->node_name} -> "; * } * > EM -> STRONG -> A -> * * To start with the most-recently added element and walk towards the top, * see WP_HTML_Active_Formatting_Elements::walk_up(). * * @since 6.4.0 */ public function walk_down() { } /** * Steps through the stack of active formatting elements, starting with the * bottom element (added last) and walking upwards to the one added first. * * This generator function is designed to be used inside a "foreach" loop. * * Example: * * $html = '<em><strong><a>We are here'; * foreach ( $stack->walk_up() as $node ) { * echo "{$node->node_name} -> "; * } * > A -> STRONG -> EM -> * * To start with the first added element and walk towards the bottom, * see WP_HTML_Active_Formatting_Elements::walk_down(). * * @since 6.4.0 */ public function walk_up() { } /** * Clears the list of active formatting elements up to the last marker. * * > When the steps below require the UA to clear the list of active formatting elements up to * > the last marker, the UA must perform the following steps: * > * > 1. Let entry be the last (most recently added) entry in the list of active * > formatting elements. * > 2. Remove entry from the list of active formatting elements. * > 3. If entry was a marker, then stop the algorithm at this point. * > The list has been cleared up to the last marker. * > 4. Go to step 1. * * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker * * @since 6.7.0 */ public function clear_up_to_last_marker() : void { } } /** * Core class used by the HTML tag processor as a data structure for the attribute token, * allowing to drastically improve performance. * * This class is for internal usage of the WP_HTML_Tag_Processor class. * * @access private * @since 6.2.0 * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`. * * @see WP_HTML_Tag_Processor */ class WP_HTML_Attribute_Token { /** * Attribute name. * * @since 6.2.0 * * @var string */ public $name; /** * Attribute value. * * @since 6.2.0 * * @var int */ public $value_starts_at; /** * How many bytes the value occupies in the input HTML. * * @since 6.2.0 * * @var int */ public $value_length; /** * The string offset where the attribute name starts. * * @since 6.2.0 * * @var int */ public $start; /** * Byte length of text spanning the attribute inside a tag. * * This span starts at the first character of the attribute name * and it ends after one of three cases: * * - at the end of the attribute name for boolean attributes. * - at the end of the value for unquoted attributes. * - at the final single or double quote for quoted attributes. * * Example: * * <div class="post"> * ------------ length is 12, including quotes * * <input type="checked" checked id="selector"> * ------- length is 6 * * <a rel=noopener> * ------------ length is 11 * * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`. * * @var int */ public $length; /** * Whether the attribute is a boolean attribute with value `true`. * * @since 6.2.0 * * @var bool */ public $is_true; /** * Constructor. * * @since 6.2.0 * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`. * * @param string $name Attribute name. * @param int $value_start Attribute value. * @param int $value_length Number of bytes attribute value spans. * @param int $start The string offset where the attribute name starts. * @param int $length Byte length of the entire attribute name or name and value pair expression. * @param bool $is_true Whether the attribute is a boolean attribute with true value. */ public function __construct($name, $value_start, $value_length, $start, $length, $is_true) { } } /** * HTML API: WP_HTML_Decoder class * * Decodes spans of raw text found inside HTML content. * * @package WordPress * @subpackage HTML-API * @since 6.6.0 */ class WP_HTML_Decoder { /** * Indicates if an attribute value starts with a given raw string value. * * Use this method to determine if an attribute value starts with a given string, regardless * of how it might be encoded in HTML. For instance, `http:` could be represented as `http:` * or as `http:` or as `http:` or as `http:`, or in many other ways. * * Example: * * $value = 'http://wordpress.org/'; * true === WP_HTML_Decoder::attribute_starts_with( $value, 'http:', 'ascii-case-insensitive' ); * false === WP_HTML_Decoder::attribute_starts_with( $value, 'https:', 'ascii-case-insensitive' ); * * @since 6.6.0 * * @param string $haystack String containing the raw non-decoded attribute value. * @param string $search_text Does the attribute value start with this plain string. * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. * Default 'case-sensitive'. * @return bool Whether the attribute value starts with the given string. */ public static function attribute_starts_with($haystack, $search_text, $case_sensitivity = 'case-sensitive') : bool { } /** * Returns a string containing the decoded value of a given HTML text node. * * Text nodes appear in HTML DATA sections, which are the text segments inside * and around tags, excepting SCRIPT and STYLE elements (and some others), * whose inner text is not decoded. Use this function to read the decoded * value of such a text span in an HTML document. * * Example: * * '“😄”' === WP_HTML_Decode::decode_text_node( '“😄”' ); * * @since 6.6.0 * * @param string $text Text containing raw and non-decoded text node to decode. * @return string Decoded UTF-8 value of given text node. */ public static function decode_text_node($text) : string { } /** * Returns a string containing the decoded value of a given HTML attribute. * * Text found inside an HTML attribute has different parsing rules than for * text found inside other markup, or DATA segments. Use this function to * read the decoded value of an HTML string inside a quoted attribute. * * Example: * * '“😄”' === WP_HTML_Decode::decode_attribute( '“😄”' ); * * @since 6.6.0 * * @param string $text Text containing raw and non-decoded attribute value to decode. * @return string Decoded UTF-8 value of given attribute value. */ public static function decode_attribute($text) : string { } /** * Decodes a span of HTML text, depending on the context in which it's found. * * This is a low-level method; prefer calling WP_HTML_Decoder::decode_attribute() or * WP_HTML_Decoder::decode_text_node() instead. It's provided for cases where this * may be difficult to do from calling code. * * Example: * * '©' = WP_HTML_Decoder::decode( 'data', '©' ); * * @since 6.6.0 * * @access private * * @param string $context `attribute` for decoding attribute values, `data` otherwise. * @param string $text Text document containing span of text to decode. * @return string Decoded UTF-8 string. */ public static function decode($context, $text) : string { } /** * Attempt to read a character reference at the given location in a given string, * depending on the context in which it's found. * * If a character reference is found, this function will return the translated value * that the reference maps to. It will then set `$match_byte_length` the * number of bytes of input it read while consuming the character reference. This * gives calling code the opportunity to advance its cursor when traversing a string * and decoding. * * Example: * * null === WP_HTML_Decoder::read_character_reference( 'attribute', 'Ships…', 0 ); * '…' === WP_HTML_Decoder::read_character_reference( 'attribute', 'Ships…', 5, $token_length ); * 8 === $token_length; // `…` * * null === WP_HTML_Decoder::read_character_reference( 'attribute', '¬in', 0 ); * '∉' === WP_HTML_Decoder::read_character_reference( 'attribute', '∉', 0, $token_length ); * 7 === $token_length; // `∉` * * '¬' === WP_HTML_Decoder::read_character_reference( 'data', '¬in', 0, $token_length ); * 4 === $token_length; // `¬` * '∉' === WP_HTML_Decoder::read_character_reference( 'data', '∉', 0, $token_length ); * 7 === $token_length; // `∉` * * @since 6.6.0 * * @global WP_Token_Map $html5_named_character_references Mappings for HTML5 named character references. * * @param string $context `attribute` for decoding attribute values, `data` otherwise. * @param string $text Text document containing span of text to decode. * @param int $at Optional. Byte offset into text where span begins, defaults to the beginning (0). * @param int &$match_byte_length Optional. Set to byte-length of character reference if provided and if a match * is found, otherwise not set. Default null. * @return string|false Decoded character reference in UTF-8 if found, otherwise `false`. */ public static function read_character_reference($context, $text, $at = 0, &$match_byte_length = \null) { } /** * Encode a code point number into the UTF-8 encoding. * * This encoder implements the UTF-8 encoding algorithm for converting * a code point into a byte sequence. If it receives an invalid code * point it will return the Unicode Replacement Character U+FFFD `�`. * * Example: * * '🅰' === WP_HTML_Decoder::code_point_to_utf8_bytes( 0x1f170 ); * * // Half of a surrogate pair is an invalid code point. * '�' === WP_HTML_Decoder::code_point_to_utf8_bytes( 0xd83c ); * * @since 6.6.0 * * @see https://www.rfc-editor.org/rfc/rfc3629 For the UTF-8 standard. * * @param int $code_point Which code point to convert. * @return string Converted code point, or `�` if invalid. */ public static function code_point_to_utf8_bytes($code_point) : string { } } /** * Core class used by the HTML API to represent a DOCTYPE declaration. * * This class parses DOCTYPE tokens for the full parser in the HTML Processor. * Most code interacting with HTML won't need to parse DOCTYPE declarations; * the HTML Processor is one exception. Consult the HTML Processor for proper * parsing of an HTML document. * * A DOCTYPE declaration may indicate its document compatibility mode, which impacts * the structure of the following HTML as well as the behavior of CSS class selectors. * There are three possible modes: * * - "no-quirks" and "limited-quirks" modes (also called "standards mode"). * - "quirks" mode. * * These modes mostly determine whether CSS class name selectors match values in the * HTML `class` attribute in an ASCII-case-insensitive way (quirks mode), or whether * they match only when byte-for-byte identical (no-quirks mode). * * All HTML documents should start with the standard HTML5 DOCTYPE: `<!DOCTYPE html>`. * * > DOCTYPEs are required for legacy reasons. When omitted, browsers tend to use a different * > rendering mode that is incompatible with some specifications. Including the DOCTYPE in a * > document ensures that the browser makes a best-effort attempt at following the * > relevant specifications. * * @see https://html.spec.whatwg.org/#the-doctype * * DOCTYPE declarations comprise four properties: a name, public identifier, system identifier, * and an indication of which document compatability mode they would imply if an HTML parser * hadn't already determined it from other information. * * @see https://html.spec.whatwg.org/#the-initial-insertion-mode * * Historically, the DOCTYPE declaration was used in SGML documents to instruct a parser how * to interpret the various tags and entities within a document. Its role in HTML diverged * from how it was used in SGML and no meaning should be back-read into HTML based on how it * is used in SGML, XML, or XHTML documents. * * @see https://www.iso.org/standard/16387.html * * @since 6.7.0 * * @see WP_HTML_Processor */ class WP_HTML_Doctype_Info { /** * Name of the DOCTYPE: should be "html" for HTML documents. * * This value should be considered "read only" and not modified. * * Historically the DOCTYPE name indicates name of the document's root element. * * <!DOCTYPE html> * ╰──┴── name is "html". * * @see https://html.spec.whatwg.org/#tokenization * * @since 6.7.0 * * @var string|null */ public $name = \null; /** * Public identifier of the DOCTYPE. * * This value should be considered "read only" and not modified. * * The public identifier is optional and should not appear in HTML documents. * A `null` value indicates that no public identifier was present in the DOCTYPE. * * Historically the presence of the public identifier indicated that a document * was meant to be shared between computer systems and the value indicated to a * knowledgeable parser how to find the relevant document type definition (DTD). * * <!DOCTYPE html PUBLIC "public id goes here in quotes"> * │ │ ╰─── public identifier ─────╯ * ╰──┴── name is "html". * * @see https://html.spec.whatwg.org/#tokenization * * @since 6.7.0 * * @var string|null */ public $public_identifier = \null; /** * System identifier of the DOCTYPE. * * This value should be considered "read only" and not modified. * * The system identifier is optional and should not appear in HTML documents. * A `null` value indicates that no system identifier was present in the DOCTYPE. * * Historically the system identifier specified where a relevant document type * declaration for the given document is stored and may be retrieved. * * <!DOCTYPE html SYSTEM "system id goes here in quotes"> * │ │ ╰──── system identifier ────╯ * ╰──┴── name is "html". * * If a public identifier were provided it would indicate to a knowledgeable * parser how to interpret the system identifier. * * <!DOCTYPE html PUBLIC "public id goes here in quotes" "system id goes here in quotes"> * │ │ ╰─── public identifier ─────╯ ╰──── system identifier ────╯ * ╰──┴── name is "html". * * @see https://html.spec.whatwg.org/#tokenization * * @since 6.7.0 * * @var string|null */ public $system_identifier = \null; /** * Which document compatability mode this DOCTYPE declaration indicates. * * This value should be considered "read only" and not modified. * * When an HTML parser has not already set the document compatability mode, * (e.g. "quirks" or "no-quirks" mode), it will infer if from the properties * of the appropriate DOCTYPE declaration, if one exists. The DOCTYPE can * indicate one of three possible document compatability modes: * * - "no-quirks" and "limited-quirks" modes (also called "standards" mode). * - "quirks" mode (also called `CSS1Compat` mode). * * An appropriate DOCTYPE is one encountered in the "initial" insertion mode, * before the HTML element has been opened and before finding any other * DOCTYPE declaration tokens. * * @see https://html.spec.whatwg.org/#the-initial-insertion-mode * * @since 6.7.0 * * @var string One of "no-quirks", "limited-quirks", or "quirks". */ public $indicated_compatability_mode; /** * Creates a WP_HTML_Doctype_Info instance by parsing a raw DOCTYPE declaration token. * * Use this method to parse a DOCTYPE declaration token and get access to its properties * via the returned WP_HTML_Doctype_Info class instance. The provided input must parse * properly as a DOCTYPE declaration, though it must not represent a valid DOCTYPE. * * Example: * * // Normative HTML DOCTYPE declaration. * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '<!DOCTYPE html>' ); * 'no-quirks' === $doctype->indicated_compatability_mode; * * // A nonsensical DOCTYPE is still valid, and will indicate "quirks" mode. * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '<!doctypeJSON SILLY "nonsense\'>' ); * 'quirks' === $doctype->indicated_compatability_mode; * * // Textual quirks present in raw HTML are handled appropriately. * $doctype = WP_HTML_Doctype_Info::from_doctype_token( "<!DOCTYPE\nhtml\n>" ); * 'no-quirks' === $doctype->indicated_compatability_mode; * * // Anything other than a proper DOCTYPE declaration token fails to parse. * null === WP_HTML_Doctype_Info::from_doctype_token( ' <!DOCTYPE>' ); * null === WP_HTML_Doctype_Info::from_doctype_token( '<!DOCTYPE ><p>' ); * null === WP_HTML_Doctype_Info::from_doctype_token( '<!TYPEDOC>' ); * null === WP_HTML_Doctype_Info::from_doctype_token( 'html' ); * null === WP_HTML_Doctype_Info::from_doctype_token( '<?xml version="1.0" encoding="UTF-8" ?>' ); * * @since 6.7.0 * * @param string $doctype_html The complete raw DOCTYPE HTML string, e.g. `<!DOCTYPE html>`. * * @return WP_HTML_Doctype_Info|null A WP_HTML_Doctype_Info instance will be returned if the * provided DOCTYPE HTML is a valid DOCTYPE. Otherwise, null. */ public static function from_doctype_token(string $doctype_html) : ?self { } } /** * Core class used by the HTML processor during HTML parsing * for managing the stack of open elements. * * This class is designed for internal use by the HTML processor. * * > Initially, the stack of open elements is empty. The stack grows * > downwards; the topmost node on the stack is the first one added * > to the stack, and the bottommost node of the stack is the most * > recently added node in the stack (notwithstanding when the stack * > is manipulated in a random access fashion as part of the handling * > for misnested tags). * * @since 6.4.0 * * @access private * * @see https://html.spec.whatwg.org/#stack-of-open-elements * @see WP_HTML_Processor */ class WP_HTML_Open_Elements { /** * Holds the stack of open element references. * * @since 6.4.0 * * @var WP_HTML_Token[] */ public $stack = array(); /** * Sets a pop handler that will be called when an item is popped off the stack of * open elements. * * The function will be called with the pushed item as its argument. * * @since 6.6.0 * * @param Closure $handler The handler function. */ public function set_pop_handler(\Closure $handler) : void { } /** * Sets a push handler that will be called when an item is pushed onto the stack of * open elements. * * The function will be called with the pushed item as its argument. * * @since 6.6.0 * * @param Closure $handler The handler function. */ public function set_push_handler(\Closure $handler) : void { } /** * Returns the name of the node at the nth position on the stack * of open elements, or `null` if no such position exists. * * Note that this uses a 1-based index, which represents the * "nth item" on the stack, counting from the top, where the * top-most element is the 1st, the second is the 2nd, etc... * * @since 6.7.0 * * @param int $nth Retrieve the nth item on the stack, with 1 being * the top element, 2 being the second, etc... * @return WP_HTML_Token|null Name of the node on the stack at the given location, * or `null` if the location isn't on the stack. */ public function at(int $nth) : ?\WP_HTML_Token { } /** * Reports if a node of a given name is in the stack of open elements. * * @since 6.7.0 * * @param string $node_name Name of node for which to check. * @return bool Whether a node of the given name is in the stack of open elements. */ public function contains(string $node_name) : bool { } /** * Reports if a specific node is in the stack of open elements. * * @since 6.4.0 * * @param WP_HTML_Token $token Look for this node in the stack. * @return bool Whether the referenced node is in the stack of open elements. */ public function contains_node(\WP_HTML_Token $token) : bool { } /** * Returns how many nodes are currently in the stack of open elements. * * @since 6.4.0 * * @return int How many node are in the stack of open elements. */ public function count() : int { } /** * Returns the node at the end of the stack of open elements, * if one exists. If the stack is empty, returns null. * * @since 6.4.0 * * @return WP_HTML_Token|null Last node in the stack of open elements, if one exists, otherwise null. */ public function current_node() : ?\WP_HTML_Token { } /** * Indicates if the current node is of a given type or name. * * It's possible to pass either a node type or a node name to this function. * In the case there is no current element it will always return `false`. * * Example: * * // Is the current node a text node? * $stack->current_node_is( '#text' ); * * // Is the current node a DIV element? * $stack->current_node_is( 'DIV' ); * * // Is the current node any element/tag? * $stack->current_node_is( '#tag' ); * * @see WP_HTML_Tag_Processor::get_token_type * @see WP_HTML_Tag_Processor::get_token_name * * @since 6.7.0 * * @access private * * @param string $identity Check if the current node has this name or type (depending on what is provided). * @return bool Whether there is a current element that matches the given identity, whether a token name or type. */ public function current_node_is(string $identity) : bool { } /** * Returns whether an element is in a specific scope. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#has-an-element-in-the-specific-scope * * @param string $tag_name Name of tag check. * @param string[] $termination_list List of elements that terminate the search. * @return bool Whether the element was found in a specific scope. */ public function has_element_in_specific_scope(string $tag_name, $termination_list) : bool { } /** * Returns whether a particular element is in scope. * * > The stack of open elements is said to have a particular element in * > scope when it has that element in the specific scope consisting of * > the following element types: * > * > - applet * > - caption * > - html * > - table * > - td * > - th * > - marquee * > - object * > - template * > - MathML mi * > - MathML mo * > - MathML mn * > - MathML ms * > - MathML mtext * > - MathML annotation-xml * > - SVG foreignObject * > - SVG desc * > - SVG title * * @since 6.4.0 * @since 6.7.0 Full support. * * @see https://html.spec.whatwg.org/#has-an-element-in-scope * * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ public function has_element_in_scope(string $tag_name) : bool { } /** * Returns whether a particular element is in list item scope. * * > The stack of open elements is said to have a particular element * > in list item scope when it has that element in the specific scope * > consisting of the following element types: * > * > - All the element types listed above for the has an element in scope algorithm. * > - ol in the HTML namespace * > - ul in the HTML namespace * * @since 6.4.0 * @since 6.5.0 Implemented: no longer throws on every invocation. * @since 6.7.0 Supports all required HTML elements. * * @see https://html.spec.whatwg.org/#has-an-element-in-list-item-scope * * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ public function has_element_in_list_item_scope(string $tag_name) : bool { } /** * Returns whether a particular element is in button scope. * * > The stack of open elements is said to have a particular element * > in button scope when it has that element in the specific scope * > consisting of the following element types: * > * > - All the element types listed above for the has an element in scope algorithm. * > - button in the HTML namespace * * @since 6.4.0 * @since 6.7.0 Supports all required HTML elements. * * @see https://html.spec.whatwg.org/#has-an-element-in-button-scope * * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ public function has_element_in_button_scope(string $tag_name) : bool { } /** * Returns whether a particular element is in table scope. * * > The stack of open elements is said to have a particular element * > in table scope when it has that element in the specific scope * > consisting of the following element types: * > * > - html in the HTML namespace * > - table in the HTML namespace * > - template in the HTML namespace * * @since 6.4.0 * @since 6.7.0 Full implementation. * * @see https://html.spec.whatwg.org/#has-an-element-in-table-scope * * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ public function has_element_in_table_scope(string $tag_name) : bool { } /** * Returns whether a particular element is in select scope. * * This test differs from the others like it, in that its rules are inverted. * Instead of arriving at a match when one of any tag in a termination group * is reached, this one terminates if any other tag is reached. * * > The stack of open elements is said to have a particular element in select scope when it has * > that element in the specific scope consisting of all element types except the following: * > - optgroup in the HTML namespace * > - option in the HTML namespace * * @since 6.4.0 Stub implementation (throws). * @since 6.7.0 Full implementation. * * @see https://html.spec.whatwg.org/#has-an-element-in-select-scope * * @param string $tag_name Name of tag to check. * @return bool Whether the given element is in SELECT scope. */ public function has_element_in_select_scope(string $tag_name) : bool { } /** * Returns whether a P is in BUTTON scope. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#has-an-element-in-button-scope * * @return bool Whether a P is in BUTTON scope. */ public function has_p_in_button_scope() : bool { } /** * Pops a node off of the stack of open elements. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#stack-of-open-elements * * @return bool Whether a node was popped off of the stack. */ public function pop() : bool { } /** * Pops nodes off of the stack of open elements until an HTML tag with the given name has been popped. * * @since 6.4.0 * * @see WP_HTML_Open_Elements::pop * * @param string $html_tag_name Name of tag that needs to be popped off of the stack of open elements. * @return bool Whether a tag of the given name was found and popped off of the stack of open elements. */ public function pop_until(string $html_tag_name) : bool { } /** * Pushes a node onto the stack of open elements. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#stack-of-open-elements * * @param WP_HTML_Token $stack_item Item to add onto stack. */ public function push(\WP_HTML_Token $stack_item) : void { } /** * Removes a specific node from the stack of open elements. * * @since 6.4.0 * * @param WP_HTML_Token $token The node to remove from the stack of open elements. * @return bool Whether the node was found and removed from the stack of open elements. */ public function remove_node(\WP_HTML_Token $token) : bool { } /** * Steps through the stack of open elements, starting with the top element * (added first) and walking downwards to the one added last. * * This generator function is designed to be used inside a "foreach" loop. * * Example: * * $html = '<em><strong><a>We are here'; * foreach ( $stack->walk_down() as $node ) { * echo "{$node->node_name} -> "; * } * > EM -> STRONG -> A -> * * To start with the most-recently added element and walk towards the top, * see WP_HTML_Open_Elements::walk_up(). * * @since 6.4.0 */ public function walk_down() { } /** * Steps through the stack of open elements, starting with the bottom element * (added last) and walking upwards to the one added first. * * This generator function is designed to be used inside a "foreach" loop. * * Example: * * $html = '<em><strong><a>We are here'; * foreach ( $stack->walk_up() as $node ) { * echo "{$node->node_name} -> "; * } * > A -> STRONG -> EM -> * * To start with the first added element and walk towards the bottom, * see WP_HTML_Open_Elements::walk_down(). * * @since 6.4.0 * @since 6.5.0 Accepts $above_this_node to start traversal above a given node, if it exists. * * @param WP_HTML_Token|null $above_this_node Optional. Start traversing above this node, * if provided and if the node exists. */ public function walk_up(?\WP_HTML_Token $above_this_node = \null) { } /** * Updates internal flags after adding an element. * * Certain conditions (such as "has_p_in_button_scope") are maintained here as * flags that are only modified when adding and removing elements. This allows * the HTML Processor to quickly check for these conditions instead of iterating * over the open stack elements upon each new tag it encounters. These flags, * however, need to be maintained as items are added and removed from the stack. * * @since 6.4.0 * * @param WP_HTML_Token $item Element that was added to the stack of open elements. */ public function after_element_push(\WP_HTML_Token $item) : void { } /** * Updates internal flags after removing an element. * * Certain conditions (such as "has_p_in_button_scope") are maintained here as * flags that are only modified when adding and removing elements. This allows * the HTML Processor to quickly check for these conditions instead of iterating * over the open stack elements upon each new tag it encounters. These flags, * however, need to be maintained as items are added and removed from the stack. * * @since 6.4.0 * * @param WP_HTML_Token $item Element that was removed from the stack of open elements. */ public function after_element_pop(\WP_HTML_Token $item) : void { } /** * Clear the stack back to a table context. * * > When the steps above require the UA to clear the stack back to a table context, it means * > that the UA must, while the current node is not a table, template, or html element, pop * > elements from the stack of open elements. * * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-context * * @since 6.7.0 */ public function clear_to_table_context() : void { } /** * Clear the stack back to a table body context. * * > When the steps above require the UA to clear the stack back to a table body context, it * > means that the UA must, while the current node is not a tbody, tfoot, thead, template, or * > html element, pop elements from the stack of open elements. * * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-body-context * * @since 6.7.0 */ public function clear_to_table_body_context() : void { } /** * Clear the stack back to a table row context. * * > When the steps above require the UA to clear the stack back to a table row context, it * > means that the UA must, while the current node is not a tr, template, or html element, pop * > elements from the stack of open elements. * * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-stack-back-to-a-table-row-context * * @since 6.7.0 */ public function clear_to_table_row_context() : void { } /** * Wakeup magic method. * * @since 6.6.0 */ public function __wakeup() { } } /** * Core class used by the HTML processor during HTML parsing * for managing the internal parsing state. * * This class is designed for internal use by the HTML processor. * * @since 6.4.0 * * @access private * * @see WP_HTML_Processor */ class WP_HTML_Processor_State { /* * Insertion mode constants. * * These constants exist and are named to make it easier to * discover and recognize the supported insertion modes in * the parser. * * Out of all the possible insertion modes, only those * supported by the parser are listed here. As support * is added to the parser for more modes, add them here * following the same naming and value pattern. * * @see https://html.spec.whatwg.org/#the-insertion-mode */ /** * Initial insertion mode for full HTML parser. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#the-initial-insertion-mode * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_INITIAL = 'insertion-mode-initial'; /** * Before HTML insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#the-before-html-insertion-mode * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_BEFORE_HTML = 'insertion-mode-before-html'; /** * Before head insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-beforehead * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_BEFORE_HEAD = 'insertion-mode-before-head'; /** * In head insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-inhead * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_HEAD = 'insertion-mode-in-head'; /** * In head noscript insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-inheadnoscript * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_HEAD_NOSCRIPT = 'insertion-mode-in-head-noscript'; /** * After head insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-afterhead * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_AFTER_HEAD = 'insertion-mode-after-head'; /** * In body insertion mode for full HTML parser. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#parsing-main-inbody * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_BODY = 'insertion-mode-in-body'; /** * In table insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-intable * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_TABLE = 'insertion-mode-in-table'; /** * In table text insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-intabletext * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_TABLE_TEXT = 'insertion-mode-in-table-text'; /** * In caption insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-incaption * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_CAPTION = 'insertion-mode-in-caption'; /** * In column group insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group'; /** * In table body insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-intablebody * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_TABLE_BODY = 'insertion-mode-in-table-body'; /** * In row insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-inrow * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_ROW = 'insertion-mode-in-row'; /** * In cell insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-incell * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_CELL = 'insertion-mode-in-cell'; /** * In select insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-inselect * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_SELECT = 'insertion-mode-in-select'; /** * In select in table insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-inselectintable * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_SELECT_IN_TABLE = 'insertion-mode-in-select-in-table'; /** * In template insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-intemplate * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_TEMPLATE = 'insertion-mode-in-template'; /** * After body insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-afterbody * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_AFTER_BODY = 'insertion-mode-after-body'; /** * In frameset insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-inframeset * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_IN_FRAMESET = 'insertion-mode-in-frameset'; /** * After frameset insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#parsing-main-afterframeset * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_AFTER_FRAMESET = 'insertion-mode-after-frameset'; /** * After after body insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#the-after-after-body-insertion-mode * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_AFTER_AFTER_BODY = 'insertion-mode-after-after-body'; /** * After after frameset insertion mode for full HTML parser. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#the-after-after-frameset-insertion-mode * @see WP_HTML_Processor_State::$insertion_mode * * @var string */ const INSERTION_MODE_AFTER_AFTER_FRAMESET = 'insertion-mode-after-after-frameset'; /** * The stack of template insertion modes. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/#the-insertion-mode:stack-of-template-insertion-modes * * @var array<string> */ public $stack_of_template_insertion_modes = array(); /** * Tracks open elements while scanning HTML. * * This property is initialized in the constructor and never null. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#stack-of-open-elements * * @var WP_HTML_Open_Elements */ public $stack_of_open_elements; /** * Tracks open formatting elements, used to handle mis-nested formatting element tags. * * This property is initialized in the constructor and never null. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#list-of-active-formatting-elements * * @var WP_HTML_Active_Formatting_Elements */ public $active_formatting_elements; /** * Refers to the currently-matched tag, if any. * * @since 6.4.0 * * @var WP_HTML_Token|null */ public $current_token = \null; /** * Tree construction insertion mode. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#insertion-mode * * @var string */ public $insertion_mode = self::INSERTION_MODE_INITIAL; /** * Context node initializing fragment parser, if created as a fragment parser. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#concept-frag-parse-context * * @var [string, array]|null */ public $context_node = \null; /** * The recognized encoding of the input byte stream. * * > The stream of code points that comprises the input to the tokenization * > stage will be initially seen by the user agent as a stream of bytes * > (typically coming over the network or from the local file system). * > The bytes encode the actual characters according to a particular character * > encoding, which the user agent uses to decode the bytes into characters. * * @since 6.7.0 * * @var string|null */ public $encoding = \null; /** * The parser's confidence in the input encoding. * * > When the HTML parser is decoding an input byte stream, it uses a character * > encoding and a confidence. The confidence is either tentative, certain, or * > irrelevant. The encoding used, and whether the confidence in that encoding * > is tentative or certain, is used during the parsing to determine whether to * > change the encoding. If no encoding is necessary, e.g. because the parser is * > operating on a Unicode stream and doesn't have to use a character encoding * > at all, then the confidence is irrelevant. * * @since 6.7.0 * * @var string */ public $encoding_confidence = 'tentative'; /** * HEAD element pointer. * * @since 6.7.0 * * @see https://html.spec.whatwg.org/multipage/parsing.html#head-element-pointer * * @var WP_HTML_Token|null */ public $head_element = \null; /** * FORM element pointer. * * > points to the last form element that was opened and whose end tag has * > not yet been seen. It is used to make form controls associate with * > forms in the face of dramatically bad markup, for historical reasons. * > It is ignored inside template elements. * * @todo This may be invalidated by a seek operation. * * @see https://html.spec.whatwg.org/#form-element-pointer * * @since 6.7.0 * * @var WP_HTML_Token|null */ public $form_element = \null; /** * The frameset-ok flag indicates if a `FRAMESET` element is allowed in the current state. * * > The frameset-ok flag is set to "ok" when the parser is created. It is set to "not ok" after certain tokens are seen. * * @since 6.4.0 * * @see https://html.spec.whatwg.org/#frameset-ok-flag * * @var bool */ public $frameset_ok = \true; /** * Constructor - creates a new and empty state value. * * @since 6.4.0 * * @see WP_HTML_Processor */ public function __construct() { } } /** * Core class used to modify attributes in an HTML document for tags matching a query. * * ## Usage * * Use of this class requires three steps: * * 1. Create a new class instance with your input HTML document. * 2. Find the tag(s) you are looking for. * 3. Request changes to the attributes in those tag(s). * * Example: * * $tags = new WP_HTML_Tag_Processor( $html ); * if ( $tags->next_tag( 'option' ) ) { * $tags->set_attribute( 'selected', true ); * } * * ### Finding tags * * The `next_tag()` function moves the internal cursor through * your input HTML document until it finds a tag meeting any of * the supplied restrictions in the optional query argument. If * no argument is provided then it will find the next HTML tag, * regardless of what kind it is. * * If you want to _find whatever the next tag is_: * * $tags->next_tag(); * * | Goal | Query | * |-----------------------------------------------------------|---------------------------------------------------------------------------------| * | Find any tag. | `$tags->next_tag();` | * | Find next image tag. | `$tags->next_tag( array( 'tag_name' => 'img' ) );` | * | Find next image tag (without passing the array). | `$tags->next_tag( 'img' );` | * | Find next tag containing the `fullwidth` CSS class. | `$tags->next_tag( array( 'class_name' => 'fullwidth' ) );` | * | Find next image tag containing the `fullwidth` CSS class. | `$tags->next_tag( array( 'tag_name' => 'img', 'class_name' => 'fullwidth' ) );` | * * If a tag was found meeting your criteria then `next_tag()` * will return `true` and you can proceed to modify it. If it * returns `false`, however, it failed to find the tag and * moved the cursor to the end of the file. * * Once the cursor reaches the end of the file the processor * is done and if you want to reach an earlier tag you will * need to recreate the processor and start over, as it's * unable to back up or move in reverse. * * See the section on bookmarks for an exception to this * no-backing-up rule. * * #### Custom queries * * Sometimes it's necessary to further inspect an HTML tag than * the query syntax here permits. In these cases one may further * inspect the search results using the read-only functions * provided by the processor or external state or variables. * * Example: * * // Paint up to the first five DIV or SPAN tags marked with the "jazzy" style. * $remaining_count = 5; * while ( $remaining_count > 0 && $tags->next_tag() ) { * if ( * ( 'DIV' === $tags->get_tag() || 'SPAN' === $tags->get_tag() ) && * 'jazzy' === $tags->get_attribute( 'data-style' ) * ) { * $tags->add_class( 'theme-style-everest-jazz' ); * $remaining_count--; * } * } * * `get_attribute()` will return `null` if the attribute wasn't present * on the tag when it was called. It may return `""` (the empty string) * in cases where the attribute was present but its value was empty. * For boolean attributes, those whose name is present but no value is * given, it will return `true` (the only way to set `false` for an * attribute is to remove it). * * #### When matching fails * * When `next_tag()` returns `false` it could mean different things: * * - The requested tag wasn't found in the input document. * - The input document ended in the middle of an HTML syntax element. * * When a document ends in the middle of a syntax element it will pause * the processor. This is to make it possible in the future to extend the * input document and proceed - an important requirement for chunked * streaming parsing of a document. * * Example: * * $processor = new WP_HTML_Tag_Processor( 'This <div is="a" partial="token' ); * false === $processor->next_tag(); * * If a special element (see next section) is encountered but no closing tag * is found it will count as an incomplete tag. The parser will pause as if * the opening tag were incomplete. * * Example: * * $processor = new WP_HTML_Tag_Processor( '<style>// there could be more styling to come' ); * false === $processor->next_tag(); * * $processor = new WP_HTML_Tag_Processor( '<style>// this is everything</style><div>' ); * true === $processor->next_tag( 'DIV' ); * * #### Special self-contained elements * * Some HTML elements are handled in a special way; their start and end tags * act like a void tag. These are special because their contents can't contain * HTML markup. Everything inside these elements is handled in a special way * and content that _appears_ like HTML tags inside of them isn't. There can * be no nesting in these elements. * * In the following list, "raw text" means that all of the content in the HTML * until the matching closing tag is treated verbatim without any replacements * and without any parsing. * * - IFRAME allows no content but requires a closing tag. * - NOEMBED (deprecated) content is raw text. * - NOFRAMES (deprecated) content is raw text. * - SCRIPT content is plaintext apart from legacy rules allowing `</script>` inside an HTML comment. * - STYLE content is raw text. * - TITLE content is plain text but character references are decoded. * - TEXTAREA content is plain text but character references are decoded. * - XMP (deprecated) content is raw text. * * ### Modifying HTML attributes for a found tag * * Once you've found the start of an opening tag you can modify * any number of the attributes on that tag. You can set a new * value for an attribute, remove the entire attribute, or do * nothing and move on to the next opening tag. * * Example: * * if ( $tags->next_tag( array( 'class_name' => 'wp-group-block' ) ) ) { * $tags->set_attribute( 'title', 'This groups the contained content.' ); * $tags->remove_attribute( 'data-test-id' ); * } * * If `set_attribute()` is called for an existing attribute it will * overwrite the existing value. Similarly, calling `remove_attribute()` * for a non-existing attribute has no effect on the document. Both * of these methods are safe to call without knowing if a given attribute * exists beforehand. * * ### Modifying CSS classes for a found tag * * The tag processor treats the `class` attribute as a special case. * Because it's a common operation to add or remove CSS classes, this * interface adds helper methods to make that easier. * * As with attribute values, adding or removing CSS classes is a safe * operation that doesn't require checking if the attribute or class * exists before making changes. If removing the only class then the * entire `class` attribute will be removed. * * Example: * * // from `<span>Yippee!</span>` * // to `<span class="is-active">Yippee!</span>` * $tags->add_class( 'is-active' ); * * // from `<span class="excited">Yippee!</span>` * // to `<span class="excited is-active">Yippee!</span>` * $tags->add_class( 'is-active' ); * * // from `<span class="is-active heavy-accent">Yippee!</span>` * // to `<span class="is-active heavy-accent">Yippee!</span>` * $tags->add_class( 'is-active' ); * * // from `<input type="text" class="is-active rugby not-disabled" length="24">` * // to `<input type="text" class="is-active not-disabled" length="24"> * $tags->remove_class( 'rugby' ); * * // from `<input type="text" class="rugby" length="24">` * // to `<input type="text" length="24"> * $tags->remove_class( 'rugby' ); * * // from `<input type="text" length="24">` * // to `<input type="text" length="24"> * $tags->remove_class( 'rugby' ); * * When class changes are enqueued but a direct change to `class` is made via * `set_attribute` then the changes to `set_attribute` (or `remove_attribute`) * will take precedence over those made through `add_class` and `remove_class`. * * ### Bookmarks * * While scanning through the input HTMl document it's possible to set * a named bookmark when a particular tag is found. Later on, after * continuing to scan other tags, it's possible to `seek` to one of * the set bookmarks and then proceed again from that point forward. * * Because bookmarks create processing overhead one should avoid * creating too many of them. As a rule, create only bookmarks * of known string literal names; avoid creating "mark_{$index}" * and so on. It's fine from a performance standpoint to create a * bookmark and update it frequently, such as within a loop. * * $total_todos = 0; * while ( $p->next_tag( array( 'tag_name' => 'UL', 'class_name' => 'todo' ) ) ) { * $p->set_bookmark( 'list-start' ); * while ( $p->next_tag( array( 'tag_closers' => 'visit' ) ) ) { * if ( 'UL' === $p->get_tag() && $p->is_tag_closer() ) { * $p->set_bookmark( 'list-end' ); * $p->seek( 'list-start' ); * $p->set_attribute( 'data-contained-todos', (string) $total_todos ); * $total_todos = 0; * $p->seek( 'list-end' ); * break; * } * * if ( 'LI' === $p->get_tag() && ! $p->is_tag_closer() ) { * $total_todos++; * } * } * } * * ## Tokens and finer-grained processing. * * It's possible to scan through every lexical token in the * HTML document using the `next_token()` function. This * alternative form takes no argument and provides no built-in * query syntax. * * Example: * * $title = '(untitled)'; * $text = ''; * while ( $processor->next_token() ) { * switch ( $processor->get_token_name() ) { * case '#text': * $text .= $processor->get_modifiable_text(); * break; * * case 'BR': * $text .= "\n"; * break; * * case 'TITLE': * $title = $processor->get_modifiable_text(); * break; * } * } * return trim( "# {$title}\n\n{$text}" ); * * ### Tokens and _modifiable text_. * * #### Special "atomic" HTML elements. * * Not all HTML elements are able to contain other elements inside of them. * For instance, the contents inside a TITLE element are plaintext (except * that character references like & will be decoded). This means that * if the string `<img>` appears inside a TITLE element, then it's not an * image tag, but rather it's text describing an image tag. Likewise, the * contents of a SCRIPT or STYLE element are handled entirely separately in * a browser than the contents of other elements because they represent a * different language than HTML. * * For these elements the Tag Processor treats the entire sequence as one, * from the opening tag, including its contents, through its closing tag. * This means that the it's not possible to match the closing tag for a * SCRIPT element unless it's unexpected; the Tag Processor already matched * it when it found the opening tag. * * The inner contents of these elements are that element's _modifiable text_. * * The special elements are: * - `SCRIPT` whose contents are treated as raw plaintext but supports a legacy * style of including JavaScript inside of HTML comments to avoid accidentally * closing the SCRIPT from inside a JavaScript string. E.g. `console.log( '</script>' )`. * - `TITLE` and `TEXTAREA` whose contents are treated as plaintext and then any * character references are decoded. E.g. `1 < 2 < 3` becomes `1 < 2 < 3`. * - `IFRAME`, `NOSCRIPT`, `NOEMBED`, `NOFRAME`, `STYLE` whose contents are treated as * raw plaintext and left as-is. E.g. `1 < 2 < 3` remains `1 < 2 < 3`. * * #### Other tokens with modifiable text. * * There are also non-elements which are void/self-closing in nature and contain * modifiable text that is part of that individual syntax token itself. * * - `#text` nodes, whose entire token _is_ the modifiable text. * - HTML comments and tokens that become comments due to some syntax error. The * text for these tokens is the portion of the comment inside of the syntax. * E.g. for `<!-- comment -->` the text is `" comment "` (note the spaces are included). * - `CDATA` sections, whose text is the content inside of the section itself. E.g. for * `<![CDATA[some content]]>` the text is `"some content"` (with restrictions [1]). * - "Funky comments," which are a special case of invalid closing tags whose name is * invalid. The text for these nodes is the text that a browser would transform into * an HTML comment when parsing. E.g. for `</%post_author>` the text is `%post_author`. * - `DOCTYPE` declarations like `<DOCTYPE html>` which have no closing tag. * - XML Processing instruction nodes like `<?wp __( "Like" ); ?>` (with restrictions [2]). * - The empty end tag `</>` which is ignored in the browser and DOM. * * [1]: There are no CDATA sections in HTML. When encountering `<![CDATA[`, everything * until the next `>` becomes a bogus HTML comment, meaning there can be no CDATA * section in an HTML document containing `>`. The Tag Processor will first find * all valid and bogus HTML comments, and then if the comment _would_ have been a * CDATA section _were they to exist_, it will indicate this as the type of comment. * * [2]: XML allows a broader range of characters in a processing instruction's target name * and disallows "xml" as a name, since it's special. The Tag Processor only recognizes * target names with an ASCII-representable subset of characters. It also exhibits the * same constraint as with CDATA sections, in that `>` cannot exist within the token * since Processing Instructions do no exist within HTML and their syntax transforms * into a bogus comment in the DOM. * * ## Design and limitations * * The Tag Processor is designed to linearly scan HTML documents and tokenize * HTML tags and their attributes. It's designed to do this as efficiently as * possible without compromising parsing integrity. Therefore it will be * slower than some methods of modifying HTML, such as those incorporating * over-simplified PCRE patterns, but will not introduce the defects and * failures that those methods bring in, which lead to broken page renders * and often to security vulnerabilities. On the other hand, it will be faster * than full-blown HTML parsers such as DOMDocument and use considerably * less memory. It requires a negligible memory overhead, enough to consider * it a zero-overhead system. * * The performance characteristics are maintained by avoiding tree construction * and semantic cleanups which are specified in HTML5. Because of this, for * example, it's not possible for the Tag Processor to associate any given * opening tag with its corresponding closing tag, or to return the inner markup * inside an element. Systems may be built on top of the Tag Processor to do * this, but the Tag Processor is and should be constrained so it can remain an * efficient, low-level, and reliable HTML scanner. * * The Tag Processor's design incorporates a "garbage-in-garbage-out" philosophy. * HTML5 specifies that certain invalid content be transformed into different forms * for display, such as removing null bytes from an input document and replacing * invalid characters with the Unicode replacement character `U+FFFD` (visually "�"). * Where errors or transformations exist within the HTML5 specification, the Tag Processor * leaves those invalid inputs untouched, passing them through to the final browser * to handle. While this implies that certain operations will be non-spec-compliant, * such as reading the value of an attribute with invalid content, it also preserves a * simplicity and efficiency for handling those error cases. * * Most operations within the Tag Processor are designed to minimize the difference * between an input and output document for any given change. For example, the * `add_class` and `remove_class` methods preserve whitespace and the class ordering * within the `class` attribute; and when encountering tags with duplicated attributes, * the Tag Processor will leave those invalid duplicate attributes where they are but * update the proper attribute which the browser will read for parsing its value. An * exception to this rule is that all attribute updates store their values as * double-quoted strings, meaning that attributes on input with single-quoted or * unquoted values will appear in the output with double-quotes. * * ### Scripting Flag * * The Tag Processor parses HTML with the "scripting flag" disabled. This means * that it doesn't run any scripts while parsing the page. In a browser with * JavaScript enabled, for example, the script can change the parse of the * document as it loads. On the server, however, evaluating JavaScript is not * only impractical, but also unwanted. * * Practically this means that the Tag Processor will descend into NOSCRIPT * elements and process its child tags. Were the scripting flag enabled, such * as in a typical browser, the contents of NOSCRIPT are skipped entirely. * * This allows the HTML API to process the content that will be presented in * a browser when scripting is disabled, but it offers a different view of a * page than most browser sessions will experience. E.g. the tags inside the * NOSCRIPT disappear. * * ### Text Encoding * * The Tag Processor assumes that the input HTML document is encoded with a * text encoding compatible with 7-bit ASCII's '<', '>', '&', ';', '/', '=', * "'", '"', 'a' - 'z', 'A' - 'Z', and the whitespace characters ' ', tab, * carriage-return, newline, and form-feed. * * In practice, this includes almost every single-byte encoding as well as * UTF-8. Notably, however, it does not include UTF-16. If providing input * that's incompatible, then convert the encoding beforehand. * * @since 6.2.0 * @since 6.2.1 Fix: Support for various invalid comments; attribute updates are case-insensitive. * @since 6.3.2 Fix: Skip HTML-like content inside rawtext elements such as STYLE. * @since 6.5.0 Pauses processor when input ends in an incomplete syntax token. * Introduces "special" elements which act like void elements, e.g. TITLE, STYLE. * Allows scanning through all tokens and processing modifiable text, where applicable. */ class WP_HTML_Tag_Processor { /** * The maximum number of bookmarks allowed to exist at * any given time. * * @since 6.2.0 * @var int * * @see WP_HTML_Tag_Processor::set_bookmark() */ const MAX_BOOKMARKS = 10; /** * Maximum number of times seek() can be called. * Prevents accidental infinite loops. * * @since 6.2.0 * @var int * * @see WP_HTML_Tag_Processor::seek() */ const MAX_SEEK_OPS = 1000; /** * The HTML document to parse. * * @since 6.2.0 * @var string */ protected $html; /** * Specifies mode of operation of the parser at any given time. * * | State | Meaning | * | ----------------|----------------------------------------------------------------------| * | *Ready* | The parser is ready to run. | * | *Complete* | There is nothing left to parse. | * | *Incomplete* | The HTML ended in the middle of a token; nothing more can be parsed. | * | *Matched tag* | Found an HTML tag; it's possible to modify its attributes. | * | *Text node* | Found a #text node; this is plaintext and modifiable. | * | *CDATA node* | Found a CDATA section; this is modifiable. | * | *Comment* | Found a comment or bogus comment; this is modifiable. | * | *Presumptuous* | Found an empty tag closer: `</>`. | * | *Funky comment* | Found a tag closer with an invalid tag name; this is modifiable. | * * @since 6.5.0 * * @see WP_HTML_Tag_Processor::STATE_READY * @see WP_HTML_Tag_Processor::STATE_COMPLETE * @see WP_HTML_Tag_Processor::STATE_INCOMPLETE_INPUT * @see WP_HTML_Tag_Processor::STATE_MATCHED_TAG * @see WP_HTML_Tag_Processor::STATE_TEXT_NODE * @see WP_HTML_Tag_Processor::STATE_CDATA_NODE * @see WP_HTML_Tag_Processor::STATE_COMMENT * @see WP_HTML_Tag_Processor::STATE_DOCTYPE * @see WP_HTML_Tag_Processor::STATE_PRESUMPTUOUS_TAG * @see WP_HTML_Tag_Processor::STATE_FUNKY_COMMENT * * @var string */ protected $parser_state = self::STATE_READY; /** * Indicates if the document is in quirks mode or no-quirks mode. * * Impact on HTML parsing: * * - In `NO_QUIRKS_MODE` (also known as "standard mode"): * - CSS class and ID selectors match byte-for-byte (case-sensitively). * - A TABLE start tag `<table>` implicitly closes any open `P` element. * * - In `QUIRKS_MODE`: * - CSS class and ID selectors match match in an ASCII case-insensitive manner. * - A TABLE start tag `<table>` opens a `TABLE` element as a child of a `P` * element if one is open. * * Quirks and no-quirks mode are thus mostly about styling, but have an impact when * tables are found inside paragraph elements. * * @see self::QUIRKS_MODE * @see self::NO_QUIRKS_MODE * * @since 6.7.0 * * @var string */ protected $compat_mode = self::NO_QUIRKS_MODE; /** * What kind of syntax token became an HTML comment. * * Since there are many ways in which HTML syntax can create an HTML comment, * this indicates which of those caused it. This allows the Tag Processor to * represent more from the original input document than would appear in the DOM. * * @since 6.5.0 * * @var string|null */ protected $comment_type = \null; /** * What kind of text the matched text node represents, if it was subdivided. * * @see self::TEXT_IS_NULL_SEQUENCE * @see self::TEXT_IS_WHITESPACE * @see self::TEXT_IS_GENERIC * @see self::subdivide_text_appropriately * * @since 6.7.0 * * @var string */ protected $text_node_classification = self::TEXT_IS_GENERIC; /** * Tracks a semantic location in the original HTML which * shifts with updates as they are applied to the document. * * @since 6.2.0 * @var WP_HTML_Span[] */ protected $bookmarks = array(); const ADD_CLASS = \true; const REMOVE_CLASS = \false; const SKIP_CLASS = \null; /** * Lexical replacements to apply to input HTML document. * * "Lexical" in this class refers to the part of this class which * operates on pure text _as text_ and not as HTML. There's a line * between the public interface, with HTML-semantic methods like * `set_attribute` and `add_class`, and an internal state that tracks * text offsets in the input document. * * When higher-level HTML methods are called, those have to transform their * operations (such as setting an attribute's value) into text diffing * operations (such as replacing the sub-string from indices A to B with * some given new string). These text-diffing operations are the lexical * updates. * * As new higher-level methods are added they need to collapse their * operations into these lower-level lexical updates since that's the * Tag Processor's internal language of change. Any code which creates * these lexical updates must ensure that they do not cross HTML syntax * boundaries, however, so these should never be exposed outside of this * class or any classes which intentionally expand its functionality. * * These are enqueued while editing the document instead of being immediately * applied to avoid processing overhead, string allocations, and string * copies when applying many updates to a single document. * * Example: * * // Replace an attribute stored with a new value, indices * // sourced from the lazily-parsed HTML recognizer. * $start = $attributes['src']->start; * $length = $attributes['src']->length; * $modifications[] = new WP_HTML_Text_Replacement( $start, $length, $new_value ); * * // Correspondingly, something like this will appear in this array. * $lexical_updates = array( * WP_HTML_Text_Replacement( 14, 28, 'https://my-site.my-domain/wp-content/uploads/2014/08/kittens.jpg' ) * ); * * @since 6.2.0 * @var WP_HTML_Text_Replacement[] */ protected $lexical_updates = array(); /** * Tracks and limits `seek()` calls to prevent accidental infinite loops. * * @since 6.2.0 * @var int * * @see WP_HTML_Tag_Processor::seek() */ protected $seek_count = 0; /** * Constructor. * * @since 6.2.0 * * @param string $html HTML to process. */ public function __construct($html) { } /** * Switches parsing mode into a new namespace, such as when * encountering an SVG tag and entering foreign content. * * @since 6.7.0 * * @param string $new_namespace One of 'html', 'svg', or 'math' indicating into what * namespace the next tokens will be processed. * @return bool Whether the namespace was valid and changed. * @phpstan-param 'html'|'svg'|'math' $new_namespace */ public function change_parsing_namespace(string $new_namespace) : bool { } /** * Finds the next tag matching the $query. * * @since 6.2.0 * @since 6.5.0 No longer processes incomplete tokens at end of document; pauses the processor at start of token. * * @param array|string|null $query { * Optional. Which tag name to find, having which class, etc. Default is to find any tag. * * @type string|null $tag_name Which tag to find, or `null` for "any tag." * @type int|null $match_offset Find the Nth tag matching all search criteria. * 1 for "first" tag, 3 for "third," etc. * Defaults to first tag. * @type string|null $class_name Tag must contain this whole class name to match. * @type string|null $tag_closers "visit" or "skip": whether to stop on tag closers, e.g. </div>. * } * @return bool Whether a tag was matched. * @phpstan-param null|array{ * tag_name?: string|null, * match_offset?: int|null, * class_name?: string|null, * tag_closers?: string|null, * } $query */ public function next_tag($query = \null) : bool { } /** * Finds the next token in the HTML document. * * An HTML document can be viewed as a stream of tokens, * where tokens are things like HTML tags, HTML comments, * text nodes, etc. This method finds the next token in * the HTML document and returns whether it found one. * * If it starts parsing a token and reaches the end of the * document then it will seek to the start of the last * token and pause, returning `false` to indicate that it * failed to find a complete token. * * Possible token types, based on the HTML specification: * * - an HTML tag, whether opening, closing, or void. * - a text node - the plaintext inside tags. * - an HTML comment. * - a DOCTYPE declaration. * - a processing instruction, e.g. `<?xml version="1.0" ?>`. * * The Tag Processor currently only supports the tag token. * * @since 6.5.0 * @since 6.7.0 Recognizes CDATA sections within foreign content. * * @return bool Whether a token was parsed. */ public function next_token() : bool { } /** * Whether the processor paused because the input HTML document ended * in the middle of a syntax element, such as in the middle of a tag. * * Example: * * $processor = new WP_HTML_Tag_Processor( '<input type="text" value="Th' ); * false === $processor->get_next_tag(); * true === $processor->paused_at_incomplete_token(); * * @since 6.5.0 * * @return bool Whether the parse paused at the start of an incomplete token. */ public function paused_at_incomplete_token() : bool { } /** * Generator for a foreach loop to step through each class name for the matched tag. * * This generator function is designed to be used inside a "foreach" loop. * * Example: * * $p = new WP_HTML_Tag_Processor( "<div class='free <egg<\tlang-en'>" ); * $p->next_tag(); * foreach ( $p->class_list() as $class_name ) { * echo "{$class_name} "; * } * // Outputs: "free <egg> lang-en " * * @since 6.4.0 * @phpstan-return void */ public function class_list() { } /** * Returns if a matched tag contains the given ASCII case-insensitive class name. * * @since 6.4.0 * * @param string $wanted_class Look for this CSS class name, ASCII case-insensitive. * @return bool|null Whether the matched tag contains the given class name, or null if not matched. */ public function has_class($wanted_class) : ?bool { } /** * Sets a bookmark in the HTML document. * * Bookmarks represent specific places or tokens in the HTML * document, such as a tag opener or closer. When applying * edits to a document, such as setting an attribute, the * text offsets of that token may shift; the bookmark is * kept updated with those shifts and remains stable unless * the entire span of text in which the token sits is removed. * * Release bookmarks when they are no longer needed. * * Example: * * <main><h2>Surprising fact you may not know!</h2></main> * ^ ^ * \-|-- this `H2` opener bookmark tracks the token * * <main class="clickbait"><h2>Surprising fact you may no… * ^ ^ * \-|-- it shifts with edits * * Bookmarks provide the ability to seek to a previously-scanned * place in the HTML document. This avoids the need to re-scan * the entire document. * * Example: * * <ul><li>One</li><li>Two</li><li>Three</li></ul> * ^^^^ * want to note this last item * * $p = new WP_HTML_Tag_Processor( $html ); * $in_list = false; * while ( $p->next_tag( array( 'tag_closers' => $in_list ? 'visit' : 'skip' ) ) ) { * if ( 'UL' === $p->get_tag() ) { * if ( $p->is_tag_closer() ) { * $in_list = false; * $p->set_bookmark( 'resume' ); * if ( $p->seek( 'last-li' ) ) { * $p->add_class( 'last-li' ); * } * $p->seek( 'resume' ); * $p->release_bookmark( 'last-li' ); * $p->release_bookmark( 'resume' ); * } else { * $in_list = true; * } * } * * if ( 'LI' === $p->get_tag() ) { * $p->set_bookmark( 'last-li' ); * } * } * * Bookmarks intentionally hide the internal string offsets * to which they refer. They are maintained internally as * updates are applied to the HTML document and therefore * retain their "position" - the location to which they * originally pointed. The inability to use bookmarks with * functions like `substr` is therefore intentional to guard * against accidentally breaking the HTML. * * Because bookmarks allocate memory and require processing * for every applied update, they are limited and require * a name. They should not be created with programmatically-made * names, such as "li_{$index}" with some loop. As a general * rule they should only be created with string-literal names * like "start-of-section" or "last-paragraph". * * Bookmarks are a powerful tool to enable complicated behavior. * Consider double-checking that you need this tool if you are * reaching for it, as inappropriate use could lead to broken * HTML structure or unwanted processing overhead. * * @since 6.2.0 * * @param string $name Identifies this particular bookmark. * @return bool Whether the bookmark was successfully created. */ public function set_bookmark($name) : bool { } /** * Removes a bookmark that is no longer needed. * * Releasing a bookmark frees up the small * performance overhead it requires. * * @param string $name Name of the bookmark to remove. * @return bool Whether the bookmark already existed before removal. */ public function release_bookmark($name) : bool { } /** * Checks whether a bookmark with the given name exists. * * @since 6.3.0 * * @param string $bookmark_name Name to identify a bookmark that potentially exists. * @return bool Whether that bookmark exists. */ public function has_bookmark($bookmark_name) : bool { } /** * Move the internal cursor in the Tag Processor to a given bookmark's location. * * In order to prevent accidental infinite loops, there's a * maximum limit on the number of times seek() can be called. * * @since 6.2.0 * * @param string $bookmark_name Jump to the place in the document identified by this bookmark name. * @return bool Whether the internal cursor was successfully moved to the bookmark's location. */ public function seek($bookmark_name) : bool { } /** * Returns the value of a requested attribute from a matched tag opener if that attribute exists. * * Example: * * $p = new WP_HTML_Tag_Processor( '<div enabled class="test" data-test-id="14">Test</div>' ); * $p->next_tag( array( 'class_name' => 'test' ) ) === true; * $p->get_attribute( 'data-test-id' ) === '14'; * $p->get_attribute( 'enabled' ) === true; * $p->get_attribute( 'aria-label' ) === null; * * $p->next_tag() === false; * $p->get_attribute( 'class' ) === null; * * @since 6.2.0 * * @param string $name Name of attribute whose value is requested. * @return string|true|null Value of attribute or `null` if not available. Boolean attributes return `true`. */ public function get_attribute($name) { } /** * Gets lowercase names of all attributes matching a given prefix in the current tag. * * Note that matching is case-insensitive. This is in accordance with the spec: * * > There must never be two or more attributes on * > the same start tag whose names are an ASCII * > case-insensitive match for each other. * - HTML 5 spec * * Example: * * $p = new WP_HTML_Tag_Processor( '<div data-ENABLED class="test" DATA-test-id="14">Test</div>' ); * $p->next_tag( array( 'class_name' => 'test' ) ) === true; * $p->get_attribute_names_with_prefix( 'data-' ) === array( 'data-enabled', 'data-test-id' ); * * $p->next_tag() === false; * $p->get_attribute_names_with_prefix( 'data-' ) === null; * * @since 6.2.0 * * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive * * @param string $prefix Prefix of requested attribute names. * @return array|null List of attribute names, or `null` when no tag opener is matched. */ public function get_attribute_names_with_prefix($prefix) : ?array { } /** * Returns the namespace of the matched token. * * @since 6.7.0 * * @return string One of 'html', 'math', or 'svg'. * @phpstan-return 'html'|'math'|'svg' */ public function get_namespace() : string { } /** * Returns the uppercase name of the matched tag. * * Example: * * $p = new WP_HTML_Tag_Processor( '<div class="test">Test</div>' ); * $p->next_tag() === true; * $p->get_tag() === 'DIV'; * * $p->next_tag() === false; * $p->get_tag() === null; * * @since 6.2.0 * * @return string|null Name of currently matched tag in input HTML, or `null` if none found. */ public function get_tag() : ?string { } /** * Returns the adjusted tag name for a given token, taking into * account the current parsing context, whether HTML, SVG, or MathML. * * @since 6.7.0 * * @return string|null Name of current tag name. */ public function get_qualified_tag_name() : ?string { } /** * Returns the adjusted attribute name for a given attribute, taking into * account the current parsing context, whether HTML, SVG, or MathML. * * @since 6.7.0 * * @param string $attribute_name Which attribute to adjust. * * @return string|null */ public function get_qualified_attribute_name($attribute_name) : ?string { } /** * Indicates if the currently matched tag contains the self-closing flag. * * No HTML elements ought to have the self-closing flag and for those, the self-closing * flag will be ignored. For void elements this is benign because they "self close" * automatically. For non-void HTML elements though problems will appear if someone * intends to use a self-closing element in place of that element with an empty body. * For HTML foreign elements and custom elements the self-closing flag determines if * they self-close or not. * * This function does not determine if a tag is self-closing, * but only if the self-closing flag is present in the syntax. * * @since 6.3.0 * * @return bool Whether the currently matched tag contains the self-closing flag. */ public function has_self_closing_flag() : bool { } /** * Indicates if the current tag token is a tag closer. * * Example: * * $p = new WP_HTML_Tag_Processor( '<div></div>' ); * $p->next_tag( array( 'tag_name' => 'div', 'tag_closers' => 'visit' ) ); * $p->is_tag_closer() === false; * * $p->next_tag( array( 'tag_name' => 'div', 'tag_closers' => 'visit' ) ); * $p->is_tag_closer() === true; * * @since 6.2.0 * @since 6.7.0 Reports all BR tags as opening tags. * * @return bool Whether the current tag is a tag closer. */ public function is_tag_closer() : bool { } /** * Indicates the kind of matched token, if any. * * This differs from `get_token_name()` in that it always * returns a static string indicating the type, whereas * `get_token_name()` may return values derived from the * token itself, such as a tag name or processing * instruction tag. * * Possible values: * - `#tag` when matched on a tag. * - `#text` when matched on a text node. * - `#cdata-section` when matched on a CDATA node. * - `#comment` when matched on a comment. * - `#doctype` when matched on a DOCTYPE declaration. * - `#presumptuous-tag` when matched on an empty tag closer. * - `#funky-comment` when matched on a funky comment. * * @since 6.5.0 * * @return string|null What kind of token is matched, or null. */ public function get_token_type() : ?string { } /** * Returns the node name represented by the token. * * This matches the DOM API value `nodeName`. Some values * are static, such as `#text` for a text node, while others * are dynamically generated from the token itself. * * Dynamic names: * - Uppercase tag name for tag matches. * - `html` for DOCTYPE declarations. * * Note that if the Tag Processor is not matched on a token * then this function will return `null`, either because it * hasn't yet found a token or because it reached the end * of the document without matching a token. * * @since 6.5.0 * * @return string|null Name of the matched token. */ public function get_token_name() : ?string { } /** * Indicates what kind of comment produced the comment node. * * Because there are different kinds of HTML syntax which produce * comments, the Tag Processor tracks and exposes this as a type * for the comment. Nominally only regular HTML comments exist as * they are commonly known, but a number of unrelated syntax errors * also produce comments. * * @see self::COMMENT_AS_ABRUPTLY_CLOSED_COMMENT * @see self::COMMENT_AS_CDATA_LOOKALIKE * @see self::COMMENT_AS_INVALID_HTML * @see self::COMMENT_AS_HTML_COMMENT * @see self::COMMENT_AS_PI_NODE_LOOKALIKE * * @since 6.5.0 * * @return string|null */ public function get_comment_type() : ?string { } /** * Returns the text of a matched comment or null if not on a comment type node. * * This method returns the entire text content of a comment node as it * would appear in the browser. * * This differs from {@see ::get_modifiable_text()} in that certain comment * types in the HTML API cannot allow their entire comment text content to * be modified. Namely, "bogus comments" of the form `<?not allowed in html>` * will create a comment whose text content starts with `?`. Note that if * that character were modified, it would be possible to change the node * type. * * @since 6.7.0 * * @return string|null The comment text as it would appear in the browser or null * if not on a comment type node. */ public function get_full_comment_text() : ?string { } /** * Subdivides a matched text node, splitting NULL byte sequences and decoded whitespace as * distinct nodes prefixes. * * Note that once anything that's neither a NULL byte nor decoded whitespace is * encountered, then the remainder of the text node is left intact as generic text. * * - The HTML Processor uses this to apply distinct rules for different kinds of text. * - Inter-element whitespace can be detected and skipped with this method. * * Text nodes aren't eagerly subdivided because there's no need to split them unless * decisions are being made on NULL byte sequences or whitespace-only text. * * Example: * * $processor = new WP_HTML_Tag_Processor( "\x00Apples & Oranges" ); * true === $processor->next_token(); // Text is "Apples & Oranges". * true === $processor->subdivide_text_appropriately(); // Text is "". * true === $processor->next_token(); // Text is "Apples & Oranges". * false === $processor->subdivide_text_appropriately(); * * $processor = new WP_HTML_Tag_Processor( " \r\n\tMore" ); * true === $processor->next_token(); // Text is "␤ ␤␉More". * true === $processor->subdivide_text_appropriately(); // Text is "␤ ␤␉". * true === $processor->next_token(); // Text is "More". * false === $processor->subdivide_text_appropriately(); * * @since 6.7.0 * * @return bool Whether the text node was subdivided. */ public function subdivide_text_appropriately() : bool { } /** * Returns the modifiable text for a matched token, or an empty string. * * Modifiable text is text content that may be read and changed without * changing the HTML structure of the document around it. This includes * the contents of `#text` nodes in the HTML as well as the inner * contents of HTML comments, Processing Instructions, and others, even * though these nodes aren't part of a parsed DOM tree. They also contain * the contents of SCRIPT and STYLE tags, of TEXTAREA tags, and of any * other section in an HTML document which cannot contain HTML markup (DATA). * * If a token has no modifiable text then an empty string is returned to * avoid needless crashing or type errors. An empty string does not mean * that a token has modifiable text, and a token with modifiable text may * have an empty string (e.g. a comment with no contents). * * Limitations: * * - This function will not strip the leading newline appropriately * after seeking into a LISTING or PRE element. To ensure that the * newline is treated properly, seek to the LISTING or PRE opening * tag instead of to the first text node inside the element. * * @since 6.5.0 * @since 6.7.0 Replaces NULL bytes (U+0000) and newlines appropriately. * * @return string */ public function get_modifiable_text() : string { } /** * Sets the modifiable text for the matched token, if matched. * * Modifiable text is text content that may be read and changed without * changing the HTML structure of the document around it. This includes * the contents of `#text` nodes in the HTML as well as the inner * contents of HTML comments, Processing Instructions, and others, even * though these nodes aren't part of a parsed DOM tree. They also contain * the contents of SCRIPT and STYLE tags, of TEXTAREA tags, and of any * other section in an HTML document which cannot contain HTML markup (DATA). * * Not all modifiable text may be set by this method, and not all content * may be set as modifiable text. In the case that this fails it will return * `false` indicating as much. For instance, it will not allow inserting the * string `</script` into a SCRIPT element, because the rules for escaping * that safely are complicated. Similarly, it will not allow setting content * into a comment which would prematurely terminate the comment. * * Example: * * // Add a preface to all STYLE contents. * while ( $processor->next_tag( 'STYLE' ) ) { * $style = $processor->get_modifiable_text(); * $processor->set_modifiable_text( "// Made with love on the World Wide Web\n{$style}" ); * } * * // Replace smiley text with Emoji smilies. * while ( $processor->next_token() ) { * if ( '#text' !== $processor->get_token_name() ) { * continue; * } * * $chunk = $processor->get_modifiable_text(); * if ( ! str_contains( $chunk, ':)' ) ) { * continue; * } * * $processor->set_modifiable_text( str_replace( ':)', '🙂', $chunk ) ); * } * * @since 6.7.0 * * @param string $plaintext_content New text content to represent in the matched token. * * @return bool Whether the text was able to update. */ public function set_modifiable_text(string $plaintext_content) : bool { } /** * Updates or creates a new attribute on the currently matched tag with the passed value. * * For boolean attributes special handling is provided: * - When `true` is passed as the value, then only the attribute name is added to the tag. * - When `false` is passed, the attribute gets removed if it existed before. * * For string attributes, the value is escaped using the `esc_attr` function. * * @since 6.2.0 * @since 6.2.1 Fix: Only create a single update for multiple calls with case-variant attribute names. * * @param string $name The attribute name to target. * @param string|bool $value The new attribute value. * @return bool Whether an attribute value was set. */ public function set_attribute($name, $value) : bool { } /** * Remove an attribute from the currently-matched tag. * * @since 6.2.0 * * @param string $name The attribute name to remove. * @return bool Whether an attribute was removed. */ public function remove_attribute($name) : bool { } /** * Adds a new class name to the currently matched tag. * * @since 6.2.0 * * @param string $class_name The class name to add. * @return bool Whether the class was set to be added. */ public function add_class($class_name) : bool { } /** * Removes a class name from the currently matched tag. * * @since 6.2.0 * * @param string $class_name The class name to remove. * @return bool Whether the class was set to be removed. */ public function remove_class($class_name) : bool { } /** * Returns the string representation of the HTML Tag Processor. * * @since 6.2.0 * * @see WP_HTML_Tag_Processor::get_updated_html() * * @return string The processed HTML. */ public function __toString() : string { } /** * Returns the string representation of the HTML Tag Processor. * * @since 6.2.0 * @since 6.2.1 Shifts the internal cursor corresponding to the applied updates. * @since 6.4.0 No longer calls subclass method `next_tag()` after updating HTML. * * @return string The processed HTML. */ public function get_updated_html() : string { } /** * Gets DOCTYPE declaration info from a DOCTYPE token. * * DOCTYPE tokens may appear in many places in an HTML document. In most places, they are * simply ignored. The main parsing functions find the basic shape of DOCTYPE tokens but * do not perform detailed parsing. * * This method can be called to perform a full parse of the DOCTYPE token and retrieve * its information. * * @return WP_HTML_Doctype_Info|null The DOCTYPE declaration information or `null` if not * currently at a DOCTYPE node. */ public function get_doctype_info() : ?\WP_HTML_Doctype_Info { } /** * Parser Ready State. * * Indicates that the parser is ready to run and waiting for a state transition. * It may not have started yet, or it may have just finished parsing a token and * is ready to find the next one. * * @since 6.5.0 * * @access private */ const STATE_READY = 'STATE_READY'; /** * Parser Complete State. * * Indicates that the parser has reached the end of the document and there is * nothing left to scan. It finished parsing the last token completely. * * @since 6.5.0 * * @access private */ const STATE_COMPLETE = 'STATE_COMPLETE'; /** * Parser Incomplete Input State. * * Indicates that the parser has reached the end of the document before finishing * a token. It started parsing a token but there is a possibility that the input * HTML document was truncated in the middle of a token. * * The parser is reset at the start of the incomplete token and has paused. There * is nothing more than can be scanned unless provided a more complete document. * * @since 6.5.0 * * @access private */ const STATE_INCOMPLETE_INPUT = 'STATE_INCOMPLETE_INPUT'; /** * Parser Matched Tag State. * * Indicates that the parser has found an HTML tag and it's possible to get * the tag name and read or modify its attributes (if it's not a closing tag). * * @since 6.5.0 * * @access private */ const STATE_MATCHED_TAG = 'STATE_MATCHED_TAG'; /** * Parser Text Node State. * * Indicates that the parser has found a text node and it's possible * to read and modify that text. * * @since 6.5.0 * * @access private */ const STATE_TEXT_NODE = 'STATE_TEXT_NODE'; /** * Parser CDATA Node State. * * Indicates that the parser has found a CDATA node and it's possible * to read and modify its modifiable text. Note that in HTML there are * no CDATA nodes outside of foreign content (SVG and MathML). Outside * of foreign content, they are treated as HTML comments. * * @since 6.5.0 * * @access private */ const STATE_CDATA_NODE = 'STATE_CDATA_NODE'; /** * Indicates that the parser has found an HTML comment and it's * possible to read and modify its modifiable text. * * @since 6.5.0 * * @access private */ const STATE_COMMENT = 'STATE_COMMENT'; /** * Indicates that the parser has found a DOCTYPE node and it's * possible to read its DOCTYPE information via `get_doctype_info()`. * * @since 6.5.0 * * @access private */ const STATE_DOCTYPE = 'STATE_DOCTYPE'; /** * Indicates that the parser has found an empty tag closer `</>`. * * Note that in HTML there are no empty tag closers, and they * are ignored. Nonetheless, the Tag Processor still * recognizes them as they appear in the HTML stream. * * These were historically discussed as a "presumptuous tag * closer," which would close the nearest open tag, but were * dismissed in favor of explicitly-closing tags. * * @since 6.5.0 * * @access private */ const STATE_PRESUMPTUOUS_TAG = 'STATE_PRESUMPTUOUS_TAG'; /** * Indicates that the parser has found a "funky comment" * and it's possible to read and modify its modifiable text. * * Example: * * </%url> * </{"wp-bit":"query/post-author"}> * </2> * * Funky comments are tag closers with invalid tag names. Note * that in HTML these are turn into bogus comments. Nonetheless, * the Tag Processor recognizes them in a stream of HTML and * exposes them for inspection and modification. * * @since 6.5.0 * * @access private */ const STATE_FUNKY_COMMENT = 'STATE_WP_FUNKY'; /** * Indicates that a comment was created when encountering abruptly-closed HTML comment. * * Example: * * <!--> * <!---> * * @since 6.5.0 */ const COMMENT_AS_ABRUPTLY_CLOSED_COMMENT = 'COMMENT_AS_ABRUPTLY_CLOSED_COMMENT'; /** * Indicates that a comment would be parsed as a CDATA node, * were HTML to allow CDATA nodes outside of foreign content. * * Example: * * <![CDATA[This is a CDATA node.]]> * * This is an HTML comment, but it looks like a CDATA node. * * @since 6.5.0 */ const COMMENT_AS_CDATA_LOOKALIKE = 'COMMENT_AS_CDATA_LOOKALIKE'; /** * Indicates that a comment was created when encountering * normative HTML comment syntax. * * Example: * * <!-- this is a comment --> * * @since 6.5.0 */ const COMMENT_AS_HTML_COMMENT = 'COMMENT_AS_HTML_COMMENT'; /** * Indicates that a comment would be parsed as a Processing * Instruction node, were they to exist within HTML. * * Example: * * <?wp __( 'Like' ) ?> * * This is an HTML comment, but it looks like a CDATA node. * * @since 6.5.0 */ const COMMENT_AS_PI_NODE_LOOKALIKE = 'COMMENT_AS_PI_NODE_LOOKALIKE'; /** * Indicates that a comment was created when encountering invalid * HTML input, a so-called "bogus comment." * * Example: * * <?nothing special> * <!{nothing special}> * * @since 6.5.0 */ const COMMENT_AS_INVALID_HTML = 'COMMENT_AS_INVALID_HTML'; /** * No-quirks mode document compatability mode. * * > In no-quirks mode, the behavior is (hopefully) the desired behavior * > described by the modern HTML and CSS specifications. * * @see self::$compat_mode * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode * * @since 6.7.0 * * @var string */ const NO_QUIRKS_MODE = 'no-quirks-mode'; /** * Quirks mode document compatability mode. * * > In quirks mode, layout emulates behavior in Navigator 4 and Internet * > Explorer 5. This is essential in order to support websites that were * > built before the widespread adoption of web standards. * * @see self::$compat_mode * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode * * @since 6.7.0 * * @var string */ const QUIRKS_MODE = 'quirks-mode'; /** * Indicates that a span of text may contain any combination of significant * kinds of characters: NULL bytes, whitespace, and others. * * @see self::$text_node_classification * @see self::subdivide_text_appropriately * * @since 6.7.0 */ const TEXT_IS_GENERIC = 'TEXT_IS_GENERIC'; /** * Indicates that a span of text comprises a sequence only of NULL bytes. * * @see self::$text_node_classification * @see self::subdivide_text_appropriately * * @since 6.7.0 */ const TEXT_IS_NULL_SEQUENCE = 'TEXT_IS_NULL_SEQUENCE'; /** * Indicates that a span of decoded text comprises only whitespace. * * @see self::$text_node_classification * @see self::subdivide_text_appropriately * * @since 6.7.0 */ const TEXT_IS_WHITESPACE = 'TEXT_IS_WHITESPACE'; } /** * Core class used to safely parse and modify an HTML document. * * The HTML Processor class properly parses and modifies HTML5 documents. * * It supports a subset of the HTML5 specification, and when it encounters * unsupported markup, it aborts early to avoid unintentionally breaking * the document. The HTML Processor should never break an HTML document. * * While the `WP_HTML_Tag_Processor` is a valuable tool for modifying * attributes on individual HTML tags, the HTML Processor is more capable * and useful for the following operations: * * - Querying based on nested HTML structure. * * Eventually the HTML Processor will also support: * - Wrapping a tag in surrounding HTML. * - Unwrapping a tag by removing its parent. * - Inserting and removing nodes. * - Reading and changing inner content. * - Navigating up or around HTML structure. * * ## Usage * * Use of this class requires three steps: * * 1. Call a static creator method with your input HTML document. * 2. Find the location in the document you are looking for. * 3. Request changes to the document at that location. * * Example: * * $processor = WP_HTML_Processor::create_fragment( $html ); * if ( $processor->next_tag( array( 'breadcrumbs' => array( 'DIV', 'FIGURE', 'IMG' ) ) ) ) { * $processor->add_class( 'responsive-image' ); * } * * #### Breadcrumbs * * Breadcrumbs represent the stack of open elements from the root * of the document or fragment down to the currently-matched node, * if one is currently selected. Call WP_HTML_Processor::get_breadcrumbs() * to inspect the breadcrumbs for a matched tag. * * Breadcrumbs can specify nested HTML structure and are equivalent * to a CSS selector comprising tag names separated by the child * combinator, such as "DIV > FIGURE > IMG". * * Since all elements find themselves inside a full HTML document * when parsed, the return value from `get_breadcrumbs()` will always * contain any implicit outermost elements. For example, when parsing * with `create_fragment()` in the `BODY` context (the default), any * tag in the given HTML document will contain `array( 'HTML', 'BODY', … )` * in its breadcrumbs. * * Despite containing the implied outermost elements in their breadcrumbs, * tags may be found with the shortest-matching breadcrumb query. That is, * `array( 'IMG' )` matches all IMG elements and `array( 'P', 'IMG' )` * matches all IMG elements directly inside a P element. To ensure that no * partial matches erroneously match it's possible to specify in a query * the full breadcrumb match all the way down from the root HTML element. * * Example: * * $html = '<figure><img><figcaption>A <em>lovely</em> day outside</figcaption></figure>'; * // ----- Matches here. * $processor->next_tag( array( 'breadcrumbs' => array( 'FIGURE', 'IMG' ) ) ); * * $html = '<figure><img><figcaption>A <em>lovely</em> day outside</figcaption></figure>'; * // ---- Matches here. * $processor->next_tag( array( 'breadcrumbs' => array( 'FIGURE', 'FIGCAPTION', 'EM' ) ) ); * * $html = '<div><img></div><img>'; * // ----- Matches here, because IMG must be a direct child of the implicit BODY. * $processor->next_tag( array( 'breadcrumbs' => array( 'BODY', 'IMG' ) ) ); * * ## HTML Support * * This class implements a small part of the HTML5 specification. * It's designed to operate within its support and abort early whenever * encountering circumstances it can't properly handle. This is * the principle way in which this class remains as simple as possible * without cutting corners and breaking compliance. * * ### Supported elements * * If any unsupported element appears in the HTML input the HTML Processor * will abort early and stop all processing. This draconian measure ensures * that the HTML Processor won't break any HTML it doesn't fully understand. * * The HTML Processor supports all elements other than a specific set: * * - Any element inside a TABLE. * - Any element inside foreign content, including SVG and MATH. * - Any element outside the IN BODY insertion mode, e.g. doctype declarations, meta, links. * * ### Supported markup * * Some kinds of non-normative HTML involve reconstruction of formatting elements and * re-parenting of mis-nested elements. For example, a DIV tag found inside a TABLE * may in fact belong _before_ the table in the DOM. If the HTML Processor encounters * such a case it will stop processing. * * The following list illustrates some common examples of unexpected HTML inputs that * the HTML Processor properly parses and represents: * * - HTML with optional tags omitted, e.g. `<p>one<p>two`. * - HTML with unexpected tag closers, e.g. `<p>one </span> more</p>`. * - Non-void tags with self-closing flag, e.g. `<div/>the DIV is still open.</div>`. * - Heading elements which close open heading elements of another level, e.g. `<h1>Closed by </h2>`. * - Elements containing text that looks like other tags but isn't, e.g. `<title>The <img> is plaintext`. * - SCRIPT and STYLE tags containing text that looks like HTML but isn't, e.g. ``. * - SCRIPT content which has been escaped, e.g. ``. * * ### Unsupported Features * * This parser does not report parse errors. * * Normally, when additional HTML or BODY tags are encountered in a document, if there * are any additional attributes on them that aren't found on the previous elements, * the existing HTML and BODY elements adopt those missing attribute values. This * parser does not add those additional attributes. * * In certain situations, elements are moved to a different part of the document in * a process called "adoption" and "fostering." Because the nodes move to a location * in the document that the parser had already processed, this parser does not support * these situations and will bail. * * @since 6.4.0 * * @see WP_HTML_Tag_Processor * @see https://html.spec.whatwg.org/ */ class WP_HTML_Processor extends \WP_HTML_Tag_Processor { /** * The maximum number of bookmarks allowed to exist at any given time. * * HTML processing requires more bookmarks than basic tag processing, * so this class constant from the Tag Processor is overwritten. * * @since 6.4.0 * * @var int */ const MAX_BOOKMARKS = 100; /** * Creates an HTML processor in the fragment parsing mode. * * Use this for cases where you are processing chunks of HTML that * will be found within a bigger HTML document, such as rendered * block output that exists within a post, `the_content` inside a * rendered site layout. * * Fragment parsing occurs within a context, which is an HTML element * that the document will eventually be placed in. It becomes important * when special elements have different rules than others, such as inside * a TEXTAREA or a TITLE tag where things that look like tags are text, * or inside a SCRIPT tag where things that look like HTML syntax are JS. * * The context value should be a representation of the tag into which the * HTML is found. For most cases this will be the body element. The HTML * form is provided because a context element may have attributes that * impact the parse, such as with a SCRIPT tag and its `type` attribute. * * ## Current HTML Support * * - The only supported context is ``, which is the default value. * - The only supported document encoding is `UTF-8`, which is the default value. * * @since 6.4.0 * @since 6.6.0 Returns `static` instead of `self` so it can create subclass instances. * * @param string $html Input HTML fragment to process. * @param string $context Context element for the fragment, must be default of ``. * @param string $encoding Text encoding of the document; must be default of 'UTF-8'. * @return static|null The created processor if successful, otherwise null. */ public static function create_fragment($html, $context = '', $encoding = 'UTF-8') { } /** * Creates an HTML processor in the full parsing mode. * * It's likely that a fragment parser is more appropriate, unless sending an * entire HTML document from start to finish. Consider a fragment parser with * a context node of ``. * * Since UTF-8 is the only currently-accepted charset, if working with a * document that isn't UTF-8, it's important to convert the document before * creating the processor: pass in the converted HTML. * * @param string $html Input HTML document to process. * @param string|null $known_definite_encoding Optional. If provided, specifies the charset used * in the input byte stream. Currently must be UTF-8. * @return static|null The created processor if successful, otherwise null. */ public static function create_full_parser($html, $known_definite_encoding = 'UTF-8') { } /** * Constructor. * * Do not use this method. Use the static creator methods instead. * * @access private * * @since 6.4.0 * * @see WP_HTML_Processor::create_fragment() * * @param string $html HTML to process. * @param string|null $use_the_static_create_methods_instead This constructor should not be called manually. */ public function __construct($html, $use_the_static_create_methods_instead = \null) { } /** * Returns the last error, if any. * * Various situations lead to parsing failure but this class will * return `false` in all those cases. To determine why something * failed it's possible to request the last error. This can be * helpful to know to distinguish whether a given tag couldn't * be found or if content in the document caused the processor * to give up and abort processing. * * Example * * $processor = WP_HTML_Processor::create_fragment( '