We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket
Viewing 12 posts - 1 through 12 (of 12 total)
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketWe have moved to a support ticketing system and our forums are now closed.
Open Support TicketHi There,
We have two CPT that are linked together. We need the user to be able to link them prior to the primary listing being published and live. Is there some sort of coding we can add that allows the secondary CPT to be linked to the first CPT even though it’s not live?
Secondly, My solution for this was to auto-publish the primary listing but we use offline payment so it appears that even though it tries to ‘auto-publish’ it’s not publishing because payment hasn’t been marked as complete.
Anything you can think of that would help us accomplish this?
Thanks,
Sam
Hi Misty,
Thanks for your post. To link CPT’s, you can refer to this section of the documentation https://wpgeodirectory.com/docs-v2/addons/custom-post-types/#link . Let us know how it goes.
Thank you. We have them linked. The problem I’m having is that when the user submits one, it has to wait to be approved before they can then go to the 2nd CPT and link it to the first. I need the user to be able to connect the CPT and submit their listings before it’s approved.
This is the current flow:
– Submit 1 CPT
– Wait to be approved
– Submit 2nd CPT and select the first CPT to link to
I need to eliminate that middle step. I tried to set it to auto-approve but since payment isn’t complete since we do an offline payment, it doesn’t get approved and published so they’re unable to submit the 2nd CPT and link it to the first.
I need to be able to do one of two things:
– Either be able to auto-publish listings, regardless of payment
– Or, allow the 2nd CPT to link to pending listings from the 1st CPT
Have a look at the advanced settings of the packages, and change the publishing option to always publish.
Thanks
Yes, the packages are set to publish. I also have the settings in GeoDirectory to publish by default.
New listing default status: Published
Paid Listing Status: Published
Yet, still when the user submits the listings are pending.
Hi Misty,
Thanks for your reply. Could you supply your WP admin login URL here in private reply?
Yes, thank you.
Hello Misty,
Try following PHP snippet to link pending posts.
/**
*
* Allow to link pending posts.
*/
function gd_snippet_search_include_pending_posts( $where ) {
$search = "p.post_status = 'publish'";
$replace = "( p.post_status = 'publish' OR p.post_status = 'pending' )";
$where = str_replace( $search, $replace, $where );
return $where;
}
add_filter( 'geodir_cp_search_posts_query_where', 'gd_snippet_search_include_pending_posts', 20, 1 );
add_filter( 'geodir_cp_check_link_post_query', 'gd_snippet_search_include_pending_posts', 20, 1 );
Regards,
Kiran
Yes, that worked. Thank you Kiran!
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketGet the latest news, tips, and exclusive content directly in your inbox.
Confirm your email address, and instantly receive the discount code :)