|
@@ 22-46 (lines=25) @@
|
| 19 |
|
* |
| 20 |
|
* @return bool Always returns true. |
| 21 |
|
*/ |
| 22 |
|
public function content( $data ) { |
| 23 |
|
|
| 24 |
|
$save_to_post_disabled = $this->save_to_post_disables(); |
| 25 |
|
|
| 26 |
|
$postid = (int) $data[ 'post_id' ]; |
| 27 |
|
$content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
| 28 |
|
$content = $this->remove_comments( $content ); |
| 29 |
|
|
| 30 |
|
if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
| 31 |
|
|
| 32 |
|
$args = array( |
| 33 |
|
'ID' => (int) $postid, |
| 34 |
|
'post_content' => $content |
| 35 |
|
); |
| 36 |
|
|
| 37 |
|
wp_update_post( apply_filters( 'lasso_object_save_args', $args ) ); |
| 38 |
|
|
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
// run save action |
| 42 |
|
do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() ); |
| 43 |
|
|
| 44 |
|
return true; |
| 45 |
|
|
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
/** |
| 49 |
|
* Process the post save |
|
@@ 57-79 (lines=23) @@
|
| 54 |
|
* |
| 55 |
|
* @return bool Always returns true. |
| 56 |
|
*/ |
| 57 |
|
public function publish_content( $data ) { |
| 58 |
|
$save_to_post_disabled = $this->save_to_post_disables(); |
| 59 |
|
|
| 60 |
|
$postid = (int) $data[ 'post_id' ]; |
| 61 |
|
$content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
| 62 |
|
$content = $this->remove_comments( $content ); |
| 63 |
|
|
| 64 |
|
if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
| 65 |
|
|
| 66 |
|
$args = array ( |
| 67 |
|
'ID' => $postid, |
| 68 |
|
'post_content' => $content, |
| 69 |
|
'post_status' => 'publish' |
| 70 |
|
); |
| 71 |
|
wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) ); |
| 72 |
|
|
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() ); |
| 76 |
|
|
| 77 |
|
return true; |
| 78 |
|
|
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
/** |
| 82 |
|
* The keys required for the actions of this class. |