Warning: fopen(/home/danestany/public_html/wp-content/plugins/wordfence/waf/../languages/wordfence.mo): failed to open stream: No such file or directory in /home/danestany/public_html/wp-content/plugins/wordfence/waf/pomo/streams.php on line 185
@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 ) {
if ( ! $this->callbacks ) {
return $value;
}
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* 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 ) {
$this->doing_action = true;
$this->apply_filters( '', $args );
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
if ( ! $this->nesting_level ) {
$this->doing_action = false;
}
}
/**
* 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 ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
do {
$priority = current( $this->iterations[ $nesting_level ] );
foreach ( $this->callbacks[ $priority ] as $the_ ) {
call_user_func_array( $the_['function'], $args );
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
$this->nesting_level--;
}
/**
* 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() {
if ( false === current( $this->iterations ) ) {
return false;
}
return current( current( $this->iterations ) );
}
/**
* 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 ) {
/** @var WP_Hook[] $normalized */
$normalized = array();
foreach ( $filters as $hook_name => $callback_groups ) {
if ( is_object( $callback_groups ) && $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;
}
}
/**
* 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 ] );
}
/**
* 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/danestany/public_html/wp-includes/plugin.php:118
Stack trace:
#0 /home/danestany/public_html/wp-includes/wp-db.php(2240): add_filter('query', Array, 0)
#1 /home/danestany/public_html/wp-includes/wp-db.php(2259): wpdb->placeholder_escape()
#2 /home/danestany/public_html/wp-includes/wp-db.php(1274): wpdb->add_placeholder_escape('utf8mb4')
#3 /home/danestany/public_html/wp-includes/wp-db.php(1346): wpdb->_real_escape('utf8mb4')
#4 [internal function]: wpdb->escape_by_ref('utf8mb4', 0)
#5 /home/danestany/public_html/wp-includes/wp-db.php(1509): array_walk(Array, Array)
#6 /home/danestany/public_html/wp-includes/wp-db.php(888): wpdb->prepare('SET NAMES '%s'', 'utf8mb4')
#7 /home/danestany/public_html/wp-includes/wp-db.php(1832): wpdb->set_charset(Object(mysqli))
#8 /home/danestany/public_html/wp-includes/wp-db.php(724): wpdb->db_connect()
#9 /home/danestany/public_html/wp-includes/load.php(561): wpdb->__construct('danestan_f13656', 'J^-8Z$wDv^[i', 'danestan_agahim in /home/danestany/public_html/wp-includes/plugin.php on line 118