PluginProbe
Parse.ly / 3.2.1
Parse.ly v3.2.1
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
wp-parsely / src / UI / class-plugins-actions.php

class-plugins-actions.php in Parse.ly 3.2.1, at src/UI/class-plugins-actions.php

65 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Parsely plugins actions class
4 *
5 * @package Parsely
6 * @since 2.6.0
7 */
8
9 declare(strict_types=1);
10
11 namespace Parsely\UI;
12
13 use Parsely\Parsely;
14
15 use const Parsely\PARSELY_FILE;
16
17 /**
18 * User Interface changes for the plugins actions.
19 *
20 * @since 2.6.0
21 */
22 final class Plugins_Actions {
23
24 /**
25 * Register action and filter hook callbacks.
26 *
27 * @return void
28 */
29 public function run(): void {
30 add_filter( 'plugin_action_links_' . plugin_basename( PARSELY_FILE ), array( $this, 'add_plugin_meta_links' ) );
31 }
32
33 /**
34 * Adds a 'Settings' action link to the Plugins screen in WP admin.
35 *
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
40 */
41 public function add_plugin_meta_links( array $actions ): array {
42 if ( is_multisite() && is_plugin_active_for_network( plugin_basename( PARSELY_FILE ) ) ) {
43 $actions['siteslist'] = sprintf(
44 '<a href="%s">%s</a>',
45 esc_url( network_admin_url( 'sites.php' ) ),
46 esc_html__( 'Sites', 'wp-parsely' )
47 );
48 }
49
50 $actions['settings'] = sprintf(
51 '<a href="%s">%s</a>',
52 esc_url( Parsely::get_settings_url() ),
53 esc_html__( 'Settings', 'wp-parsely' )
54 );
55
56 $actions['documentation'] = sprintf(
57 '<a href="%s">%s</a>',
58 'https://www.parse.ly/help/integration/wordpress',
59 esc_html__( 'Documentation', 'wp-parsely' )
60 );
61
62 return $actions;
63 }
64 }
65