PHP code example of soderlind / wp-loupe

1. Go to this page and download the library: Download soderlind/wp-loupe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

soderlind / wp-loupe example snippets


add_filter( 'wp_loupe_db_path', WP_CONTENT_DIR . '/my-path' );

add_filter( 'wp_loupe_post_types', [ 'post', 'page', 'book' ] );

add_filter( "wp_loupe_filterable_attribute_book", [ 'post_title', 'author', 'isbn' ] );

add_filter( 'wp_loupe_posts_per_page', 20 );

add_filter( 'wp_loupe_index_protected','__return_true' );

add_filter('wp_loupe_schema_content', function($content) {
	// Modify content before indexing
	$content = preg_replace('/<!--(.*?)-->/s', '', $content);
	return $content;
});