| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin Plugins |
| 4 |
* |
| 5 |
* @package AutomatorWP\Admin\Plugins |
| 6 |
* @author AutomatorWP <contact@automatorwp.com>, Ruben Garcia <rubengcdev@gmail.com> |
| 7 |
* @since 1.0.0 |
| 8 |
*/ |
| 9 |
// Exit if accessed directly |
| 10 |
if( !defined( 'ABSPATH' ) ) exit; |
| 11 |
|
| 12 |
/** |
| 13 |
* Plugins row action links |
| 14 |
* |
| 15 |
* @since 1.0.0 |
| 16 |
* |
| 17 |
* @param array $links Array of plugin action links |
| 18 |
* @param string $file Plugin file |
| 19 |
* |
| 20 |
* @return array $links |
| 21 |
*/ |
| 22 |
function automatorwp_plugin_action_links( $links, $file ) { |
| 23 |
|
| 24 |
if ( $file != 'automatorwp/automatorwp.php' ) |
| 25 |
return $links; |
| 26 |
|
| 27 |
$settings_link = '<a href="' . admin_url( 'admin.php?page=automatorwp_settings' ) . '">' . esc_html__( 'Settings', 'automatorwp' ) . '</a>'; |
| 28 |
|
| 29 |
array_unshift( $links, $settings_link ); |
| 30 |
|
| 31 |
return $links; |
| 32 |
|
| 33 |
} |
| 34 |
add_filter( 'plugin_action_links', 'automatorwp_plugin_action_links', 10, 2 ); |
| 35 |
|
| 36 |
|
| 37 |
/** |
| 38 |
* Plugin row meta links |
| 39 |
* |
| 40 |
* @since 1.0.0 |
| 41 |
* |
| 42 |
* @param array $input Array of plugin meta links |
| 43 |
* @param string $file Plugin file |
| 44 |
* |
| 45 |
* @return array $input |
| 46 |
*/ |
| 47 |
function automatorwp_plugin_row_meta( $input, $file ) { |
| 48 |
|
| 49 |
if ( $file != 'automatorwp/automatorwp.php' ) |
| 50 |
return $input; |
| 51 |
|
| 52 |
$links = array( |
| 53 |
'<a href="https://automatorwp.com/add-ons/">' . esc_html__( 'Add-ons', 'automatorwp' ) . '</a>', |
| 54 |
'<a href="https://automatorwp.com/docs/">' . esc_html__( 'Docs', 'automatorwp' ) . '</a>', |
| 55 |
'<a href="https://automatorwp.com/contact-us/">' . esc_html__( 'Support', 'automatorwp' ) . '</a>', |
| 56 |
); |
| 57 |
|
| 58 |
$input = array_merge( $input, $links ); |
| 59 |
|
| 60 |
return $input; |
| 61 |
} |
| 62 |
add_filter( 'plugin_row_meta', 'automatorwp_plugin_row_meta', 10, 2 ); |
| 63 |
|