palsushobhan

free membership cancel button

Jan 1st, 2025
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.84 KB | None | 0 0
  1. add_action('after_wcfm_vendors_manage_membership_details', function($vendor_id) {
  2.     $wcfm_membership_id = get_user_meta( $vendor_id, 'wcfm_membership', true );
  3.     if( $wcfm_membership_id && wcfm_is_valid_membership( $wcfm_membership_id ) ) {
  4.         $subscription = (array) get_post_meta( $wcfm_membership_id, 'subscription', true );
  5.         if( isset( $subscription['is_free'] ) ) {
  6.             echo "<div class='wcfm_clearfix'></div><br />";
  7.             _e( 'Cancel vendor membership: ', 'wc-multivendor-membership' );
  8.             echo '<a href="#" style="float: none; padding: 10px !important;" data-memberid="'.esc_attr($vendor_id).'" data-membershipid="'.esc_attr($wcfm_membership_id).'" id="wcfm_membership_cancel_button" class="wcfm_membership_cancel_button wcfm_submit_button">' . esc_html__( 'Cancel', 'wc-multivendor-membership' ) . '</a>';
  9.             echo "<div class='wcfm_clearfix'></div><br />";
  10.         }
  11.     }
  12. });
  13.  
  14. add_action('wcfm_after_membership_pricing_details', function($vendor_id) {
  15.     $wcfm_membership_id = get_user_meta( $vendor_id, 'wcfm_membership', true );
  16.     if( $wcfm_membership_id && wcfm_is_valid_membership( $wcfm_membership_id ) ) {
  17.         $subscription = (array) get_post_meta( $wcfm_membership_id, 'subscription', true );
  18.         if( isset( $subscription['is_free'] ) ) {
  19.             echo "<div class='wcfm_clearfix'></div><br />";
  20.             _e( 'Cancel vendor membership: ', 'wc-multivendor-membership' );
  21.             echo '<a href="#" style="float: none; padding: 10px !important;" data-memberid="'.esc_attr($vendor_id).'" data-membershipid="'.esc_attr($wcfm_membership_id).'" id="wcfm_membership_cancel_button" class="wcfm_membership_cancel_button wcfm_submit_button">' . esc_html__( 'Cancel', 'wc-multivendor-membership' ) . '</a>';
  22.             echo "<div class='wcfm_clearfix'></div><br />";
  23.         }
  24.     }
  25. });
Add Comment
Please, Sign In to add comment