• Resolved tugbucket

    (@tugbucket)


    So I was trying out: https://wordpress.org/plugins/admin-columns-for-acf-fields/

    I added a toggle to admin columns and in posts, pages, my own custom taxonomy and even WooCommerce product view, my toggle shows in the quick edit and the value displays in it’s own column.

    In Food Items, it shows in the quick edit but not on it’s on admin column.

    Yes I know it’s a third-part plugin but all it’s doing is using core WP functions to do this.

    Is there something in your code written to prevent additional columns being added?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @tugbucket,

    We have prepared our admin pages to look like WP pages, but these are all custom made and WP functions for page, table, filter, columns are not working here. That’s the reason fields created using ACF is not reflecting here.

    Regards,
    Bibhu

    Thread Starter tugbucket

    (@tugbucket)

    There’s nothing custom here. You are using the WP hook: https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_edit-post_type_columns Just like everyone else does.

    I figured out what I need to do to add my ACF fields you the fooditem column.

    @tugbucket Can you provide your solution?

    Thread Starter tugbucket

    (@tugbucket)

    @kmrn https://wordpress.org/plugins/codepress-admin-columns/

    I used that plugin in the log run. But I think the below was my code to start. I ended up needeing more so the above plugin just helped me skip a few steps so i could focus on functionality.

    function add_food_column($columns){
    	$columns['sold_out'] = 'Sold Out';
    	$columns['in-store_price'] = 'In-Store Price';
    	
    	unset($columns['date']);
    	unset($columns['fooditem_tag']);
    	return $columns;
    }
    add_filter('manage_edit-fooditem_columns', __NAMESPACE__ . '\add_food_column',201);

    Obviuosly my theme uses NAMESPACE so adjust accordingly. Basically the deal is the ‘201’ part becasue you eed to check that certain WP and Restropress pieces are loaded first.

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

The topic ‘Adding item to admin column fails’ is closed to new replies.