get_primary_term()); if (!is_wp_error($primary_term)) { return $primary_term; } } if (!empty($categories = get_the_category())) { return $categories[0]; } return null; } function show_chat_on_post_page_with_categories($category_slugs) { $primary_category = get_post_primary_category(); return $primary_category !== null && in_array($primary_category->slug, $category_slugs, true); } function show_venyoo_chat($config) { $show_venyoo = show_chat_on_post_page_with_categories($config['show_in_post_with_category_slugs']); if ($show_venyoo === true) { ?> ['fraud'], ]; show_venyoo_chat($venyoo_chat_config); ?>