PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.2
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.2
8.0.1 8.0.2 8.0.0 7.9.9.7 7.9.9.6 7.9.9.5 7.9.9.4 7.9.9.3 7.9.9.2 7.9.9.1 7.9.9 7.9.8 7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 7.9.0 7.8.9 7.8.8 7.8.7 7.8.6 7.8.5 All 44 releases
gamipress / includes / admin / plugins.php

plugins.php in GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI 8.0.2, at includes/admin/plugins.php

70 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin Plugins
4 *
5 * @package GamiPress\Admin\Plugins
6 * @author GamiPress <contact@gamipress.com>, Ruben Garcia <rubengcdev@gmail.com>
7 * @since 1.1.0
8 */
9 // Exit if accessed directly
10 if( !defined( 'ABSPATH' ) ) exit;
11
12 /**
13 * Plugins row action links
14 *
15 * @since 1.1.0
16 * @updated 1.4.9.2 Added support for multisite URL when GamiPress is network wide active
17 *
18 * @param array $links Array of plugin action links
19 * @param string $file Plugin file
20 *
21 * @return array $links
22 */
23 function gamipress_plugin_action_links( $links, $file ) {
24
25 if ( $file != 'gamipress/gamipress.php' )
26 return $links;
27
28 if( gamipress_is_network_wide_active() && ! is_main_site() ) {
29 // Set settings link to main site
30 $settings_link = '<a href="' . get_admin_url( get_main_site_id(), 'admin.php?page=gamipress_settings' ) . '">' . esc_html__( 'Settings', 'gamipress' ) . '</a>';
31 } else {
32 // Set settings link to current site
33 $settings_link = '<a href="' . admin_url( 'admin.php?page=gamipress_settings' ) . '">' . esc_html__( 'Settings', 'gamipress' ) . '</a>';
34 }
35
36 array_unshift( $links, $settings_link );
37
38 return $links;
39
40 }
41 add_filter( 'plugin_action_links', 'gamipress_plugin_action_links', 10, 2 );
42
43
44 /**
45 * Plugin row meta links
46 *
47 * @since 1.1.0
48 *
49 * @param array $input Array of plugin meta links
50 * @param string $file Plugin file
51 *
52 * @return array $input
53 */
54 function gamipress_plugin_row_meta( $input, $file ) {
55
56 if ( $file != 'gamipress/gamipress.php' )
57 return $input;
58
59 $links = array(
60 '<a href="https://gamipress.com/add-ons/">' . esc_html__( 'Add-ons', 'gamipress' ) . '</a>',
61 '<a href="https://gamipress.com/docs/">' . esc_html__( 'Docs', 'gamipress' ) . '</a>',
62 '<a href="https://gamipress.com/contact-us/">' . esc_html__( 'Support', 'gamipress' ) . '</a>',
63 );
64
65 $input = array_merge( $input, $links );
66
67 return $input;
68 }
69 add_filter( 'plugin_row_meta', 'gamipress_plugin_row_meta', 10, 2 );
70