| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
/* Quit */ |
| 5 |
defined('ABSPATH') OR exit; |
| 6 |
|
| 7 |
|
| 8 |
/** |
| 9 |
* Statify_Backend |
| 10 |
* |
| 11 |
* @since 1.4.0 |
| 12 |
*/ |
| 13 |
|
| 14 |
class Statify_Backend |
| 15 |
{ |
| 16 |
|
| 17 |
|
| 18 |
/** |
| 19 |
* Add plugin meta links |
| 20 |
* |
| 21 |
* @since 0.1.0 |
| 22 |
* @change 1.4.0 |
| 23 |
* |
| 24 |
* @param array $input Registered links |
| 25 |
* @param string $file Current plugin file |
| 26 |
* @return array Merged links |
| 27 |
*/ |
| 28 |
|
| 29 |
public static function add_meta_link($input, $file) |
| 30 |
{ |
| 31 |
/* Restliche Plugins? */ |
| 32 |
if ( $file !== STATIFY_BASE ) { |
| 33 |
return $input; |
| 34 |
} |
| 35 |
|
| 36 |
return array_merge( |
| 37 |
$input, |
| 38 |
array( |
| 39 |
'<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZAQUT9RLPW8QN" target="_blank">PayPal</a>', |
| 40 |
'<a href="https://flattr.com/t/1733733" target="_blank">Flattr</a>' |
| 41 |
) |
| 42 |
); |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
/** |
| 47 |
* Add plugin action links |
| 48 |
* |
| 49 |
* @since 0.1.0 |
| 50 |
* @change 1.4.0 |
| 51 |
* |
| 52 |
* @param array $input Registered links |
| 53 |
* @return array Merged links |
| 54 |
*/ |
| 55 |
|
| 56 |
public static function add_action_link($input) |
| 57 |
{ |
| 58 |
/* Rechte? */ |
| 59 |
if ( ! current_user_can('edit_dashboard') ) { |
| 60 |
return $input; |
| 61 |
} |
| 62 |
|
| 63 |
/* Zusammenführen */ |
| 64 |
return array_merge( |
| 65 |
$input, |
| 66 |
array( |
| 67 |
sprintf( |
| 68 |
'<a href="%s">%s</a>', |
| 69 |
add_query_arg( |
| 70 |
array( |
| 71 |
'edit' => 'statify_dashboard#statify_dashboard' |
| 72 |
), |
| 73 |
admin_url('/') |
| 74 |
), |
| 75 |
__('Settings') |
| 76 |
) |
| 77 |
) |
| 78 |
); |
| 79 |
} |
| 80 |
} |