WordPress.org

Ready to get started?Download WordPress

Ideas

QuickPress category, need hooks

  1. Sasa Karanovic
    Member

    12345

    If you want to have categories drop-down menu when using quick press but also to have them AFTER you publish the post add this code to your functions.php file. It's almost just like the webgig's code but with minor adjustments :)

    Enjoy!


    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 '
    </div>
    <h4 id="category-label"><label for="post_category">Category</label></h4>
    <div>
    '.$select_cats.'
    </div>
    <div class="hide-if-no-js" style="margin: 0 0 .5em 5em;padding:8px 10px 5px 5px;">
    ';
    return;
    }
    if(is_admin() || $query->is_admin) {
    $here = array( basename($_SERVER['REQUEST_URI']), basename($_SERVER['SCRIPT_FILENAME']) );</p>
    <p> if( ( $here[0] == ('index.php' || 'wp-admin' || 'post.php' || 'index-extra.php' || 'index-extra.php?jax=dashboard_quick_press')) && ( $here[1] == ('index.php' || 'post.php') ) ) {
    add_action('media_buttons','__quickpress_cats');
    }
    unset($here);
    }

    Posted: 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    21 Votes
  • Status

    This idea is under consideration