Skip to content

Commit

Permalink
fix: error when using CPT on post form
Browse files Browse the repository at this point in the history
  • Loading branch information
sapayth committed Feb 20, 2024
1 parent 7b1718e commit cddac40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit cddac40

Please sign in to comment.