I want to show cart items number if any or nothing, simple CART text

You’re already on the right track. Simply add conditional if 0 <?PHP $cart_count = WC()->cart->get_cart_contents_count(); $cart_count = $cart_count ? “({$cart_count})” : ”; // if 0, become empty string $cart_link = wc_get_cart_url(); $cart_button = “<a href=”https://wordpress.stackexchange.com/questions/378487/{$cart_link}”>Cart {$cart_count}</a>”; echo $cart_button;

Overriding a function in a WordPress plugin

If you must use the 3rd party function – why not just reformat the returned value? Date ($id) { $userActivityDate = Br::show_activity_date($id); date_timezone_set($userActivityDate, timezone_open(‘timezone You want it to be in’)); date_format($userActivityDate, ‘Y-m-d H:i:sP’); $return = apply_filters(‘user_activity’, $userActivityDate); } If the return value of the Br::show_activity_date is not directly useful in this manner, then I suggest … Read more