fix: not sanitize value for Logs #447

This commit is contained in:
vnmedeiros 2021-03-22 23:49:54 -03:00
parent 003cb26411
commit 8efc8a706a
1 changed files with 5 additions and 2 deletions

View File

@ -168,8 +168,11 @@ abstract class Repository {
$obj_post_type = 'tainacan-item';
do_action( "tainacan-pre-insert-$obj_post_type", $obj );
}
$obj->WP_Post->post_title = $sanitized_title;
$obj->WP_Post->post_content = $sanitized_desc;
if ( ! $obj instanceof Entities\Log ) {
$obj->WP_Post->post_title = $sanitized_title;
$obj->WP_Post->post_content = $sanitized_desc;
}
$id = wp_insert_post( $obj->WP_Post );
if ($id instanceof \WP_Error || 0 === $id) {