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

Fixing undefined function and UI issue on "never expires" locks #30

Merged
merged 1 commit into from
Feb 27, 2024
Merged
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
4 changes: 2 additions & 2 deletions includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function pmprolml_show_extra_profile_fields($user) {
}
}

$lml_expiration = empty( $all_lock ) ? '' : date_i18n( 'Y-m-d 12:00:00', $all_lock['expiration'] );
$lml_expiration = ( empty( $all_lock ) || empty( $all_lock['expiration'] ) ) ? '' : date_i18n( 'Y-m-d 12:00:00', $all_lock['expiration'] );

//some vars for the dates
$current_day = date("j", current_time('timestamp'));
Expand Down Expand Up @@ -127,7 +127,7 @@ function pmprolml_save_extra_profile_fields( $user_id ) {

if ( empty( sanitize_text_field( $_POST['pmprolml'] ) ) ) {
// Delete the "all" lock for the user.
pmprolml_delete_lock( $user_id, 0 );
pmprolml_delete_lock_for_user( $user_id, 0 );
} else {
// Update the "all" lock for the user.
$expiration = empty( $_POST['lml_expiration'] ) ? 0 : strtotime( $_POST['lml_expiration_year'] . '-' . $_POST['lml_expiration_month'] . '-' . $_POST['lml_expiration_day'] . ' 12:00:00' );
Expand Down