Skip to content

Commit

Permalink
add more post filters
Browse files Browse the repository at this point in the history
  • Loading branch information
dphiffer committed Nov 25, 2024
1 parent 4a941ae commit f8cf4e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wp-content/plugins/feed-import/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,18 @@ function get_existing() {
}

function status() {
return 'publish';
return apply_filters('feed_import_post_status', 'publish');
}

function title() {
return $this->data['title'];
return apply_filters('feed_import_post_title', $this->data['title']);
}

function content() {
$content = $this->data['description'];
$content = $this->autolink_urls($content);
$content = $this->format_paragraphs($content);
$content = apply_filters('feed_import_post_content', $content);
return $content;
}

Expand Down Expand Up @@ -147,11 +148,13 @@ function format_paragraphs($content) {

function date() {
$date = new \DateTime($this->data['pubDate'], wp_timezone());
$date = apply_filters('feed_import_post_date', $date);
return $date->format('Y-m-d H:i:s');
}

function date_gmt() {
$date = new \DateTime($this->data['pubDate']);
$date = apply_filters('feed_import_post_date_gmt', $date);
return $date->format('Y-m-d H:i:s');
}

Expand Down

0 comments on commit f8cf4e8

Please sign in to comment.