Home / Admin / Add CPTs for Typesense
Duplicate Snippet

Embed Snippet on Your Site

Add CPTs for Typesense

Enables you to add the CPTs selected for indexing and searching with Typesense

Code Preview
php
<?php
function cm_typesense_add_available_post_types( $available_post_types ) {
	//Edit, delete or add according to your information
    $available_post_types['docs'] = [ 'label' => 'Documentation', 'value' => 'docs' ];
	$available_post_types['actualites'] = [ 'label' => 'Actualités', 'value' => 'actualites' ];
	$available_post_types['notes_versions'] = [ 'label' => 'Notes de version', 'value' => 'notes_versions' ];
	$available_post_types['videos'] = [ 'label' => 'Vidéos', 'value' => 'videos' ];
	
    return $available_post_types;
}
add_filter( 'cm_typesense_available_index_types',  'cm_typesense_add_available_post_types');

Comments

Add a Comment