Skip to content

Commit

Permalink
Merge pull request #2729 from 10up/fix/issue-2724
Browse files Browse the repository at this point in the history
Fix URL for Related Posts API Functions
  • Loading branch information
felipeelia committed Apr 27, 2022
2 parents d32612f + f33d70a commit bce3903
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ ElasticPress understands data in real time, so it can instantly deliver engaging

Available API functions:

* `ElasticPress\Features::factory()->get_registered_feature( 'related_posts' )->find_related( $post_id, $return = 5 )`
* `\ElasticPress\Features::factory()->get_registered_feature( 'related_posts' )->find_related( $post_id, $return = 5 )`

Get related posts for a given `$post_id`. Use this in a theme or plugin to get related content.

* `\ElasticPress\Features::factory()->get_registered_feature( 'related_posts' )->get_related_query( $post_id, $return = 5 )`

Get a `WP_Query` object with the related posts for a given `$post_id`.

## Protected Content

Optionally index all of your content, including private and unpublished content, to speed up searches and queries in places like the administrative dashboard.
Expand Down
3 changes: 3 additions & 0 deletions hookdoc-conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"node_modules/wp-hookdoc/plugin",
"plugins/markdown"
],
"markdown": {
"idInHeadings": true
},
"templates": {
"default": {
"layoutFile": ".github/hookdoc-tmpl/layout.tmpl",
Expand Down
2 changes: 1 addition & 1 deletion includes/classes/Feature/RelatedPosts/RelatedPosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function register_widget() {
*/
public function output_feature_box_long() {
?>
<p><?php echo wp_kses_post( __( 'Output related content using our Widget or directly in your theme using our <a href="https://github.com/10up/ElasticPress/#related-posts">API functions.</a>', 'elasticpress' ) ); ?></p>
<p><?php echo wp_kses_post( __( 'Output related content using our Widget or directly in your theme using our <a href="https://10up.github.io/ElasticPress/tutorial-features.html#related-posts">API functions.</a>', 'elasticpress' ) ); ?></p>
<?php
}
}

0 comments on commit bce3903

Please sign in to comment.