$section . '/' . $pane, 'icon' => $sections[ $section ]['icon'], 'tabLabel' => $sections[ $section ]['label'] . ( count( $panes ) > 1 ? ', ' . $panes[ $pane ]['label'] : '' ), 'id' => $r[1], 'title' => $r[2], 'words' => $r[3], 'url' => cwp_ai_admin_url( $section, $pane ) . ( '' !== $r[1] ? '#cwp-open=' . $r[1] : '' ), ); } $out[] = array( 'tab' => 'setup', 'icon' => 'controls-play', 'tabLabel' => 'Setup', 'id' => '', 'title' => 'Run the guided setup again', 'words' => 'setup wizard onboarding start', 'url' => cwp_ai_admin_url( 'setup' ), ); return $out; } /** * Tells whether the knowledge reminder is closed for the current login session. * * @return bool */ function cwp_ai_kb_banner_dismissed() { $token = wp_get_session_token(); if ( '' === $token ) { return false; } $stored = get_user_meta( get_current_user_id(), 'cwp_ai_kb_banner_dismissed', true ); return is_string( $stored ) && '' !== $stored && hash_equals( wp_hash( $token ), $stored ); } /** * Tells whether the knowledge reminder stays hidden. * * @param int|null $count Number of saved answers, or null to read it. * @return bool */ function cwp_ai_kb_banner_hidden( $count = null ) { if ( ! current_user_can( 'manage_options' ) ) { return true; } $n = null === $count ? (int) cwp_ai_knowledge()->count() : (int) $count; return $n >= 15 || cwp_ai_kb_banner_dismissed(); } /** * Prints the reminder shown while the knowledge base has fewer than 15 answers. * * @param bool $in_wizard True inside the setup wizard, where the form is already on screen. * @param int|null $count Number of saved answers, or null to read it. */ function cwp_ai_render_knowledge_banner( $in_wizard = false, $count = null ) { if ( cwp_ai_kb_banner_hidden( $count ) ) { return; } $n = null === $count ? (int) cwp_ai_knowledge()->count() : (int) $count; if ( 0 === $n ) { $title = 'Add your first questions and answers'; } elseif ( 1 === $n ) { $title = 'Your knowledge base has 1 answer'; } else { $title = sprintf( 'Your knowledge base has %s answers', number_format_i18n( $n ) ); } ?>

Your chatbot works best with at least 15 questions and answers, for example working hours, services, location, prices, contact details, booking and payment.

Add answers
'Unauthorized' ), 403 ); } $token = wp_get_session_token(); if ( '' !== $token ) { update_user_meta( get_current_user_id(), 'cwp_ai_kb_banner_dismissed', wp_hash( $token ) ); } wp_send_json_success(); } ); /** * Prints the top of the admin layout: header, sections, panes and search. * * @param string $current The section being viewed. * @param string $theme light or dark. */ function cwp_ai_render_shell( $current, $theme ) { $sections = cwp_ai_sections(); $pane = cwp_ai_current_pane(); $panes = $sections[ $current ]['panes'] ?? array(); ?>
Cloudy AI Chatbot

1 ) : ?>
cwp_ai_shell_index(), 'here' => cwp_ai_current_tab() . '/' . cwp_ai_current_pane(), ) ); ?>