Skip to content

Commit

Permalink
Fix post excerpt filter in post data not working (#119)
Browse files Browse the repository at this point in the history
* Fix post excerpt filter in post data not working

* Add changelog
  • Loading branch information
irshadahmad21 committed Mar 26, 2024
1 parent fa8e0ac commit 69bb5c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-parents-sit.md
@@ -0,0 +1,5 @@
---
"wptelegram": patch
---

Fixed post excerpt filter in post data not working
6 changes: 3 additions & 3 deletions plugins/wptelegram/src/modules/p2tg/PostData.php
Expand Up @@ -165,10 +165,10 @@ public function get_field_value( $field, $options = [] ) {

} else {

$field = 'post_content' === $excerpt_source ? 'post_content' : 'post_excerpt';
$filter = 'post_content' === $excerpt_source ? 'the_content' : 'the_excerpt';
$post_field = 'post_content' === $excerpt_source ? 'post_content' : 'post_excerpt';
$filter = 'post_content' === $excerpt_source ? 'the_content' : 'the_excerpt';

$excerpt = get_post_field( $field, $this->post );
$excerpt = get_post_field( $post_field, $this->post );

self::remove_autoembed_filter();

Expand Down

0 comments on commit 69bb5c2

Please sign in to comment.