Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../EmbedPre...
File: Loader.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace EmbedPress;
[2] Fix | Delete
[3] Fix | Delete
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Entity responsible for maintaining and registering all hooks that power the plugin.
[7] Fix | Delete
*
[8] Fix | Delete
* @package EmbedPress
[9] Fix | Delete
* @author EmbedPress <help@embedpress.com>
[10] Fix | Delete
* @copyright Copyright (C) 2023 WPDeveloper. All rights reserved.
[11] Fix | Delete
* @license GPLv3 or later
[12] Fix | Delete
* @since 1.0.0
[13] Fix | Delete
*/
[14] Fix | Delete
class Loader
[15] Fix | Delete
{
[16] Fix | Delete
/**
[17] Fix | Delete
* The array of actions registered with WordPress.
[18] Fix | Delete
*
[19] Fix | Delete
* @since 1.0.0
[20] Fix | Delete
* @access protected
[21] Fix | Delete
*
[22] Fix | Delete
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
[23] Fix | Delete
*/
[24] Fix | Delete
protected $actions;
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* The array of filters registered with WordPress.
[28] Fix | Delete
*
[29] Fix | Delete
* @since 1.0.0
[30] Fix | Delete
* @access protected
[31] Fix | Delete
*
[32] Fix | Delete
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
[33] Fix | Delete
*/
[34] Fix | Delete
protected $filters;
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Initialize the collections used to maintain the actions and filters.
[38] Fix | Delete
*
[39] Fix | Delete
* @since 1.0.0
[40] Fix | Delete
*
[41] Fix | Delete
* @return void
[42] Fix | Delete
*/
[43] Fix | Delete
public function __construct()
[44] Fix | Delete
{
[45] Fix | Delete
$this->actions = [];
[46] Fix | Delete
$this->filters = [];
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Add a new action to the collection to be registered with WordPress.
[51] Fix | Delete
*
[52] Fix | Delete
* @since 1.0.0
[53] Fix | Delete
*
[54] Fix | Delete
* @param string $hook The name of the WordPress action that is being registered.
[55] Fix | Delete
* @param object $component A reference to the instance of the object on which the action is defined.
[56] Fix | Delete
* @param string $callback The name of the function definition on the $component.
[57] Fix | Delete
* @param int $priority Optional. he priority at which the function should be fired. Default is 10.
[58] Fix | Delete
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default
[59] Fix | Delete
* is 1.
[60] Fix | Delete
*
[61] Fix | Delete
* @return void
[62] Fix | Delete
*/
[63] Fix | Delete
public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1)
[64] Fix | Delete
{
[65] Fix | Delete
$this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args);
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Add a new filter to the collection to be registered with WordPress.
[70] Fix | Delete
*
[71] Fix | Delete
* @since 1.0.0
[72] Fix | Delete
*
[73] Fix | Delete
* @param string $hook The name of the WordPress filter that is being registered.
[74] Fix | Delete
* @param object $component A reference to the instance of the object on which the filter is defined.
[75] Fix | Delete
* @param string $callback The name of the function definition on the $component.
[76] Fix | Delete
* @param int $priority Optional. he priority at which the function should be fired. Default is 10.
[77] Fix | Delete
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default
[78] Fix | Delete
* is 1.
[79] Fix | Delete
*
[80] Fix | Delete
* @return void
[81] Fix | Delete
*/
[82] Fix | Delete
public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1)
[83] Fix | Delete
{
[84] Fix | Delete
$this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args);
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Method that is used to register the actions and hooks into a single collection.
[89] Fix | Delete
*
[90] Fix | Delete
* @since 1.0.0
[91] Fix | Delete
* @access private
[92] Fix | Delete
*
[93] Fix | Delete
* @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
[94] Fix | Delete
* @param string $hook The name of the WordPress filter that is being registered.
[95] Fix | Delete
* @param object $component A reference to the instance of the object on which the filter is defined.
[96] Fix | Delete
* @param string $callback The name of the function definition on the $component.
[97] Fix | Delete
* @param int $priority The priority at which the function should be fired.
[98] Fix | Delete
* @param int $accepted_args The number of arguments that should be passed to the $callback.
[99] Fix | Delete
*
[100] Fix | Delete
* @return array The collection of actions and filters registered with WordPress.
[101] Fix | Delete
*/
[102] Fix | Delete
private function add($hooks, $hook, $component, $callback, $priority, $accepted_args)
[103] Fix | Delete
{
[104] Fix | Delete
$hooks[] = [
[105] Fix | Delete
'hook' => $hook,
[106] Fix | Delete
'component' => $component,
[107] Fix | Delete
'callback' => $callback,
[108] Fix | Delete
'priority' => $priority,
[109] Fix | Delete
'accepted_args' => $accepted_args,
[110] Fix | Delete
];
[111] Fix | Delete
[112] Fix | Delete
return $hooks;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
/**
[116] Fix | Delete
* Register all required filters and actions with WordPress.
[117] Fix | Delete
*
[118] Fix | Delete
* @since 1.0.0
[119] Fix | Delete
*
[120] Fix | Delete
* @return void
[121] Fix | Delete
*/
[122] Fix | Delete
public function run()
[123] Fix | Delete
{
[124] Fix | Delete
foreach ($this->filters as $hook) {
[125] Fix | Delete
add_filter($hook['hook'], [
[126] Fix | Delete
$hook['component'],
[127] Fix | Delete
$hook['callback'],
[128] Fix | Delete
], $hook['priority'], $hook['accepted_args']);
[129] Fix | Delete
}
[130] Fix | Delete
[131] Fix | Delete
foreach ($this->actions as $hook) {
[132] Fix | Delete
add_action($hook['hook'], [
[133] Fix | Delete
$hook['component'],
[134] Fix | Delete
$hook['callback'],
[135] Fix | Delete
], $hook['priority'], $hook['accepted_args']);
[136] Fix | Delete
}
[137] Fix | Delete
}
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function