-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp-stateless-wpforms-addon.php
More file actions
30 lines (26 loc) · 1.04 KB
/
wp-stateless-wpforms-addon.php
File metadata and controls
30 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* Plugin Name: WP-Stateless - WPForms Addon
* Plugin URI: https://stateless.udx.io/addons/wpforms/
* Description: Provides compatibility between the WPForms and the WP-Stateless plugins.
* Author: UDX
* Version: 0.0.2
* Text Domain: wp-stateless-wpforms-addon
* Author URI: https://udx.io
* License: GPLv2 or later
*
* Copyright 2024 UDX (email: info@udx.io)
*/
namespace SLCA\WPForms;
add_action('plugins_loaded', function () {
if (class_exists('wpCloud\StatelessMedia\Compatibility')) {
require_once ( dirname( __FILE__ ) . '/vendor/autoload.php' );
// Load
return new WPForms();
}
add_filter('plugin_row_meta', function ($plugin_meta, $plugin_file, $_, $__) {
if ($plugin_file !== join(DIRECTORY_SEPARATOR, [basename(__DIR__), basename(__FILE__)])) return $plugin_meta;
$plugin_meta[] = sprintf('<span style="color:red;">%s</span>', __('This plugin requires WP-Stateless plugin version 3.4.0 or greater to be installed and active.', 'wp-stateless-wpforms-addon'));
return $plugin_meta;
}, 10, 4);
});