how to set default to "publish" (15 posts)

  1. emsdc
    Posted 12 years ago #

    I'd like to set the default post status to publish. I found this line in edit-form-advanced.php:
    if (empty($post_status)) $post_status = 'draft';
    Changing it to $post_status = 'publish' doesn't seem to affect the default, though.

  2. Mark (podz)
    Support Maven
    Posted 12 years ago #

    It's here as well as somewhere else ..
    add this to your blog address:

  3. Anonymous
    Posted 12 years ago #

    I checked options.php?option_group_id=all, and my default post status was set to "publish". But when I go to post.php and go to "write," the post status is set on "draft."
    To make sure this isn't the result of some modification I made to post.php or edit-form-advanced.php, I restored the originals from wordpress.org. It didn't help. Post status is still defaults to draft.

  4. emsdc
    Posted 12 years ago #

    eek. Didn't mean to post that as anonymous. That's my post up there. Forgot to log in.

  5. emsdc
    Posted 12 years ago #

    actually, it looks like now the default is indeed set to "publish", but this isn't reflected in the form at post.php.
    In other words, the entries are being published, but "draft" is checked in the "write" form.

  6. Kelso
    Posted 11 years ago #

    I figured it out!! :)
    Try a search for "$post_status" in the post.php file as well
    Near line 740 should be where the answer lies 8)

  7. Kelso
    Posted 11 years ago #

    After all this, nobody wants to actually have they Admin Panel set to Publish by default (and not just "pretend" default)?

  8. Anonymous
    Posted 11 years ago #

    FWIW, it is REALLY hard to find the documentation of how to change the post status. This discussion did not come up in like 4 different searches on related keywords -- probably because the search function seems to only display 5 results (<----a really bad idea).
    Also, this "wp-admin/options.php?option_group_id=all", thing, which I haven't known about despite having had a WP blog for almost a year now-- why is there not an intuitive way to get that page?
    And why in the world is it so damn hard to switch the default status to "publish"? It's very frustrating. I don't know who the genius was who decided that "draft" was a good default (and that it should require devoted searching and more to change that), but that person should be relegated to a different set of tasks.

  9. Anonymous
    Posted 11 years ago #

    OK, I think I found why "draft" was so persistent. This may be the 'line 740 thing Kelso mentioned, but it's nowehere near line 740 in my post.php.
    Starting at line 2224, there is this block of code:
    //set defaults
    $post_status = 'draft';
    $comment_status = get_settings('default_comment_status');
    $ping_status = get_settings('default_ping_status');
    $post_pingback = get_settings('default_pingback_flag');
    $default_post_cat = get_settings('default_post_category');
    It seems weird that all the other default settings here use a "get_settings" thing, while the default post status is hardcoded. This is a bug, no? Indeed, if I change the above to "publish", and then go to the super-secret All Options page and change the default to "draft", it continues to show "publish" when I go to the new entry page.
    Methinks that line should be:
    $post_status = get_settings('default_post_status');
    instead of
    $post_status = 'draft';
    And that seems to work. Now when I change the default post status on the super secret options page, the change is reflected on the new post page.
    I think this needs to be fixed in the release version.
    Can you also pretty please include a link to that all options page within the normal WP options links? It is by no means intuitive how to change the default post status. It's whatever the opposite of "intuitive" is. Thanks.

  10. Kelso
    Posted 11 years ago #

    Glad you figured it out :)

  11. TechGnome
    Posted 11 years ago #

    prez2008 wrote - It seems weird that all the other default settings here use a "get_settings" thing, while the default post status is hardcoded. This is a bug, no?
    I'm glad I'm not the only one who thinks so. I tried to get this "fixed" a while back and was basically shut down. According to the devs, it isn't a bug, but by design (bad design if you ask me.) You can see the result of the aftermath here: http://mosquito.wordpress.org/view.php?id=64

  12. thepete
    Posted 11 years ago #

    Um, OK, I changed three things on the super secret options page and now my site won't load. I switched those three things back and my site still won't load. Any chance I could get a hand with this?

    FYI: I changed default_category to nothing and then back to 1
    I changed default_post_category to nothing and then back to 1
    I changed time_difference to -2 because I am in Pacific while my server is in Central. However, I also switched this back to it's original value: "0"

    So, any takers on this one? Basically my site is down and I don't know why. If I don't here anything in an hour or so, I'll post this in its own thread. I hope no one minds. Thanks.

  13. thepete
    Posted 11 years ago #

    OK, well, I sussed the problem. I'd personally like to thank podz for not warning us that when you save your changed options on the super secret options page (at least in WP 1.2.2), it deactivates all of your plugins except the one in the very top field.

    Thanks for the heart attack, guy! There's nothing to test the old ticker like watching your site throw one php error after after another at you, thus stopping the proper loading of your site.

    I'm not mad, just annoyed... all is fine now, though. Just podz, please mention what happened to me the next time you tell someone about the super secret options page, please? Thanks.

    Sorry, it didn't rain, it poured on me today and this was not what I needed at the end of it...

  14. shacker
    Posted 10 years ago #

    Note that in WP2 this option seems to have been moved to line 288 of admin-functions.php. Why there is no checkbox option to let the user choose their own preferred default is beyond me.

  15. Alex Mills (Viper007Bond)
    Posted 10 years ago #

    Just click the "Publish" button rather than "Save". That will publish it even if the radio button is set to draft...

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.