Forum Replies Created
-
AuthorPosts
-
Hi here’s the link to the code
https://github.com/colingell/bulkdelete
It has two files: eventuploadform.php – this is the one where I don’t seem to be able to pull the $package_days_amount field from the ‘package’ post type, and save it as ‘$package_days_amount_event’
The second file is the one that generates the $package_days_amount field it also allows me to manually update the $package_days_amount_event field from the backend of wordpress, and in this regard it works perfectly.
I don’t have any error records showing for either of the above files, it’s just that eventuploadform.php doesn’t seem to update the sql database with the $package_days_amount_event field
-
Note my code above didn’t work
-
This is what I’ve tried inside the foreach loop:
$package_days_amount_event = get_post_meta($td_slot_id, ‘package_days_amount’, true);
if ( $package_days_amount == ‘1’ ) {
update_post_meta( $post_id, ‘package_days_amount_event’, ‘1’ );
}
if ( $package_days_amount == ‘7’ ) {
update_post_meta( $post_id, ‘package_days_amount_event’, ‘7’ );
}
if ( $package_days_amount == ’14’ ) {
update_post_meta( $post_id, ‘package_days_amount_event’, ’14’ );
}
if ( $package_days_amount == ’30’ ) {
update_post_meta( $post_id, ‘package_days_amount_event’, ’30’ );
}
if ( $package_days_amount == ‘forever’ ) {
update_post_meta( $post_id, ‘package_days_amount_event’, ‘forever’ );
}
else {
//do nothing
} -
Hi Sudar,
That did work by the way I was wondering if you could help with some of the complicated php stuff???
I have custom post type called ‘package’
These have a foreach loop setup with the following:
$transaction_package_id = $key->package_id;and inside that we have a custom field called: ‘package_days_amount’ ‘$package_days_amount’
What we are trying to do is pull the value of the above, and put them into another custom post type called ‘events’
into some other custom fields called:
‘package_days_amount’ ‘$package_days_amount’This is the complicated stuff that i’m struggling with but you might find easy :/ ???
-
AuthorPosts