diff --git a/doofinder/doofinder.php b/doofinder/doofinder.php index bdcd7c4..3a63426 100644 --- a/doofinder/doofinder.php +++ b/doofinder/doofinder.php @@ -3,7 +3,7 @@ * Plugin Name: Doofinder * License: GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html - * Version: 0.4.7 + * Version: 0.4.8 * Author: Doofinder * Description: Integrate Doofinder Search in your WordPress website. * @@ -30,7 +30,7 @@ class Doofinder_For_WordPress { * * @var string */ - public static $version = '0.4.7'; + public static $version = '0.4.8'; /** * The only instance of Doofinder_For_WordPress @@ -113,10 +113,12 @@ public function __construct() { JS_Layer::instance(); Internal_Search::instance(); } - - // Register all custom URLs + add_action( 'init', function () use ( $class ) { + // Register all custom URLs call_user_func( array( $class, 'register_urls' ) ); + // Enable excerpt for indexable posts + call_user_func( array( $class, 'enable_excerpt' ) ); } ); } @@ -277,6 +279,17 @@ public static function upgrader_process_complete( $upgrader_object, $options ) { } } } + /** + * This function enables the excerpt for any indexable post. + */ + public static function enable_excerpt(){ + $post_types = Post_Types::instance(); + foreach ($post_types->get_indexable() as $key => $post_type) { + if (!post_type_supports($post_type, 'excerpt')) { + add_post_type_support($post_type, 'excerpt'); + } + } + } } endif; diff --git a/doofinder/readme.txt b/doofinder/readme.txt index 09f7ba2..fb84241 100644 --- a/doofinder/readme.txt +++ b/doofinder/readme.txt @@ -1,7 +1,7 @@ === Doofinder === Contributors: doofinder, chopchoporg Tags: search, autocomplete -Version: 0.4.7 +Version: 0.4.8 Requires at least: 4.1 Tested up to: 5.9 Stable tag: trunk @@ -114,6 +114,9 @@ Just send your questions to and we will try to an == Changelog == += 0.4.8 = +- Add excerpt field for any indexable post types. + = 0.4.7 = - Fix indexation problems while replacing the temp index.