1: <?php
2: /**
3: * Admin Plugins
4: *
5: * @package EPL
6: * @subpackage Admin/Plugins
7: * @copyright Copyright (c) 2020, Merv Barrett
8: * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9: * @since 1.0
10: */
11:
12: // Exit if accessed directly.
13: if ( ! defined( 'ABSPATH' ) ) {
14: exit;
15: }
16:
17: /**
18: * Plugins row action links adapted from Easy Digital Downloads
19: *
20: * @author Michael Cannon <mc@aihr.us>
21: * @since 1.8
22: * @param array $links already defined action links.
23: * @param string $file plugin file path and name being processed.
24: * @return array $links
25: */
26: function epl_plugin_action_links( $links, $file ) {
27: $settings_link = '<a href="' . admin_url( 'admin.php?page=epl-settings' ) . '">' . esc_html__( 'General Settings', 'easy-property-listings' ) . '</a>';
28: if ( 'easy-property-listings/easy-property-listings.php' === $file ) {
29: array_unshift( $links, $settings_link );
30: }
31:
32: return $links;
33: }
34: add_filter( 'plugin_action_links', 'epl_plugin_action_links', 10, 2 );
35:
36: /**
37: * Plugin row meta links adapted from Easy Digital Downloads
38: *
39: * @author Michael Cannon <mc@aihr.us>
40: * @since 1.8
41: * @param array $input already defined meta links.
42: * @param string $file plugin file path and name being processed.
43: * @return array $input
44: */
45: function epl_plugin_row_meta( $input, $file ) {
46: if ( 'easy-property-listings/easy-property-listings.php' !== $file ) {
47: return $input;
48: }
49:
50: $links = array(
51: '<a href="' . admin_url( 'index.php?page=epl-getting-started' ) . '">' . esc_html__( 'Getting Started', 'easy-property-listings' ) . '</a>',
52: '<a href="https://www.easypropertylistings.com.au/extensions/?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin">' . esc_html__( 'Add Ons', 'easy-property-listings' ) . '</a>',
53: );
54:
55: $input = array_merge( $input, $links );
56:
57: return $input;
58: }
59: add_filter( 'plugin_row_meta', 'epl_plugin_row_meta', 10, 2 );
60: