lucwp1
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Job Manager] Listing Expiration date set by user from front endI have very little developing knowledge so I use trial and error to try work things out.
Progress:
When I remove the following code from above, it gives me the ability to add an expiry date to a listing.
if ( $package && ‘listing’ === $package->package_subscription_type ) {
update_post_meta( $object_id, ‘_job_expires’, ” ); // Never expire automatically
}So using WP Job Manager Field Editor, I created a new field called ‘expiry date’ using the meta key ‘job_expires’.
This works for editing the listing expiry date from the front end but does not work when submitting the initial listing – there is a setting that over rides this to either set the listing to not have an expiry date, or to expire the listing after a custom amount of days.
Some more questions:
1. Instead of removing the code to allow a listing to expire, Is there a better way of doing this such as a function that I can use in the function.php file in my child theme? (this way updating the plugin wont affect my functions)
2. What do I need to do to stop that setting from over riding the users input of the expiry date when posting the initial listing?Forum: Plugins
In reply to: [WP Job Manager] Listing Expiration date set by user from front endI found the following code in the plugin that prevents listings linked to subscriptions from expiring.
public function updated_post_meta( $meta_id, $object_id, $meta_key, $meta_value ) {
if ( ‘job_listing’ === get_post_type( $object_id ) && ” !== $meta_value && ‘_job_expires’ === $meta_key ) {
$_package_id = get_post_meta( $object_id, ‘_package_id’, true );
$package = wc_get_product( $_package_id );if ( $package && ‘listing’ === $package->package_subscription_type ) {
update_post_meta( $object_id, ‘_job_expires’, ” ); // Never expire automatically
}
}
}- This reply was modified 9 years, 5 months ago by lucwp1.
Forum: Plugins
In reply to: [WP Job Manager] Show Listing Expiry option in 'Add Listing' formHi There Dan,
I have WP Job Manager, WP Paid Listings, and WP Job Manager Field Editor.
I currently have my subscription packages linked to posted listings – meaning that the listings will expire at the end of the subscription term
I am running a website that does specials
What I need is for a client to be able to set the expiration date for a listed special. Then I can automatically notify the client to renew and update a listing when it becomes expired.
I still need to keep the functionality of the listings to expire at the end of the subscription term (example: client decides to cancel the subscription).
Could you please help me out with this?