diff --git a/changelog.txt b/changelog.txt index f74c6d6..e09ded6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ == Groups by itthinx - changelog.txt +2024-12-29 - version 3.4.1 +* Update - Declare WooCommerce HPOS compatibility. + 2024-12-26 - version 3.4.0 * Update - WordPress 6.7 compatible. * Dev - Security validation WordPress.DB.PreparedSQL.InterpolatedNotPrepared diff --git a/groups.php b/groups.php index 3cd73fd..dfb049f 100644 --- a/groups.php +++ b/groups.php @@ -21,7 +21,7 @@ * Plugin Name: Groups * Plugin URI: https://www.itthinx.com/plugins/groups * Description: Groups provides group-based user membership management, group-based capabilities and content access control. - * Version: 3.4.0 + * Version: 3.4.1 * Requires at least: 6.0 * Requires PHP: 7.4 * WC requires at least: 8.2 @@ -36,7 +36,7 @@ if ( !defined( 'ABSPATH' ) ) { exit; } -define( 'GROUPS_CORE_VERSION', '3.4.0' ); +define( 'GROUPS_CORE_VERSION', '3.4.1' ); define( 'GROUPS_FILE', __FILE__ ); if ( !defined( 'GROUPS_CORE_DIR' ) ) { define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); diff --git a/lib/extra/class-groups-extra.php b/lib/extra/class-groups-extra.php index 2fb3276..6dda325 100644 --- a/lib/extra/class-groups-extra.php +++ b/lib/extra/class-groups-extra.php @@ -28,6 +28,14 @@ */ class Groups_Extra { + /** + * Early actions. + */ + public static function boot() { + add_action( 'init', array( __CLASS__, 'init' ) ); + add_action( 'before_woocommerce_init', array( __CLASS__, 'before_woocommerce_init' ) ); + } + /** * Registers actions, filters ... */ @@ -47,6 +55,7 @@ public static function init() { * * @param boolean $visible * @param int $product_id + * * @return boolean */ public static function woocommerce_product_is_visible( $visible, $product_id ) { @@ -61,6 +70,7 @@ public static function woocommerce_product_is_visible( $visible, $product_id ) { * * @param string $where * @param int $post_id + * * @return string */ public static function groups_comment_access_comment_count_where( $where, $post_id ) { @@ -92,5 +102,17 @@ public static function groups_post_access_posts_where_query_get_post_types( $pos } return $post_types; } + + /** + * Declare WooCommerce feature compatibility. + * + * @since 3.4.1 + */ + public static function before_woocommerce_init() { + // HPOS + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', GROUPS_FILE, true ); + } + } } -add_action( 'init', array( 'Groups_Extra', 'init' ) ); +Groups_Extra::boot(); diff --git a/readme.txt b/readme.txt index fa0dba9..9872766 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: groups, access, access control, member, membership Requires at least: 6.0 Tested up to: 6.7 Requires PHP: 7.4 -Stable tag: 3.4.0 +Stable tag: 3.4.1 License: GPLv3 Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.