PluginProbe
Additional Terms Lite for WooCommerce / trunk
Additional Terms Lite for WooCommerce vtrunk
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 trunk, at src/Compatibility/WooCommerce.php

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