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

fix: error when using CPT on post form #1442

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion includes/Admin/Forms/Field_Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function check_field_visibility( &$form_field ) {
}
}
if ( $visibility_selected == 'subscribed_users' && is_user_logged_in() ) {
$user_pack = Subscription::init()->get_user_pack( get_current_user_id() );
$user_pack = ( new Subscription() )->get_user_pack( get_current_user_id() );
if ( empty( $visibility_choices ) && ! empty( $user_pack ) ) {
$show_field = true;
} else if ( ! empty( $user_pack ) && ! empty( $visibility_choices ) ) {
Expand Down
3 changes: 2 additions & 1 deletion includes/Traits/TaxableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use WC_Countries;
use WC_Customer;
use WeDevs\Wpuf\Admin\Forms\Form;
use WeDevs\Wpuf\Admin\Subscription;
use WeDevs\Wpuf\Data\Country_State;

trait TaxableTrait {
Expand Down Expand Up @@ -440,7 +441,7 @@ function wpuf_calculate_taxes( $post_data ) {

if ( isset( $post_data['type'] ) && isset( $post_data['id'] ) ) {
if ( 'pack' === $post_data['type'] ) {
$pack = Subscription::init()->get_subscription( $post_data['id'] );
$pack = ( new Subscription() )->get_subscription( $post_data['id'] );
$billing_amount = $pack->meta_value['billing_amount'];
$user_id = $current_user->ID;
} elseif ( 'post' === $post_data['type'] ) {
Expand Down
Loading