| @@ -7,10 +7,9 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | namespace ElasticPress\Feature\RelatedPosts; |
| 10 | 10 | |
| 11 | -use \WP_Widget as WP_Widget; | |
| 12 | -use ElasticPress\Features as Features; | |
| 11 | +use ElasticPress\Features; | |
| 13 | 12 | |
| 14 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | 14 | exit; // Exit if accessed directly. |
| 16 | 15 | } |
| @@ -17,9 +16,9 @@ | ||
| 17 | 16 | |
| 18 | 17 | /** |
| 19 | 18 | * Related posts widget class |
| 20 | 19 | */ |
| 21 | -class Widget extends WP_Widget { | |
| 20 | +class Widget extends \WP_Widget { | |
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * Initialize the widget |
| 25 | 24 | * |
| @@ -25,9 +24,13 @@ | ||
| 25 | 24 | * |
| 26 | 25 | * @since 6.4 |
| 27 | 26 | */ |
| 28 | 27 | public function __construct() { |
| 29 | - $options = array( 'description' => esc_html__( 'Show related posts using ElasticPress. This widget will only appear on single post, page, and custom type pages.', 'elasticpress' ) ); | |
| 28 | + $options = array( | |
| 29 | + 'description' => esc_html__( 'Show related posts using ElasticPress. This widget will only appear on single post, page, and custom type pages.', 'elasticpress' ), | |
| 30 | + 'show_instance_in_rest' => true, | |
| 31 | + ); | |
| 32 | + | |
| 30 | 33 | parent::__construct( 'ep-related-posts', esc_html__( 'ElasticPress - Related Posts', 'elasticpress' ), $options ); |
| 31 | 34 | } |
| 32 | 35 | |
| 33 | 36 | /** |