| @@ -35,19 +35,27 @@ | ||
| 35 | 35 | */ |
| 36 | 36 | public function __construct() { |
| 37 | 37 | $this->slug = 'comments'; |
| 38 | 38 | |
| 39 | - $this->title = esc_html__( 'Comments', 'elasticpress' ); | |
| 39 | + $this->requires_install_reindex = true; | |
| 40 | 40 | |
| 41 | - $this->summary = '<p>' . __( 'This feature will empower your website to overcome traditional WordPress comment search and query limitations that can present themselves at scale. This feature is only needed if you are using <code>WP_Comment_Query</code> directly.', 'elasticpress' ) . '</p>'; | |
| 41 | + Indexables::factory()->register( new Indexable\Comment\Comment(), false ); | |
| 42 | 42 | |
| 43 | - $this->docs_url = __( 'https://elasticpress.zendesk.com/hc/en-us/articles/360050447492-Configuring-ElasticPress-via-the-Plugin-Dashboard#comments', 'elasticpress' ); | |
| 43 | + parent::__construct(); | |
| 44 | + } | |
| 44 | 45 | |
| 45 | - $this->requires_install_reindex = true; | |
| 46 | + /** | |
| 47 | + * Sets i18n strings. | |
| 48 | + * | |
| 49 | + * @return void | |
| 50 | + * @since 5.2.0 | |
| 51 | + */ | |
| 52 | + public function set_i18n_strings(): void { | |
| 53 | + $this->title = esc_html__( 'Comments', 'elasticpress' ); | |
| 46 | 54 | |
| 47 | - Indexables::factory()->register( new Indexable\Comment\Comment(), false ); | |
| 55 | + $this->summary = '<p>' . __( 'This feature will empower your website to overcome traditional WordPress comment search and query limitations that can present themselves at scale. This feature is only needed if you are using <code>WP_Comment_Query</code> directly.', 'elasticpress' ) . '</p>'; | |
| 48 | 56 | |
| 49 | - parent::__construct(); | |
| 57 | + $this->docs_url = __( 'https://www.elasticpress.io/resources/articles/configuring-elasticpress-via-the-plugin-dashboard/#comments', 'elasticpress' ); | |
| 50 | 58 | } |
| 51 | 59 | |
| 52 | 60 | /** |
| 53 | 61 | * Setup search functionality |
| @@ -95,19 +103,8 @@ | ||
| 95 | 103 | add_filter( 'ep_elasticpress_enabled', [ $this, 'integrate_search_queries' ], 10, 2 ); |
| 96 | 104 | } |
| 97 | 105 | |
| 98 | 106 | /** |
| 99 | - * Output feature box long text | |
| 100 | - * | |
| 101 | - * @since 3.6.0 | |
| 102 | - */ | |
| 103 | - public function output_feature_box_long() { | |
| 104 | - ?> | |
| 105 | - <p><?php esc_html_e( 'This feature will empower your website to overcome traditional WordPress comment search and query limitations that can present themselves at scale.', 'elasticpress' ); ?></p> | |
| 106 | - <?php | |
| 107 | - } | |
| 108 | - | |
| 109 | - /** | |
| 110 | 107 | * Enable integration on search queries |
| 111 | 108 | * |
| 112 | 109 | * @param bool $enabled Whether EP is enabled |
| 113 | 110 | * @param \WP_Comment_Query $query Current query object. |
| @@ -134,9 +131,9 @@ | ||
| 134 | 131 | * @since 3.6.0 |
| 135 | 132 | * @return FeatureRequirementsStatus |
| 136 | 133 | */ |
| 137 | 134 | public function requirements_status() { |
| 138 | - $status = new FeatureRequirementsStatus( 1 ); | |
| 135 | + $status = new FeatureRequirementsStatus( 1, null, $this ); | |
| 139 | 136 | |
| 140 | 137 | return $status; |
| 141 | 138 | } |
| 142 | 139 | |
| @@ -170,9 +167,9 @@ | ||
| 170 | 167 | |
| 171 | 168 | $post_types = Features::factory()->get_registered_feature( 'search' )->get_searchable_post_types(); |
| 172 | 169 | $post_types = array_filter( |
| 173 | 170 | $post_types, |
| 174 | - function( $post_type ) { | |
| 171 | + function ( $post_type ) { | |
| 175 | 172 | return post_type_supports( $post_type, 'comments' ); |
| 176 | 173 | } |
| 177 | 174 | ); |
| 178 | 175 | |