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/mdfdztt/includes
File: class-protect-uploads-loader.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Register all actions and filters for the plugin
[3] Fix | Delete
* from : https://github.com/DevinVinson/WordPress-Plugin-Boilerplate
[4] Fix | Delete
*
[5] Fix | Delete
* Maintain a list of all hooks that are registered throughout
[6] Fix | Delete
* the plugin, and register them with the WordPress API. Call the
[7] Fix | Delete
* run function to execute the list of actions and filters.
[8] Fix | Delete
*/
[9] Fix | Delete
class Alti_ProtectUploads_Loader {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* The array of actions registered with WordPress.
[13] Fix | Delete
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
[14] Fix | Delete
*/
[15] Fix | Delete
protected $actions;
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* The array of filters registered with WordPress.
[19] Fix | Delete
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
[20] Fix | Delete
*/
[21] Fix | Delete
protected $filters;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Initialize the collections used to maintain the actions and filters.
[25] Fix | Delete
*/
[26] Fix | Delete
public function __construct() {
[27] Fix | Delete
[28] Fix | Delete
$this->actions = array();
[29] Fix | Delete
$this->filters = array();
[30] Fix | Delete
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
/**
[34] Fix | Delete
* Add a new action to the collection to be registered with WordPress.
[35] Fix | Delete
* @param string $hook The name of the WordPress action that is being registered.
[36] Fix | Delete
* @param object $component A reference to the instance of the object on which the action is defined.
[37] Fix | Delete
* @param string $callback The name of the function definition on the $component.
[38] Fix | Delete
* @param int Optional $priority The priority at which the function should be fired.
[39] Fix | Delete
* @param int Optional $accepted_args The number of arguments that should be passed to the $callback.
[40] Fix | Delete
*/
[41] Fix | Delete
public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
[42] Fix | Delete
$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* Add a new filter to the collection to be registered with WordPress.
[47] Fix | Delete
* @param string $hook The name of the WordPress filter that is being registered.
[48] Fix | Delete
* @param object $component A reference to the instance of the object on which the filter is defined.
[49] Fix | Delete
* @param string $callback The name of the function definition on the $component.
[50] Fix | Delete
* @param int Optional $priority The priority at which the function should be fired.
[51] Fix | Delete
* @param int Optional $accepted_args The number of arguments that should be passed to the $callback.
[52] Fix | Delete
*/
[53] Fix | Delete
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
[54] Fix | Delete
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* A utility function that is used to register the actions and hooks into a single
[59] Fix | Delete
* collection.
[60] Fix | Delete
* @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
[61] Fix | Delete
* @param string $hook The name of the WordPress filter that is being registered.
[62] Fix | Delete
* @param object $component A reference to the instance of the object on which the filter is defined.
[63] Fix | Delete
* @param string $callback The name of the function definition on the $component.
[64] Fix | Delete
* @param int Optional $priority The priority at which the function should be fired.
[65] Fix | Delete
* @param int Optional $accepted_args The number of arguments that should be passed to the $callback.
[66] Fix | Delete
* @return type The collection of actions and filters registered with WordPress.
[67] Fix | Delete
*/
[68] Fix | Delete
private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
[69] Fix | Delete
[70] Fix | Delete
$hooks[] = array(
[71] Fix | Delete
'hook' => $hook,
[72] Fix | Delete
'component' => $component,
[73] Fix | Delete
'callback' => $callback,
[74] Fix | Delete
'priority' => $priority,
[75] Fix | Delete
'accepted_args' => $accepted_args
[76] Fix | Delete
);
[77] Fix | Delete
[78] Fix | Delete
return $hooks;
[79] Fix | Delete
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
/**
[83] Fix | Delete
* Register the filters and actions with WordPress.
[84] Fix | Delete
*/
[85] Fix | Delete
public function run() {
[86] Fix | Delete
[87] Fix | Delete
foreach ( $this->filters as $hook ) {
[88] Fix | Delete
add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
foreach ( $this->actions as $hook ) {
[92] Fix | Delete
add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function