Buy B2BKing
$199 $149
Below are some PHP snippets + guides to make B2BKing product visibility compatible with 3rd party plugins.
Here is a guide for adding PHP snippets: Add PHP/JS Snippets
To make B2BKing's visibility work with this table plugin:
add_filter( 'wc_product_table_query_args', function( $args, $table_query ) { // do something with $args if (isset($args['post__in'])){ $currentval = $args['post__in']; } else { $currentval = array(); } $allTheIDs = get_transient('b2bking_user_'.get_current_user_id().'_ajax_visibility'); $allTheIDs = apply_filters('b2bking_ids_post_in_visibility', $allTheIDs); if (empty($allTheIDs)){ $allTheIDs = array('invalid'); } $args['post__in'] = $allTheIDs; if (!empty($currentval)){ $allTheIDs = array_intersect($allTheIDs, $currentval); } return $args; }, 10, 2 );
Powered by BetterDocs