0

We've been told that:

The quick_edit_custom_box action hook will not fire unless there are custom columns present. (Source^)

If so, then adding a custom field edit functionality to the Quick Edit panel needs a Custom Field column first.

It's hard to believe for me. Because there are certain fields in the Quick Edit panel that isn't present in any of that posts column, like the "Make this post sticky" checkbox. Quick Edit Panel

I'm not dealing with any custom post types of custom taxonomy. I just implemented 3 individual custom fields from the Add New Post panel using 3 drop downs: Input Box

Translation: The free translation of the Bangla texts here says: You can choose where you want to show the news. Neither of the field is mandatory.

And I queried them three in the Posts List display page with 3 individual query like this:

add_action('manage_posts_custom_column', 'news_column', 10, 2);

function news_column($column_name, $id) {
    if ( $column_name == 'news-box' ) {
        global $wpdb;
        $featuredQuery = 'SELECT meta_value
                        FROM ' . $wpdb->prefix . 'postmeta
                        WHERE meta_key="featured"
                        AND post_id=' . $id;
        $scrollQuery = 'SELECT meta_value
                        FROM ' . $wpdb->prefix . 'postmeta
                        WHERE meta_key="scrollnews"
                        AND post_id=' . $id;
        $breakingQuery = 'SELECT meta_value
                        FROM ' . $wpdb->prefix . 'postmeta
                        WHERE meta_key="breakingnews"
                        AND post_id=' . $id;

        $resultFeatured = $wpdb->get_results($featuredQuery, ARRAY_A);
        $resultScroll = $wpdb->get_results($scrollQuery, ARRAY_A);
        $resultBreaking = $wpdb->get_results($breakingQuery, ARRAY_A);
        if ( isset($resultFeatured[0]) && ($resultFeatured[0]['meta_value'] == '1')) { ?>
            <img src="<?php echo bloginfo( 'template_url'); ?>/images/icon-1st.png" title="<?php _e( 'শীর্ষ খবর', TEXTDOMAIN) ?>"/><br/>
        <?php }
        if ( isset($resultScroll[0]) && ($resultScroll[0]['meta_value'] == '1')) { ?>
            <img src="<?php echo bloginfo( 'template_url'); ?>/images/icon-scroll.png" title="<?php _e( 'তাজা খবর', TEXTDOMAIN) ?>"/><br/>
        <?php }
        if ( isset($resultBreaking[0]) && ($resultBreaking[0]['meta_value'] == '1')) { ?>
            <img src="<?php echo bloginfo( 'template_url'); ?>/images/icon-breaking.png" title="<?php _e( 'ব্রেকিং নিউজ', TEXTDOMAIN) ?>"/>
        <?php }
    }
}

So I made them three visible in a single column to make them a bit sorted out for the admin/editor.
post listed custom fields in a single column

In that case:

  • If "Sticky Post" checkbox can be enabled without any column, then why not I can add a custom field edit box or checkbox into the Quick Edit column without their individual column?
  • Do I have to make their individual column to add them to the Quick Edit screen?
  • 1
    Items like the stick post are hardcoded in the WordPress file if I recall correctly. If you want to add fields to the custom bulk/quick editor, then you need to add columns. The reason being is that column cell is what's read by the JavaScript you'll need to write to populate the quick edit field. Search for "WordPress plugin Custom Bulk/Quick Editor" and check out that source code for more details in creating your own editor or use that plugin. ;) – Michael Cannon Jan 24 '14 at 7:38
  • 1
    No, you dont need to create an extra column for quick edit or bulk edit facility. Just need to call it in Theme functions/custom functions file or where every you have written this code. This will help you. Read the post – Neer Feb 20 '14 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.