| @@ -21,8 +21,12 @@ | ||
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | 23 | public function init() { |
| 24 | 24 | add_filter( 'plugin_action_links', [ $this, 'plugin_action_links' ], 10, 2 ); |
| 25 | + add_action( "after_plugin_row_{$this->container->get('basename')}", [ | |
| 26 | + $this, | |
| 27 | + 'after_plugin_row', | |
| 28 | + ], 10, 2 ); | |
| 25 | 29 | } |
| 26 | 30 | |
| 27 | 31 | /** |
| 28 | 32 | * Render plugin action links. |
| @@ -43,9 +47,9 @@ | ||
| 43 | 47 | 'settings' => '<a href="' . admin_url( 'options-general.php?page=content-control-settings' ) . '">' . __( 'Settings', 'content-control' ) . '</a>', |
| 44 | 48 | ] |
| 45 | 49 | ); |
| 46 | 50 | |
| 47 | - if ( $this->container->is_pro_active() ) { | |
| 51 | + if ( $this->container->is_license_active() || $this->container->is_pro_active() ) { | |
| 48 | 52 | unset( $plugin_action_links['upgrade'] ); |
| 49 | 53 | } |
| 50 | 54 | |
| 51 | 55 | if ( substr( get_locale(), 0, 2 ) === 'en' ) { |
| @@ -57,6 +61,44 @@ | ||
| 57 | 61 | } |
| 58 | 62 | } |
| 59 | 63 | |
| 60 | 64 | return $links; |
| 65 | + } | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * Add a row to the plugin list table. | |
| 69 | + * | |
| 70 | + * @param string $file Plugin file path. | |
| 71 | + * @param array<string,string|int> $plugin_data Plugin data. | |
| 72 | + * | |
| 73 | + * @return void | |
| 74 | + */ | |
| 75 | + public function after_plugin_row( $file, $plugin_data ) { | |
| 76 | + $plugin_slug = $this->container->get( 'slug' ); | |
| 77 | + | |
| 78 | + if ( $plugin_slug !== $plugin_data['slug'] ) { | |
| 79 | + return; | |
| 80 | + } | |
| 81 | + | |
| 82 | + $plugin_url = $this->container->get( 'url' ); | |
| 83 | + | |
| 84 | + ?> | |
| 85 | + <!-- <tr class="plugin-update-tr active"> | |
| 86 | + <td colspan="3" class="plugin-update colspanchange"> | |
| 87 | + <div class="update-message notice inline notice-warning notice-alt"> | |
| 88 | + <p> | |
| 89 | + <?php | |
| 90 | + printf( | |
| 91 | + /* translators: %1$s: Plugin name, %2$s: Plugin URL */ | |
| 92 | + esc_html__( 'You are using the %1$s plugin. Please visit the %2$s to learn how to use it.', 'content-control' ), | |
| 93 | + '<strong>' . esc_html__( 'Content Control', 'content-control' ) . '</strong>', | |
| 94 | + '<a href="' . esc_url( $plugin_url ) . '" target="_blank">' . esc_html__( 'plugin website', 'content-control' ) . '</a>' | |
| 95 | + ); | |
| 96 | + ?> | |
| 97 | + </p> | |
| 98 | + </div> | |
| 99 | + </td> | |
| 100 | + </tr> --> | |
| 101 | + | |
| 102 | + <?php | |
| 61 | 103 | } |
| 62 | 104 | } |