• Hi !
    I would like to add a « mine » status on the post menu on the admin interface.
    I only found hack to hide others’ post for editors but nothing that I can adapt to my needs.
    Any idea ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m not sure I understand. You want to add another post status in addition to the default draft, publish, future, trash, etc? You could, but you’ll need custom queries for anything related to this new status.

    Or do you just want to and another column to the posts table to indicate which posts are yours? Wouldn’t the author column work for this? Anyway, you can add custom columns if you want.

    Or something else entirely? More information on the intended purpose would help me understand what you really want.

    Thread Starter Diraen

    (@diraen)

    thanks !

    Yes, I want to add another post status in addition to the default draft, publish, future, trash, etc.

    It will just allow user to see, in one click, their own posts

    Edit : I found something which looks like a patch but I’m not sure it still work with WordPress 3.6.
    (I tried it and nothing happened)
    http://core.trac.ww.wp.xz.cn/ticket/19609

    Moderator bcworkz

    (@bcworkz)

    The patch doesn’t work because the line numbers changed. You could manually apply the patch, but changing core files is a bad idea anyway. A possible “clean” way to achieve this is to use jQuery to add the filter pick if it does not already exist.

    If all you want is for editors and admins to see only their own posts, adding another post status is not the way to achieve this. If the jQuery idea does not work out, you could add another table view page to the Post admin menu that only shows the user’s own posts if the user is an admin or editor. Not as simple as applying a patch, but there is a lot to be said for not altering core files.

    Thread Starter Diraen

    (@diraen)

    Please, what is the process to follow to use jQuery ?

    Moderator bcworkz

    (@bcworkz)

    Determine what HTML needs to be added to the filter dropdown container in order to add the pick for one’s own posts. I’m assuming this option shows up for authors, just not editors and admins, so the script that processes the form submits will know what to do with this extra pick. I would typically investigate this myself before suggesting an approach, but I currently cannot access my test installation.

    Write a jQuery script that, once the document loads, checks the dropdown container for this pick already existing and if not, go ahead and add it. This script needs to be enqueued so that it is loaded with the posts table screen and jQuery dependencies are properly handled.

    As I implied, this is just an idea that occurred to me, I can’t be sure it will actually work, but I believe the chances are good enough that it’s worth a try.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hack the status post menu’ is closed to new replies.