| 1 |
<?php |
| 2 |
|
| 3 |
namespace SpringDevs\Subscription\Admin; |
| 4 |
|
| 5 |
/** |
| 6 |
* Plugin action links |
| 7 |
* |
| 8 |
* Class Links |
| 9 |
* |
| 10 |
* @package SpringDevs\Subscription\Admin |
| 11 |
*/ |
| 12 |
class Links { |
| 13 |
|
| 14 |
/** |
| 15 |
* Initialize the class |
| 16 |
*/ |
| 17 |
public function __construct() { |
| 18 |
add_filter( 'plugin_action_links_' . plugin_basename( SUBSCRPT_FILE ), array( $this, 'plugin_action_links' ) ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Add plugin action links |
| 23 |
* |
| 24 |
* @param array $links Plugin Links. |
| 25 |
*/ |
| 26 |
public function plugin_action_links( $links ) { |
| 27 |
$getting_started_url = admin_url( 'admin.php?page=wp-subscription-onboarding' ); |
| 28 |
array_unshift( $links, '<a href="' . esc_url( $getting_started_url ) . '">' . __( 'Getting Started', 'subscription' ) . '</a>' ); |
| 29 |
if ( ! subscrpt_pro_activated() ) { |
| 30 |
$links[] = '<a href="https://wpsubscription.co/?utm_source=plugin&utm_medium=admin&utm_campaign=upgrade_pro" target="_blank" style="color:#3db634;">' . __( 'Upgrade to premium', 'subscription' ) . '</a>'; |
| 31 |
} |
| 32 |
$links[] = '<a href="https://wordpress.org/support/plugin/subscription" target="_blank">' . __( 'Support', 'subscription' ) . '</a>'; |
| 33 |
$links[] = '<a href="https://wordpress.org/support/plugin/subscription/reviews/" target="_blank">' . __( 'Review', 'subscription' ) . '</a>'; |
| 34 |
return $links; |
| 35 |
} |
| 36 |
} |
| 37 |
|