Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filter to hide Membership Settings for Access Plans #2831

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions includes/admin/views/access-plans/access-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ class="llms-plan-price" name="_llms_plans[<?php echo esc_attr( $order ); ?>][pri
// Do we have any memberships to restrict this plan to?
$memberships_count = wp_count_posts( 'llms_membership' );
if ( $course && $memberships_count->publish > 0 ) :

/**
* Filter to show/hide the Membership Settings for an Access Plan for a course.
* @param boolean $show_membership_settings Show membership settings for access plans.
* @param LLMS_Access_Plan $plan LLMS_Access_Plan.
* @param integer $id Access Plan ID.
*/
if ( apply_filters( 'llms_show_membership_settings_for_access_plans', true, $plan, $id ) ) :
?>

<h4><?php esc_html_e( 'Membership Settings', 'lifterlms' ); ?></h4>
Expand Down Expand Up @@ -603,6 +611,7 @@ class="llms-plan-price" name="_llms_plans[<?php echo esc_attr( $order ); ?>][pri
</div>

<?php
endif;
endif;
?>

Expand Down