__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Blocksy;
class WpHooksManager {
private $tokens = [];
public function redirect_callbacks($args = []) {
// TODO: token is unused for now because we dont need the revert
// operation for callbacks redirection. But at some point we might
// need it and it will be here for us.
$args = wp_parse_args(
$args,
[
'token' => '',
'source' => [],
'destination' => '',
'priority_min' => PHP_INT_MIN,
'priority_max' => PHP_INT_MAX
]
);
blocksy_assert_args($args, ['token', 'source', 'destination']);
if (
(
$args['priority_min'] !== PHP_INT_MIN
||
$args['priority_max'] !== PHP_INT_MAX
) && count($args['source']) > 1
) {
throw new \Error(
"You can't use priority_min or priority_max with multiple sources."
);
}
global $wp_filter;
if (! isset($wp_filter[$args['destination']])) {
$wp_filter[$args['destination']] = new \WP_Hook();
}
/*
foreach ($args['source'] as $source_id) {
if (! isset($wp_filter[$source_id])) {
continue;
}
$this->tokens[$args['token']][$source_id] = $wp_filter[$source_id];
}
$this->tokens[$args['token']][$args['destination']] = $wp_filter[$args['destination']]->callbacks;
*/
foreach ($args['source'] as $source_id) {
if (! isset($wp_filter[$source_id])) {
continue;
}
$source_callbacks = $wp_filter[$source_id]->callbacks;
foreach ($source_callbacks as $priority => $callbacks) {
if ($priority < $args['priority_min']) {
continue;
}
if ($priority > $args['priority_max']) {
continue;
}
foreach ($callbacks as $callback_id => $callback) {
$wp_filter[$source_id]->remove_filter(
$source_id,
$callback['function'],
$priority
);
$wp_filter[$args['destination']]->add_filter(
$args['destination'],
$callback['function'],
$priority,
$callback['accepted_args']
);
}
}
// $this->tokens[$args['token']][$source_id] = $wp_filter[$source_id];
}
}
public function disable_callbacks($args = []) {
$args = wp_parse_args(
$args,
[
'token' => '',
'source' => []
]
);
blocksy_assert_args($args, ['token', 'source']);
global $wp_filter;
foreach ($args['source'] as $source_id) {
if (! isset($wp_filter[$source_id])) {
continue;
}
$this->tokens[$args['token']][$source_id] = $wp_filter[$source_id];
unset($wp_filter[$source_id]);
}
}
public function enable_callbacks($args = []) {
$args = wp_parse_args(
$args,
[
'token' => '',
'source' => []
]
);
blocksy_assert_args($args, ['token', 'source']);
global $wp_filter;
foreach ($args['source'] as $source_id) {
if (! isset($this->tokens[$args['token']][$source_id])) {
continue;
}
$wp_filter[$source_id] = $this->tokens[$args['token']][$source_id];
unset($this->tokens[$args['token']][$source_id]);
}
}
// For now callback rolling is not needed, but it may be needed eventually
/*
public function rollback_callbacks($args = []) {
$args = wp_parse_args(
$args,
[
'token' => '',
'source' => '',
'destination' => ''
]
);
blocksy_assert_args($args, ['token', 'source', 'destination']);
if (
! isset($this->tokens[$args['token']])
||
! isset($this->tokens[$args['token']][$args['destination']])
) {
return;
}
global $wp_filter;
foreach ($args['source'] as $source_id) {
if (! isset($this->tokens[$args['token']][$source_id])) {
continue;
}
$wp_filter[$source_id] = $this->tokens[$args['token']][$source_id];
}
$wp_filter[$args['destination']]->callbacks = $this->tokens[$args['token']][$args['destination']];
}
*/
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| db-versioning | Folder | 0750 |
|
|
| StringHelpers.php | File | 1.54 KB | 0640 |
|
| archive-title-renderer.php | File | 1.11 KB | 0640 |
|
| autoload.php | File | 6.77 KB | 0640 |
|
| blocksy-blocks-parser.php | File | 941 B | 0640 |
|
| blocksy-walker-page.php | File | 1.06 KB | 0640 |
|
| class-ct-attributes-parser.php | File | 6.67 KB | 0640 |
|
| class-ct-css-injector.php | File | 7.06 KB | 0640 |
|
| class-ct-group-title.php | File | 1.12 KB | 0640 |
|
| colors.php | File | 2.28 KB | 0640 |
|
| database.php | File | 584 B | 0640 |
|
| entity-id-picker.php | File | 6.39 KB | 0640 |
|
| hooks-manager.php | File | 3.63 KB | 0640 |
|
| print.php | File | 5.19 KB | 0640 |
|
| raii.php | File | 255 B | 0640 |
|
| screen-manager.php | File | 14.6 KB | 0640 |
|
| theme-db-versioning.php | File | 36.26 KB | 0640 |
|
| trait-wordpress-actions-manager.php | File | 2.01 KB | 0640 |
|
| translations-manager.php | File | 10.71 KB | 0640 |
|
| woo-import-export.php | File | 8.57 KB | 0640 |
|
| woo-variation-images-import-export.php | File | 2.43 KB | 0640 |
|