Skip to content

Commit

Permalink
Remove - Form visits count
Browse files Browse the repository at this point in the history
  • Loading branch information
iamprazol committed Jul 15, 2020
1 parent 3e977de commit 0080206
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
35 changes: 0 additions & 35 deletions includes/functions-ur-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1745,41 +1745,6 @@ function ur_falls_in_date_range( $target_date, $start_date = null, $end_date = n
}
}

/**
* Get count of form visits from Form ID.
*
* @param int $form_id Form ID.
*/
function user_registration_get_form_visits( $form_id ) {
$count_key = 'ur_form_views_count';
$count = get_post_meta( $form_id, $count_key, true );
if ( '' === $count ) {
delete_post_meta( $form_id, $count_key );
add_post_meta( $form_id, $count_key, '0' );
return '0';
}
return $count;
}

/**
* Set count of form visits from Form ID.
*
* @param int $form_id Form ID.
*/
function user_registration_set_form_visits( $form_id ) {
$count_key = 'ur_form_views_count';
$count = get_post_meta( $form_id, $count_key, true );

if ( '' === $count ) {
$count = 1;
delete_post_meta( $form_id, $count_key );
add_post_meta( $form_id, $count_key, $count );
} else {
$count++;
update_post_meta( $form_id, $count_key, $count );
}
}

/**
* Get Post Content By Form ID.
*
Expand Down
1 change: 0 additions & 1 deletion templates/form-registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
$custom_class = ur_get_form_setting_by_key( $form_id, 'user_registration_form_custom_class', '' );
$redirect_url = ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_redirect_options', '' );
$template_class = '';
user_registration_set_form_visits( $form_id );

if ( 'Bordered' === $form_template ) {
$template_class = 'ur-frontend-form--bordered';
Expand Down

0 comments on commit 0080206

Please sign in to comment.