QuickPress category, need hooks

  1. Mark / t31os


    Wanted to follow on from this previous idea regarding adding category selection to QuickPress.


    Although the callback function for the QuickPress can currently be changed via a dashboard setup filter, it does have one inherent problem, and that's with post.php which deals with saving data submitted via QuickPress.

    Once a post is made, there is a hard-coded call to the original callback function.


    Meaning it's impossible to re-use any new callback function without first reloading the dashboard page. What essentially happens is that the original function is called once a submission has happened (so if like me you write a modified version of the original widget function, it will just look like the category dropdown has disappeared, when in effect it hasn't, it's just called the original function instead).

    No hooks available in post.php to change the hard-coded quickpress call, but you mentioned that changes were likely to be made to accomodate extra functionality. Using 3.0 beta1 and there's been no change to help in this area at all as far i can tell (i wasn't expecting it though, not with custom post types and the MU merge on the horizon).

    Now i guess there may be a few wondering why we can't simply unregister the widget and register a new one, that does the same thing... ahhhh, problem, see post.php , sending the quickpress save action invokes the hard-coded call to the original widget.

    I'm not sure what the solution is, but thought i'd re-air the subject to see how much traction can be gained on moving toward better control of the dashboard widgets, well namingly the quickpress widget, or whether anyone could offer some suggestions on solving this problem(i couldn't find any way to get a reference of the dashboard widgets to know where to start for a patch for this).

    Here's a thread i started that ties in with the above points.

    Posted: 9 years ago #
  2. Anointed


    a HUGE +1 on this feature addition!

    Posted: 9 years ago #
  3. namnum

    +1 +1 +1 +1 +1 :)

    Posted: 9 years ago #
  4. Mayur Jobanputra

    Nom Nom. This feature would be a treat! +1+1+1+1+1

    Posted: 9 years ago #

  5. Inactive

    Actually, I have found a workaround for the category selection being disappeared after post save.It worked for me. Let me know if it works for you guys too.

    function __quickpress_cats() {
    	if(!function_exists('is_admin') || !is_admin()) return;
    	// Parameters for wp_dropdown_categories
    	$args = array(
    		'order' => 'ASC',
    		'hierarchical' => 1,
    		'echo' => 0,
    		'name' => 'post_category[]',
    		'hide_empty' => 0
    	$select_cats = wp_dropdown_categories( $args );
    	echo '
    	<h4 id="category-label"><label for="post_category">Category</label></h4>
    	<div class="hide-if-no-js" style="margin: 0 0 .5em 5em;padding:8px 10px 5px 5px;">
    if(is_admin() || $query->is_admin) {
    	$here = array( basename($_SERVER['REQUEST_URI']), basename($_SERVER['SCRIPT_FILENAME']) );
    	 	if( ( $here[0] == 'index-extra.php?jax=dashboard_quick_press'  || $here[0] ==  'post.php') && ( $here[1] == 'index-extra.php'  || $here[1] == 'post.php') ) {
    Posted: 8 years ago #
  6. Travis Pflanz

    This code great!

    I'm glad I stumbled upon it.

    Added the code to my functions.php and it worked perfectly.

    I would still like to see it implemented natively into WP, though.

    Posted: 8 years ago #
  7. Great Code and great idea man, i take it :) good idea for the wp_dashboard_quick_press();

    Posted: 8 years ago #
  8. i love this code!!!
    +1 +1 +1 +1 +1 +! :)

    Posted: 7 years ago #
  9. Ruude4s


    Love this functionality. Doesn't seem to work for 3.3 though. Tried both the version of Mark / t31os and Webgig. Hope this will be implemented soon.

    Posted: 7 years ago #
  10. asdevo


    Hey, this would be a really useful option! Why wasn't it implemented until now? The ticket is about two years old. Please consider implementing this feature in the next versions of wordpress.

    Posted: 7 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    21 Votes
  • Status

    This idea is under consideration