container->get('basename')}", [ $this, 'after_plugin_row', ], 10, 2 ); } /** * Render plugin action links. * * @param array $links Existing links. * @param string $file Plugin file path. * * @return mixed */ public function plugin_action_links( $links, $file ) { $basename = $this->container->get( 'basename' ); if ( $file === $basename ) { $plugin_action_links = apply_filters( 'content_control/plugin_action_links', [ 'upgrade' => '' . __( 'Upgrade to Pro', 'content-control' ) . '', 'settings' => '' . __( 'Settings', 'content-control' ) . '', ] ); if ( $this->container->is_license_active() || $this->container->is_pro_active() ) { unset( $plugin_action_links['upgrade'] ); } if ( substr( get_locale(), 0, 2 ) === 'en' ) { $plugin_action_links = array_merge( [ 'translate' => '' . __( 'Translate', 'content-control' ) . '' ], $plugin_action_links ); } foreach ( $plugin_action_links as $link ) { array_unshift( $links, $link ); } } return $links; } /** * Add a row to the plugin list table. * * @param string $file Plugin file path. * @param array $plugin_data Plugin data. * * @return void */ public function after_plugin_row( $file, $plugin_data ) { $plugin_slug = $this->container->get( 'slug' ); if ( $plugin_slug !== $plugin_data['slug'] ) { return; } $plugin_url = $this->container->get( 'url' ); ?>