Schedule uploaded post publication
This topic contains 10 replies, has 4 voices, and was last updated by Stiofan O’Connor 9 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: csv upload, posting, publication, schedule
-
AuthorPosts
-
April 8, 2015 at 11:34 am #36514
I’m uploading a large number of listings via CSV upload, but I want to hold these as drafts so I can publish them when I choose at a later date.
Is there a way to hold the uploaded listings as drafts? Mine are being sent live immediately without the ability to review them.
April 8, 2015 at 12:43 pm #36520Hello, theoretically this is possibile by adding a new column in the .csv, named post_status and filling this value with “draft”
April 8, 2015 at 9:45 pm #36593This didn’t work for me, it went straight to published. Also I was previously using a column called “post_status” for one of my own custom fields (now changed).
Is there any documentation for all of the columns Geodirectory may potentially be looking for (other than the ones in the dummy CSV file), just in case I might be using clashing column names for something else?
Also is it advised to follow the column order in the dummy CSV exactly, or does it not matter?
Should my own custom columns all go at the end?
April 9, 2015 at 4:00 pm #36661Hi Charlie,
I’m sorry I didn’t read your post before. The published status on CSV upload is hard coded in the funciton.
I’ve asked to the devs to add a new column in CSV file named “post_status” where users can set the draft status.
If post_status column is left blank status will remin published.
We’ll let you know when this is implemented.
Thanks
April 9, 2015 at 5:04 pm #36678Thanks for the info Paolo.
Could you tell me the name of that function? Maybe I could temporarily change the variable to set the uploads to draft?
April 9, 2015 at 5:39 pm #36681admin_functions.php, line 1800 and 1807
Thanks
April 9, 2015 at 7:11 pm #36704I’m using the latest version of Geodirectory v1.4.2. I think I found the code you were referring to between lines 1773 to 1786:
$my_post['post_title'] = $post_title; $my_post['post_content'] = $post_desc; $my_post['post_type'] = addslashes($buffer[5]); $my_post['post_author'] = $current_post_author; $my_post['post_status'] = 'draft'; $my_post['post_category'] = $catids_arr; $my_post['post_tags'] = $tag_arr; $gd_post_info['post_tags'] = $tag_arr; $gd_post_info['post_title'] = $post_title; $gd_post_info['post_status'] = 'draft'; $gd_post_info['submit_time'] = time(); $gd_post_info['submit_ip'] = $_SERVER['REMOTE_ADDR'];
As you can see above I changed ‘publish’ to ‘draft’. This didn’t work even after reinstalling all my Geodirectory plugins.
I then did a search of the plugin codebase and found the same block of code in admin_hooks_actions.php lines 1486 to 1498.
After also changing both of those references to ‘draft’ this has worked, with the uploaded listings being marked as ‘draft’ and without me having to reinstall anything!
By the way, the reason I want to do this is so I can schedule my listings to go live over an extended period of time using Drafts Scheduler plugin (https://wordpress.org/plugins/drafts-scheduler/). This is so Google hopefully judges my site as being regularly updated for improved SEO.
April 9, 2015 at 7:52 pm #36714Ok thanks for the good news,
keep in mind that, until we haven’t added this improvement, your mod will be removed after every update and we are about to release one.
Probably from the update after this you will find the new option.
Thanks
April 9, 2015 at 8:01 pm #36717Yeah sure no problem.
I can just make the change before I upload a batch of listings.
I just couldn’t wait for the update!
Also, after testing, the listing images didn’t show up on the draft when I previewed the listing. But they showed up fine once published. Someone will probably raise this as a bug when the feature goes live.
April 9, 2015 at 8:08 pm #36719Hi,
just FYI, isting preview only works when adding a listing using the front end form.
Thanks
April 10, 2015 at 11:18 am #36769Post status will be able to be changed from the CSV from the next version.
Stiofan
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket