Filter or add items to the Assistant window.
/**
* Add or filter (specific) items in the Assistant window.
*
* @param array $items Array of Assistant items.
*/
function my_prefix_assistant_items( $items ) {
ob_start();
?>
<h2>Hello world!</h2>
<?php
$custom_template = ob_get_clean();
$items['custom_content'] = array(
'classes' => array( 'assistant-custom-content', 'another-class' ), // Array of custom CSS classes.
'title' => __( 'My title', 'cartpops' ), // Assistant header title.
'template' => $custom_template, // Custom HTML template to be shown in the Assistant.
);
return $items;
}
add_filter( 'cartpops_drawer_classes', 'my_prefix_assistant_items', 10, 1 );