PluginProbe
Additional Terms Lite for WooCommerce / 1.6.0
Additional Terms Lite for WooCommerce v1.6.0
1.7.3 1.7.2.1 trunk 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.6.3 All 35 releases
woo-additional-terms / src / Compatibility / WooCommerce.php

WooCommerce.php in Additional Terms Lite for WooCommerce 1.6.0, at src/Compatibility/WooCommerce.php

66 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Add compatibility with WooCommerce (core) features.
4 *
5 * @author MyPreview (Github: @mahdiyazdani, @gooklani, @mypreview)
6 *
7 * @since 1.5.0
8 *
9 * @package woo-additional-terms
10 */
11
12 namespace Woo_Additional_Terms\Compatibility;
13
14 use Automattic\WooCommerce\Utilities\FeaturesUtil;
15
16 /**
17 * WooCommerce Compatibility class.
18 */
19 class WooCommerce {
20
21 /**
22 * Constructor method.
23 *
24 * @since 1.5.0
25 *
26 * @return void
27 */
28 public function setup() {
29
30 add_action( 'before_woocommerce_init', array( $this, 'add_block_editor_compatibility' ) );
31 add_action( 'before_woocommerce_init', array( $this, 'add_hpos_compatibility' ) );
32 }
33
34 /**
35 * Declaring compatibility with product block editor.
36 *
37 * Despite being unrelated to the "Product Block Editor,"
38 * a compatibility flag has been added to prevent WooCommerce from labeling it as "uncertain."
39 *
40 * @since 1.6.0
41 *
42 * @return void
43 */
44 public function add_block_editor_compatibility() {
45
46 // Declare compatibility with product block editor.
47 FeaturesUtil::declare_compatibility( 'product_block_editor', woo_additional_terms()->service( 'file' )->plugin_file() );
48 }
49
50 /**
51 * Declaring compatibility with HPOS.
52 *
53 * This plugin has nothing to do with "High-Performance Order Storage".
54 * However, the compatibility flag has been added to avoid WooCommerce declaring the plugin as "uncertain".
55 *
56 * @since 1.5.0
57 *
58 * @return void
59 */
60 public function add_hpos_compatibility() {
61
62 // Declare compatibility with HPOS.
63 FeaturesUtil::declare_compatibility( 'custom_order_tables', woo_additional_terms()->service( 'file' )->plugin_file() );
64 }
65 }
66