Il peut arriver que vous ayez besoin d'exclure une adhésion de l'affichage sur le tableau de bord du vendeur. L'extrait suivant vous permettra d'exclure un ou plusieurs produits d'adhésion de la liste.
Le code suivant irait dans le fichier functions.php de votre thème.
<?php
add_filter( 'wcv_membership_product_query_args', 'exclude_membership_plan' );
function exclude_membership_plan( $args ){
$current_page_id = get_the_ID();
// If this is not the pro dashboard do nothing
if ( ! wcv_is_dashboard_page( $current_page_id ) ){
return $args;
}
// This should be the membership product IDs in this example the product ID is 471
$plans = array( 471 );
$args['post__not_in'] = $plans;
return $args;
}