Schedule uploaded post publication

This topic contains 10 replies, has 4 voices, and was last updated by  Stiofan O’Connor 9 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #36514

    charlievaughan
    Lifetime Member
    Post count: 70

    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.

    #36520

    Simone
    Expired Member
    Post count: 3515

    Hello, theoretically this is possibile by adding a new column in the .csv, named post_status and filling this value with “draft”

    #36593

    charlievaughan
    Lifetime Member
    Post count: 70

    This 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?

    #36661

    Paolo
    Site Admin
    Post count: 31206

    Hi 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

    #36678

    charlievaughan
    Lifetime Member
    Post count: 70

    Thanks 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?

    #36681

    Paolo
    Site Admin
    Post count: 31206

    admin_functions.php, line 1800 and 1807

    Thanks

    #36704

    charlievaughan
    Lifetime Member
    Post count: 70

    I’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.

    #36714

    Paolo
    Site Admin
    Post count: 31206

    Ok 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

    #36717

    charlievaughan
    Lifetime Member
    Post count: 70

    Yeah 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.

    #36719

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    just FYI, isting preview only works when adding a listing using the front end form.

    Thanks

    #36769

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Post status will be able to be changed from the CSV from the next version.

    Stiofan

Viewing 11 posts - 1 through 11 (of 11 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount