2021-03-03 18:58:03 +00:00
< ? php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.EscapeOutput.OutputNotEscaped
2021-03-02 03:09:34 +00:00
/**
2021-04-19 12:24:26 +01:00
* Footnotes_Hooks class
2021-03-02 03:09:34 +00:00
*
2021-03-03 18:58:03 +00:00
* @ package footnotes
2021-04-16 23:17:07 +01:00
* @ subpackage WPDashboard
2021-03-03 18:58:03 +00:00
* @ since 1.5 . 0
2021-03-02 03:09:34 +00:00
*/
/**
2021-04-19 12:24:26 +01:00
* Registers all WordPress hooks and executes them on demand .
2021-03-02 03:09:34 +00:00
*
* @ since 1.5 . 0
*/
2021-04-19 12:24:26 +01:00
class Footnotes_Hooks {
2021-03-02 03:09:34 +00:00
/**
* Registers all WordPress hooks .
*
* @ since 1.5 . 0
*/
2021-03-03 18:58:03 +00:00
public static function register_hooks () {
2021-04-19 12:24:26 +01:00
register_activation_hook ( dirname ( __FILE__ ) . '/../footnotes.php' , array ( 'Footnotes_Hooks' , 'activate_plugin' ) );
register_deactivation_hook ( dirname ( __FILE__ ) . '/../footnotes.php' , array ( 'Footnotes_Hooks' , 'deactivate_plugin' ) );
register_uninstall_hook ( dirname ( __FILE__ ) . '/../footnotes.php' , array ( 'Footnotes_Hooks' , 'uninstall_plugin' ) );
2021-03-02 03:09:34 +00:00
}
/**
2021-04-16 23:17:07 +01:00
* Executes when the Plugin is activated .
*
* Currently a no - op placeholder .
2021-03-02 03:09:34 +00:00
*
* @ since 1.5 . 0
*/
2021-03-03 18:58:03 +00:00
public static function activate_plugin () {
// Currently unused.
2021-03-02 03:09:34 +00:00
}
/**
2021-04-16 23:17:07 +01:00
* Executes when the Plugin is deactivated .
*
* Currently a no - op placeholder .
2021-03-02 03:09:34 +00:00
*
* @ since 1.5 . 0
*/
2021-03-03 18:58:03 +00:00
public static function deactivate_plugin () {
// Currently unused.
2021-03-02 03:09:34 +00:00
}
/**
2021-04-16 23:17:07 +01:00
* Appends the Plugin links for display in the dashboard “Plugins” page .
2021-03-02 03:09:34 +00:00
*
* @ since 1.5 . 0
2021-04-16 23:17:07 +01:00
* @ param array $plugin_links The WP - default set of links to display .
* @ return string [] The full set of links to display .
2021-03-02 03:09:34 +00:00
*/
2021-04-16 23:17:07 +01:00
public static function get_plugin_links ( array $plugin_links ) : array {
2021-03-03 18:58:03 +00:00
// Append link to the WordPress Plugin page.
2021-04-16 23:17:07 +01:00
$plugin_links [] = sprintf ( '<a href="https://wordpress.org/support/plugin/footnotes" target="_blank">%s</a>' , __ ( 'Support' , 'footnotes' ) );
2021-03-03 18:58:03 +00:00
// Append link to the settings page.
2021-04-16 23:17:07 +01:00
$plugin_links [] = sprintf ( '<a href="%s">%s</a>' , admin_url ( 'options-general.php?page=footnotes' ), __ ( 'Settings' , 'footnotes' ) );
2021-03-03 18:58:03 +00:00
// Append link to the PayPal donate function.
2021-04-16 23:17:07 +01:00
$plugin_links [] = sprintf ( '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6Z6CZDW8PPBBJ" target="_blank">%s</a>' , __ ( 'Donate' , 'footnotes' ) );
2021-03-03 18:58:03 +00:00
// Return new links.
2021-04-16 23:17:07 +01:00
return $plugin_links ;
2021-03-02 03:09:34 +00:00
}
}