| 1 |
<?php |
| 2 |
namespace WPEXtra; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
class Core { |
| 9 |
|
| 10 |
public function __construct() { |
| 11 |
add_filter('plugin_action_links_' . plugin_basename(WPEX_FILE), [$this, 'add_plugin_action_links']); |
| 12 |
add_filter('plugin_row_meta', [$this, 'add_plugin_meta_links'], 10, 2 ); |
| 13 |
} |
| 14 |
|
| 15 |
public function add_plugin_action_links( $links ) { |
| 16 |
$links[] = '<a href="' . esc_url( admin_url( 'admin.php?page=wp-extra' ) ) . '">' . __( 'Settings' ) . '</a>'; |
| 17 |
return $links; |
| 18 |
} |
| 19 |
|
| 20 |
public function add_plugin_meta_links( $meta, $file ) { |
| 21 |
if ( $file !== plugin_basename( WPEX_FILE ) ) { |
| 22 |
return $meta; |
| 23 |
} |
| 24 |
$upgradeable = apply_filters( 'wpextra_upgradeable', true ); |
| 25 |
$meta[] = '<a href="https://wpvnteam.com/wp-extra/doc/" target="_blank">' . __( 'Documentation' ) . '</a>'; |
| 26 |
if ( !$upgradeable ) { |
| 27 |
$meta[] = '<a href="https://wpvnteam.com/support/" target="_blank">' . __( 'Support' ) . '</a>'; |
| 28 |
} else { |
| 29 |
$meta[] = '<a href="https://wpvnteam.com/donate/" target="_blank">' . __( 'Donate', 'wp-extra' ) . '</a>'; |
| 30 |
$meta[] = '<a href="https://wordpress.org/support/plugin/wp-extra/reviews/?filter=5" target="_blank" title="' . esc_html__( 'Rate WP EXtra on WordPress.org', 'wp-extra' ) . '" style="color: #ffb900">' |
| 31 |
. str_repeat( '<span class="dashicons dashicons-star-filled" style="font-size:13px;width:13px;height:13px;line-height:1.8;"></span>', 5 ) |
| 32 |
. '</a>'; |
| 33 |
} |
| 34 |
return $meta; |
| 35 |
} |
| 36 |
|
| 37 |
} |