Skip to content

Commit aca114f

Browse files
authored
gw-update-posts.php: Added support to update post excerpt.
1 parent fcf3ea9 commit aca114f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gravity-forms/gw-update-posts.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function __construct( $args = array() ) {
2525
'title' => false,
2626
'content' => false,
2727
'author' => false,
28+
'excerpt' => false,
2829
'status' => false,
2930
'slug' => false,
3031
'terms' => array(),
@@ -104,6 +105,10 @@ public function update_post_by_entry( $entry, $form ) {
104105
if ( $this->_args['author'] ) {
105106
$post->post_author = (int) rgar( $entry, $this->_args['author'] );
106107
}
108+
109+
if ($this->_args['excerpt']) {
110+
$post->post_excerpt = rgar($entry, $this->_args['excerpt']);
111+
}
107112

108113
if ( $this->_args['status'] ) {
109114
$stati = get_post_stati();
@@ -419,5 +424,3 @@ public function get_post_date( $entry, $form ) {
419424
return gmdate( 'Y-m-d H:i:s', strtotime( sprintf( '%s %s:%s:00', $date, $hour, $min ) ) );
420425
}
421426
}
422-
423-

0 commit comments

Comments
 (0)