WordPress.org

Ready to get started?Download WordPress

Forums

editing timestamps as user level < 5 ?? (6 posts)

  1. zweetsmoel
    Member
    Posted 9 years ago #

    hello, a blog member of the wordpress blog i run just found out it is impossible to edit timestamps. he has user level 3. on the user level page i read that only user level 5 can edit the timestamps. this is actually a major drawback. how should people post in the future? i mean, most people on the blog write several articles at once that will be published during the next days. this means they will need to edit the timestamps (or is there any other way to make sure articles can be published in the future?). the alternative is to give everyone level 5 which i really do not want to do because of security. any suggestions?
    regards,

  2. carthik
    Member
    Posted 9 years ago #

    Open wp-admin/edit-form-advanced.php in your favourite text editor.
    change:
    if ($user_level > 4) {
    touch_time(($action == 'edit'));
    }

    to read
    if ($user_level > 1) {
    touch_time(($action == 'edit'));
    }

    This will lead to users with level 2 and above to update the timestamp.

  3. carthik
    Member
    Posted 9 years ago #

    Alright, so now we have to edit wp-admin/admin-functions.php.
    Edit the first few lines of function touch_time() in that file to look as follows:

    function touch_time($edit = 1) {
    global $month, $postdata;
    // echo $postdata['Date'];
    if ('draft' == $postdata->post_status) {
    $checked = 'checked="checked" ';
    } else {
    $checked = ' ';
    }

    Now you can edit the timestamp for draft posts as well.
    There must be a reason why it's behaving the way it is. I will check this with someone who should know better than me. This fix will work for you.

  4. zweetsmoel
    Member
    Posted 9 years ago #

    ok, i will check this out. brb. thanks a lot for your time!
    reg,

  5. Anonymous
    Unregistered
    Posted 9 years ago #

    ok, this works but only after editing post.php as well
    what i did was:
    1. changed user_level 4 to 1 in edit-form-advanced.php
    if ($user_level > 1) {
    touch_time(($action == 'edit'));
    2. changed user_level 4 to 1 in post.php
    if (($user_level > 1) && (!empty($_POST['edit_date']))) {
    3. your instructions for admin-functions.php
    function touch_time($edit = 1) {
    global $month, $postdata;
    // echo $postdata['Date'];
    if ('draft' == $postdata->post_status) {
    $checked = 'checked="checked" ';
    } else {
    $checked = ' ';
    }
    but i'm not sure all 3 steps are needed in order to make wordpress behave like i wanted :) . but it works fine now over here. users with level > 1 can edit the timestamp and use a date in the future.
    many many thanks.
    regards

  6. carthik
    Member
    Posted 9 years ago #

    You're welcome. I had thought the user levels were already set to a one, my apologies for not having pointed that out earlier.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.