From 32121fed884a4f84db7d7bad0533f2fd01b6760d Mon Sep 17 00:00:00 2001 From: maximilianoRicoTabo Date: Tue, 24 Sep 2024 18:39:21 -0300 Subject: [PATCH 1/2] * Remove members only option from dropdown --- includes/compatibility/lifterlms.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/includes/compatibility/lifterlms.php b/includes/compatibility/lifterlms.php index 0ae2fb45f0..c4399853da 100644 --- a/includes/compatibility/lifterlms.php +++ b/includes/compatibility/lifterlms.php @@ -655,3 +655,29 @@ function pmpro_maybe_remove_lifterlms_lostpassword_url_filter() { } } add_action( 'wp', 'pmpro_maybe_remove_lifterlms_lostpassword_url_filter' ); + +/** + * Remove Members-only from Access Plan -> Plan availability dropdown. + * + * @param LLMS_Access_Plan $plan The access plan object. + * @param int $id The post ID. + * @param LLMS_Order $order The order object. + * @since TBD + * return void + */ +function custom_llms_access_plan_mb_after_body( $plan, $id, $order ) { + // Bail if streamline is not enabled. + if ( ! get_option( 'pmpro_lifter_streamline' ) ) { + return; + } + ?> + + + Date: Fri, 24 Jan 2025 16:58:35 -0300 Subject: [PATCH 2/2] * Use new llms_show_membership_settings_for_access_plans filter to manage plan availability dropdown visibility --- includes/compatibility/lifterlms.php | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/includes/compatibility/lifterlms.php b/includes/compatibility/lifterlms.php index c4399853da..8440a08efc 100644 --- a/includes/compatibility/lifterlms.php +++ b/includes/compatibility/lifterlms.php @@ -657,27 +657,13 @@ function pmpro_maybe_remove_lifterlms_lostpassword_url_filter() { add_action( 'wp', 'pmpro_maybe_remove_lifterlms_lostpassword_url_filter' ); /** - * Remove Members-only from Access Plan -> Plan availability dropdown. + * Remove Plan availability dropdown from Lifter's access plan settings. * - * @param LLMS_Access_Plan $plan The access plan object. - * @param int $id The post ID. - * @param LLMS_Order $order The order object. + * @return bool False to remove the dropdown, true to keep it. * @since TBD - * return void */ -function custom_llms_access_plan_mb_after_body( $plan, $id, $order ) { - // Bail if streamline is not enabled. - if ( ! get_option( 'pmpro_lifter_streamline' ) ) { - return; - } - ?> - - -