snippet doesn’t work | WordPress.org

[ad_1]

Plugin Author
Saiful

(@codersaiful)

Can you provide your code and explain how u have added?
Plz explain details

Thread Starter
mcdeth

(@mcdeth)

Thanks for quick reply. So I create a snippet with Code Snippet, where I use code:

add_filter( 'wc_product_table_custom_column_product_region', function( $data, WC_Product $product, $args ) { 
    $data="Something"; // create your data here
    return $data;
}, 10, 3 );

Then I use a shortcode:

[product_table columns="image,name,att:size,price,product_region"]

I disable website cache and plugin cache. Any other changes I make, like add or remove standalone column, takes immediate effect so it’s not caching. I’ve also tried pasting advanced snippet and there’s no effect. I can see column Product region, but it’s empty. I’ve tried with

return "123";
echo "123";

Also no effects

  • This reply was modified 1 hour, 30 minutes ago by mcdeth.

Plugin Author
Saiful

(@codersaiful)

May, u r using any other product table plugin. Bcz our table shortcode is different as well.

Btw tomorrow I will give u full video tutorial for making custom column.

In the mean time, see article https://wooproducttable.com/docs/doc/advance-uses/how-to-add-custom-column-using-action-and-filter-hooks/

It will help u to create custom column in our table.

Thread Starter
mcdeth

(@mcdeth)

Thank, you’re right it was other plugin. I will test yours. Thanks!

Plugin Author
Saiful

(@codersaiful)

I see. Ok, I am closing this ticket.

Feel free to knock us any time.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer