| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Parsely plugins actions class | |
| 3 | + * UI: plugins actions class | |
| 4 | 4 | * |
| 5 | 5 | * @package Parsely |
| 6 | - * @since 2.6.0 | |
| 6 | + * @since 2.6.0 | |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | declare(strict_types=1); |
| 10 | 10 | |
| @@ -21,11 +21,9 @@ | ||
| 21 | 21 | */ |
| 22 | 22 | final class Plugins_Actions { |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * Register action and filter hook callbacks. | |
| 26 | - * | |
| 27 | - * @return void | |
| 25 | + * Registers action and filter hook callbacks. | |
| 28 | 26 | */ |
| 29 | 27 | public function run(): void { |
| 30 | 28 | add_filter( 'plugin_action_links_' . plugin_basename( PARSELY_FILE ), array( $this, 'add_plugin_meta_links' ) ); |
| 31 | 29 | } |
| @@ -30,19 +28,20 @@ | ||
| 30 | 28 | add_filter( 'plugin_action_links_' . plugin_basename( PARSELY_FILE ), array( $this, 'add_plugin_meta_links' ) ); |
| 31 | 29 | } |
| 32 | 30 | |
| 33 | 31 | /** |
| 34 | - * Adds a 'Settings' action link to the Plugins screen in WP admin. | |
| 32 | + * Adds a 'Settings' action link to the Plugins screen in wp-admin. | |
| 35 | 33 | * |
| 36 | - * @param array $actions An array of plugin action links. By default, this can include 'activate', | |
| 37 | - * 'deactivate', and 'delete'. With Multisite active this can also include | |
| 38 | - * 'network_active' and 'network_only' items. | |
| 39 | - * @return array | |
| 34 | + * @param array<string, mixed> $actions An array of plugin action links. By default, this can include 'activate', | |
| 35 | + * 'deactivate', and 'delete'. With Multisite active this can also include | |
| 36 | + * 'network_active' and 'network_only' items. | |
| 37 | + * @return array<string, mixed> | |
| 40 | 38 | */ |
| 41 | 39 | public function add_plugin_meta_links( array $actions ): array { |
| 40 | + $link_pattern = '<a href="%s">%s</a>'; | |
| 42 | 41 | if ( is_multisite() && is_plugin_active_for_network( plugin_basename( PARSELY_FILE ) ) ) { |
| 43 | 42 | $actions['siteslist'] = sprintf( |
| 44 | - '<a href="%s">%s</a>', | |
| 43 | + $link_pattern, | |
| 45 | 44 | esc_url( network_admin_url( 'sites.php' ) ), |
| 46 | 45 | esc_html__( 'Sites', 'wp-parsely' ) |
| 47 | 46 | ); |
| 48 | 47 | } |
| @@ -47,16 +46,16 @@ | ||
| 47 | 46 | ); |
| 48 | 47 | } |
| 49 | 48 | |
| 50 | 49 | $actions['settings'] = sprintf( |
| 51 | - '<a href="%s">%s</a>', | |
| 50 | + $link_pattern, | |
| 52 | 51 | esc_url( Parsely::get_settings_url() ), |
| 53 | 52 | esc_html__( 'Settings', 'wp-parsely' ) |
| 54 | 53 | ); |
| 55 | 54 | |
| 56 | 55 | $actions['documentation'] = sprintf( |
| 57 | - '<a href="%s">%s</a>', | |
| 58 | - 'https://www.parse.ly/help/integration/wordpress', | |
| 56 | + $link_pattern, | |
| 57 | + 'https://docs.parse.ly/wordpress-plugin-setup/', | |
| 59 | 58 | esc_html__( 'Documentation', 'wp-parsely' ) |
| 60 | 59 | ); |
| 61 | 60 | |
| 62 | 61 | return $actions; |