Advertisement
wp-coding

Add donation link with Dashicon for plugins

Jan 20th, 2019
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. /**
  2.  * A donation link with a dashicon.
  3.  *
  4.  * Ever wanted a nice clickable link with an icon for your plugin?
  5.  * Below a few code lines which help you out!
  6.  *
  7.  * Works with WordPress @version 5.0.3 and below
  8.  */
  9. add_filter( 'plugin_row_meta', 'add_meta_links', 10, 2 );
  10. function add_meta_links( $plugin_meta, $plugin_file )
  11. {
  12.     if( $plugin_file == plugin_basename(__FILE__) )
  13.     {
  14.         /** adjust the link to your preference */
  15.         $plugin_meta[] = '<a class="dashicons-before dashicons-awards" href="http://your.paypal.link.com" target="_blank">' . 'Donate Us' . '</a>';
  16.     }
  17.     return $plugin_meta;
  18. } // end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement