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

    (@bcworkz)

    The Quick Draft widget doesn’t have any filters to hook, so you would have to create your own widget (copy the default with a new name to start) which can be added to the dashboard. Use the Screen Options to control which widget to show and which to not.

    Look at wp-admin/includes/dashboard.php for examples.

    Thread Starter Gloria

    (@erfo)

    I created a new function and added a select with post_author. It’s ok.

    There is a problem. When I write the quick draft and click on the “save draft” button, the fields are not cleared…

    The same thing happens when I copy the same code from dashboard.php and paste (I rename only the function, so the code is the same…).

    Moderator bcworkz

    (@bcworkz)

    Hmmm. This is new ground for me as well, I only saw the possibility, I have no practical experience with this.

    It appears the draft is posted via AJAX and part of the client side script clears the fields upon proper response from the server. The problem is the fields of the original Quick Draft widget are cleared, not yours.

    I’m unsure how to handle this, you could locate and modify the script, but your changes will be lost upon any update. You could add another event handler, but it will not see the proper server response. I suppose we could once again copy the script, renaming it, and cause it to load instead of or in addition to the original.

    The real problem is I’m not sure where the script is or how to cause our new version to be called. It may be in wp-admin/js/dashboard.js but I don’t see the part that clears fields. I’m very weak with jQuery 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add author dropdown to quick draft (dashboard)’ is closed to new replies.