Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // WP Fusion functionalit
- function set_listing_restrictions( $post_id, $post, $update ) {
- if ( $post->post_type == 'listing' && function_exists( 'wp_fusion' ) ) {
- $settings = array(
- 'lock_content' => true,
- 'allow_tags' => array( 'Listing - ' . $post_id ),
- 'redirect' => 6973,
- );
- update_post_meta( $post_id, 'wpf-settings', $settings );
- wp_fusion()->user->apply_tags( array( 'Listing - ' . $post_id ) );
- }
- }
- add_action( 'wp_insert_post', 'set_listing_restrictions', 10, 3 );
- function apply_tags_form_submission( $update_data, $user_id, $contact_id ) {
- $data = array(
- 'user_id' => $user_id,
- 'listing_id' => $_GET['list_id']
- );
- setcookie( 'wpf_nda', json_encode( $data ), time() + MINUTE_IN_SECONDS * 30, COOKIEPATH, COOKIE_DOMAIN );
- }
- add_action( 'wpf_gform_post_submission_3', 'apply_tags_form_submission', 10, 3 );
- add_action( 'wpf_gform_post_submission_7', 'apply_tags_form_submission', 10, 3 );
- add_action( 'wpf_gform_post_submission_8', 'apply_tags_form_submission', 10, 3 );
- function apply_tags_signature_saved( $args ) {
- error_log('sig saved ');
- error_log(print_r($args, true));
- if( ! function_exists( 'wp_fusion' ) ) {
- return;
- }
- if( isset( $_COOKIE['wpf_nda'] ) ) {
- $data = json_decode( stripslashes( $_COOKIE['wpf_nda'] ), true );
- error_log('got data');
- error_log(print_r($data, true));
- wp_fusion()->user->apply_tags( array( 'Listing - ' . $data['listing_id'] ), $data['user_id'] );
- }
- }
- add_action( 'esig_signature_saved', 'apply_tags_signature_saved' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement