| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Admin Menu Search |
| 4 |
Plugin URI: https://herchen.com/admin-menu-search/ |
| 5 |
Description: Adds a search box to the top of the WordPress Admin Menu. Allows you to easily locate admin menu functions for sites with large amounts of menus or menu items. |
| 6 |
Version: 1.2 |
| 7 |
Author: Michael Herchenroder |
| 8 |
Author URI: http://herchen.com |
| 9 |
*/ |
| 10 |
|
| 11 |
add_action('admin_enqueue_scripts', 'fhqwhgads_load_scripts'); |
| 12 |
function fhqwhgads_load_scripts() { |
| 13 |
wp_enqueue_script( 'admin-menu-search', plugin_dir_url( __FILE__ ) . "/admin-menu-search.js", array(), '1.2', true ); |
| 14 |
} |
| 15 |
|
| 16 |
|
| 17 |
if ( is_admin() ) { |
| 18 |
add_filter( 'plugin_row_meta', 'fhqwhgads_donate_link', 10, 2 ); |
| 19 |
} |
| 20 |
|
| 21 |
//Come on, Fhqwhgads... |
| 22 |
function fhqwhgads_donate_link( $links, $file ) { |
| 23 |
if ( $file == 'admin-menu-search/admin-menu-search.php' ) { |
| 24 |
$donation_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8NJPQ6RHLT5HN&source=url'; |
| 25 |
$donation_url .= urlencode( sprintf( __( 'Donation for Admin Menu Search plugin: %s', 'admin-menu-search' ), "Admin Menu Search" ) ); |
| 26 |
$links[] = '<a href="' . esc_url( $donation_url ) . '" target="_blank">' . __( 'Donate', 'admin-menu-search' ) . '</a>'; |
| 27 |
} |
| 28 |
return $links; |
| 29 |
} |