Search
wogc/admin/manage_shop_order_column_data - WP Global Cart
14800
documentation-template-default,single,single-documentation,postid-14800,theme-awake,eltd-core-1.1,woocommerce-no-js,awake child-child-ver-1.0.0,awake-ver-1.0,eltd-smooth-scroll,eltd-smooth-page-transitions,eltd-mimic-ajax,eltd-grid-1200,eltd-blog-installed,eltd-default-style,eltd-fade-push-text-top,eltd-header-standard,eltd-sticky-header-on-scroll-down-up,eltd-default-mobile-header,eltd-sticky-up-mobile-header,eltd-menu-item-first-level-bg-color,eltd-dropdown-slide-from-top,eltd-,eltd-fullscreen-search eltd-search-fade,eltd-side-menu-slide-from-right,wpb-js-composer js-comp-ver-6.3.0,vc_responsive
 

wogc/admin/manage_shop_order_column_data

WP Global Cart / wogc/admin/manage_shop_order_column_data
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page

wogc/admin/manage_shop_order_column_data

Name: wogc/admin/manage_shop_order_column_data
Type: Action
Arguments: $post, $column_name

The filter can be used to render data for a custom created column on SuperAdmin Orders interface.

The following example render html for column called Products


    add_action('wogc/admin/manage_shop_order_column_data', 'custom_wogc_admin_manage_shop_order_column_data', 10, 2);
    function custom_wogc_admin_manage_shop_order_column_data( $post, $column_name )
        {
            
            if ( $column_name != 'products')
                return;
                
            $order  =   wc_get_order( $post->ID );
            foreach( $order->get_items() as  $key    =>  $order_item )
                {
                    switch_to_blog( $order_item->get_meta('blog_id') );
                    
                    printf( '<b>%s</b>', esc_html( $order_item->get_name() ) );        
                    
                    restore_current_blog();
                }

        }

The code should be placed inside a php file on wp-content/mu-plugins folder.

0
Would love your thoughts, please comment.x
()
x