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

Listing status migration #1606

Merged
merged 64 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
4987a33
updated composer lock
obiPlabon Jul 27, 2022
6f4f103
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 1, 2022
77b8884
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 2, 2022
4f0d495
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 2, 2022
d020772
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 2, 2022
8fcd90b
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 3, 2022
86ba70a
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 8, 2022
d6e792c
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 18, 2022
4c2bb68
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 22, 2022
040527b
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 24, 2022
884ec5c
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 28, 2022
0364bef
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 30, 2022
9d271ca
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Sep 1, 2022
7b3e07b
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Sep 4, 2022
13b3545
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Oct 9, 2022
04648c1
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Nov 20, 2022
1483140
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Feb 8, 2023
9aef859
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Feb 19, 2023
40969d3
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Feb 22, 2023
5fcca17
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Feb 26, 2023
8d3ada0
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Mar 1, 2023
aad382d
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Mar 23, 2023
ab01506
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Mar 31, 2023
88112ca
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Apr 4, 2023
960ed08
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Apr 11, 2023
1af49d1
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Apr 12, 2023
19cefc5
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Apr 13, 2023
2c5b296
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon May 25, 2023
b90d3fe
Added listing status post meta to post status migration
obiPlabon May 29, 2023
7d90efe
Added expired post status
obiPlabon May 29, 2023
0fdf7eb
updated listing status related code
obiPlabon May 29, 2023
97bf15e
Updated expired status author listings query
obiPlabon May 29, 2023
a4280f7
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Jun 7, 2023
261bfb3
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Jun 15, 2023
5751877
Updated listing status meta to post status column
obiPlabon Jun 26, 2023
0f5ec3d
Migrated renewal post status from meta to post_status column
obiPlabon Jun 26, 2023
a6b1009
Updated status related cron functions
obiPlabon Jun 26, 2023
d14358c
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Jun 26, 2023
b65187f
Added renewal migration
obiPlabon Jun 27, 2023
0724b94
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Jul 27, 2023
0951cf7
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Jul 27, 2023
78389ed
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 2, 2023
49e1956
Fixed merge conflict
obiPlabon Aug 2, 2023
87ef739
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 6, 2023
e9fd9fb
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 6, 2023
b284029
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 20, 2023
ad0c37d
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Aug 24, 2023
4098ca6
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Sep 11, 2023
ef54569
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Sep 20, 2023
810f3f0
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Sep 25, 2023
725c4c0
Merge branch 'alpha' of github.com:sovware/directorist into alpha
obiPlabon Sep 26, 2023
fdc8bcc
Resolved conflict
obiPlabon Sep 26, 2023
e1a0f75
Updated migration function version
obiPlabon Sep 26, 2023
dc59a10
Merge branch 'alpha' into listing-status-migration
vairafiq Dec 14, 2023
4541ec4
Resolved conflict
obiPlabon Apr 4, 2024
4b63ef6
Updated migration function version
obiPlabon Apr 4, 2024
3561cb5
Resolved conflict
obiPlabon Apr 4, 2024
2ff2b25
Resolved conflict
obiPlabon Apr 4, 2024
8a14190
Merge conflict resolved with alpha
obiPlabon May 8, 2024
822e4e2
Cleanup never expire meta migration todo
obiPlabon May 8, 2024
77f3f2e
Refactored renewal listings
obiPlabon May 8, 2024
92e6717
Updated and fixed listing status incompatibility issues
obiPlabon May 10, 2024
3d3ed2d
Fixed backward compatibility with _listing_status CRUD operation
obiPlabon May 12, 2024
aa26262
Fixed meta get issue
obiPlabon May 12, 2024
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
16 changes: 7 additions & 9 deletions includes/classes/class-add-listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ public function atbdp_submit_listing() {
}

update_post_meta( $listing_id, '_featured', 0 );
// TODO: Status has been migrated, remove related code.
update_post_meta( $listing_id, '_listing_status', 'post_status' );

/*
Expand Down Expand Up @@ -931,9 +932,7 @@ public function parse_query( $query ) {
* @since 3.1.0
*/
private function renew_listing( $listing_id ) {
$can_renew = get_directorist_option( 'can_renew_listing' );

if ( ! $can_renew ) {
if ( ! directorist_can_user_renew_listings() ) {
return false;// vail if renewal option is turned off on the site.
}

Expand Down Expand Up @@ -963,8 +962,10 @@ private function renew_listing( $listing_id ) {

$directory_type = get_post_meta( $listing_id, '_directory_type', true );
// Update the post_meta into the database
$old_status = get_post_meta( $listing_id, '_listing_status', true );
if ( 'expired' == $old_status ) {
// TODO: Status has been migrated, remove related code.
// $old_status = get_post_meta( $listing_id, '_listing_status', true );
$old_status = get_post_status( $listing_id );
if ( 'expired' === $old_status ) {
$expiry_date = calc_listing_expiry_date();
} else {
$old_expiry_date = get_post_meta( $listing_id, '_expiry_date', true );
Expand All @@ -973,16 +974,13 @@ private function renew_listing( $listing_id ) {

// update related post meta_data
update_post_meta( $listing_id, '_expiry_date', $expiry_date );
// TODO: Status has been migrated, remove related code.
update_post_meta( $listing_id, '_listing_status', 'post_status' );

$exp_days = get_term_meta( $directory_type, 'default_expiration', true );
if ( $exp_days <= 0 ) {
update_post_meta( $listing_id, '_never_expire', 1 );
}
// TODO: Delete (refactored '_never_expire' for the sake of key comparison only).
// else {
// update_post_meta( $listing_id, '_never_expire', 0 );
// }

do_action( 'atbdp_after_renewal', $listing_id );
$r_url = add_query_arg( 'renew', 'success', ATBDP_Permalink::get_dashboard_page_link() );
Expand Down
Loading