quadmenu
/
jetpack_vendor
/
quadlayers
/
wp-notice-plugin-promote
/
src
/
Traits
/
PluginActions.php
PluginActions.php in QuadMenu – Mega Menu 3.3.8, at jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/Traits/PluginActions.php
| 1 | <?php |
| 2 | /** |
| 3 | * QuadLayers WP Notice Plugin Promote |
| 4 | * |
| 5 | * @package quadlayers/wp-notice-plugin-promote |
| 6 | * @author QuadLayers |
| 7 | * @link https://github.com/quadlayers/wp-notice-plugin-promote |
| 8 | * @copyright Copyright (c) 2023 |
| 9 | * @license GPL-3.0 |
| 10 | */ |
| 11 | |
| 12 | namespace QuadLayers\WP_Notice_Plugin_Promote\Traits; |
| 13 | |
| 14 | /** |
| 15 | * Trait PluginActions |
| 16 | * |
| 17 | * @package QuadLayers\WP_Notice_Plugin_Promote\Traits\PluginActions |
| 18 | * @since 1.0.0 |
| 19 | */ |
| 20 | trait PluginActions { |
| 21 | |
| 22 | use PluginActionsLinks; |
| 23 | |
| 24 | /** |
| 25 | * Get plugin action label. |
| 26 | * |
| 27 | * @return string |
| 28 | */ |
| 29 | public function get_action_label() { |
| 30 | |
| 31 | if ( $this->is_activated() ) { |
| 32 | return ''; |
| 33 | } |
| 34 | |
| 35 | if ( $this->is_installed() ) { |
| 36 | return esc_html__( 'Activate', 'wp-notice-plugin-promote' ); |
| 37 | } |
| 38 | |
| 39 | if ( $this->plugin_install_label ) { |
| 40 | return $this->plugin_install_label; |
| 41 | } |
| 42 | |
| 43 | return esc_html__( 'Install free', 'wp-notice-plugin-promote' ); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Get plugin action link. |
| 48 | * |
| 49 | * @return string |
| 50 | */ |
| 51 | public function get_action_link() { |
| 52 | |
| 53 | if ( $this->is_activated() ) { |
| 54 | return ''; |
| 55 | } |
| 56 | |
| 57 | if ( $this->is_installed() ) { |
| 58 | return $this->get_activate_link(); |
| 59 | } |
| 60 | |
| 61 | if ( $this->plugin_install_link ) { |
| 62 | return $this->plugin_install_link; |
| 63 | } |
| 64 | |
| 65 | return $this->get_install_link(); |
| 66 | } |
| 67 | |
| 68 | } |
| 69 |