PluginProbe
Cooked – Recipe Management / trunk
Cooked – Recipe Management vtrunk
1.16.0 1.15.0 trunk 1.10.0 1.11.0 1.11.1 1.11.2 1.11.3 1.11.4 1.12.0 1.13.0 1.14.0 1.7.10 1.7.11 1.7.12 1.7.13 1.7.15.1 1.7.15.3 1.7.15.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 All 36 releases
cooked / includes / class.cooked-plugin-extra.php

class.cooked-plugin-extra.php in Cooked – Recipe Management trunk, at includes/class.cooked-plugin-extra.php

36 lines 960 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Widgets
4 *
5 * @package Cooked
6 * @subpackage Widgets
7 * @since 1.8.8
8 */
9
10 // Exit if accessed directly
11 if ( ! defined( 'ABSPATH' ) ) exit;
12
13 class Cooked_Plugin_Extra {
14 public function __construct() {
15 add_action( 'plugin_action_links_cooked/cooked.php', [&$this, 'cooked_plugin_action_links_action'], 10, 1 );
16 }
17
18 /**
19 * Plugin Action Links Filter
20 *
21 * Adds a "Upgrade to Pro" link to the plugin list page.
22 *
23 * @since 1.8.8
24 * @param array $links
25 * @return array
26 */
27 function cooked_plugin_action_links_action( $links ) {
28 if (!class_exists( 'Cooked_Pro_Plugin')) {
29 return array_merge(['<a href="https://cooked.pro/get-cooked/" target="_blank">Upgrade to Pro</a>'], $links);
30 } else {
31 array_unshift($links, '<span style="color: #32373c">' . __( 'Required by Cooked Pro', 'cooked' ) . '</span>');
32 return $links;
33 }
34 }
35 }
36