服务不可用。
Warning: Cannot modify header information - headers already sent by (output started at /home/vanthoi/public_html/wp-mail.php:10) in /home/vanthoi/public_html/wp-config.php on line 20
.
*/
public static function build_preinitialized_hooks( $filters ) {
/** @var WP_Hook[] $normalized */
$normalized = array();
foreach ( $filters as $hook_name => $callback_groups ) {
if ( $callback_groups instanceof WP_Hook ) {
$normalized[ $hook_name ] = $callback_groups;
continue;
}
$hook = new WP_Hook();
// Loop through callback groups.
foreach ( $callback_groups as $priority => $callbacks ) {
// Loop through callbacks.
foreach ( $callbacks as $cb ) {
$hook->add_filter( $hook_name, $cb['function'], $priority, $cb['accepted_args'] );
}
}
$normalized[ $hook_name ] = $hook;
}
return $normalized;
}
/**
* 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 ) {
return isset( $this->callbacks[ $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 ) {
return isset( $this->callbacks[ $offset ] ) ? $this->callbacks[ $offset ] : null;
}
/**
* 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 ) {
if ( is_null( $offset ) ) {
$this->callbacks[] = $value;
} else {
$this->callbacks[ $offset ] = $value;
}
$this->priorities = array_keys( $this->callbacks );
}
/**
* 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 ) {
unset( $this->callbacks[ $offset ] );
$this->priorities = array_keys( $this->callbacks );
}
/**
* 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() {
return current( $this->callbacks );
}
/**
* 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() {
return next( $this->callbacks );
}
/**
* 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() {
return key( $this->callbacks );
}
/**
* 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() {
return key( $this->callbacks ) !== null;
}
/**
* 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() {
reset( $this->callbacks );
}
}
Fatal error: Uncaught Error: Class 'WP_Hook' not found in /home/vanthoi/public_html/wp-includes/plugin.php:125
Stack trace:
#0 /home/vanthoi/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php(182): add_filter('supercache_file...', 'wp_cache_check_...')
#1 /home/vanthoi/public_html/wp-content/advanced-cache.php(22): include_once('/home/vanthoi/p...')
#2 /home/vanthoi/public_html/wp-settings.php(97): include('/home/vanthoi/p...')
#3 /home/vanthoi/public_html/wp-config.php(97): require_once('/home/vanthoi/p...')
#4 /home/vanthoi/public_html/wp-load.php(50): require_once('/home/vanthoi/p...')
#5 /home/vanthoi/public_html/wp-mail.php(15): require('/home/vanthoi/p...')
#6 {main}
thrown in /home/vanthoi/public_html/wp-includes/plugin.php on line 125