| 1 |
<?php |
| 2 |
namespace Kibo\PhastPlugins\PhastPress\Compat; |
| 3 |
|
| 4 |
class Ajax { |
| 5 |
const ACTIONS = [ |
| 6 |
'yith_load_product_quick_view', |
| 7 |
'flatsome_quickview', |
| 8 |
]; |
| 9 |
|
| 10 |
public function setup() { |
| 11 |
if (( |
| 12 |
defined('DOING_AJAX') |
| 13 |
&& DOING_AJAX |
| 14 |
&& defined('WP_ADMIN') |
| 15 |
&& WP_ADMIN |
| 16 |
&& isset($_REQUEST['action']) |
| 17 |
&& in_array($_REQUEST['action'], self::ACTIONS, true) |
| 18 |
) || ( |
| 19 |
isset($_GET['wc-ajax']) |
| 20 |
&& in_array($_GET['wc-ajax'], self::ACTIONS, true) |
| 21 |
&& class_exists(\WC_AJAX::class) |
| 22 |
)) { |
| 23 |
add_action('init', function () { |
| 24 |
phastpress_get_plugin_sdk()->getPhastAPI()->deployOutputBufferForSnippets(); |
| 25 |
}); |
| 26 |
|
| 27 |
return true; |
| 28 |
} |
| 29 |
|
| 30 |
return false; |
| 31 |
} |
| 32 |
} |
| 33 |
|