, preg_match_all .
add_filter $wp_filter. , . , , .
,
public function __construct()
{
add_filter(
'plugin_action_links',
function($links, $file) {
return $this->AddSettingsLink($links, $file);
},
10,
2
);
}
, , PHP 5.4 (. ) - $this .
- SettingsHandler __invoke, Functor, .
public function __invoke($links, $file)
{
return $this->AddSettingsLink($links, $file);
}
ctor
add_filter('plugin_action_links', $this, 10, 2);
__invoke , . , .
, . ctor (, , WP , ). , , .
include 'SettingsHandler.php';
add_filter('plugin_action_links', new SettingsHandler, 10, 2);
.
¹ :, -, Wordpress, - . , .