diff --git a/classes.fields.php b/classes.fields.php index 1fa6e1f4..aafca6c1 100644 --- a/classes.fields.php +++ b/classes.fields.php @@ -1185,12 +1185,12 @@ public function output_script() { args['multiple'] ) : ?> value as $post_id ) : ?> - data.push( ); + data.push( $post_id, 'text' => html_entity_decode( get_the_title( $post_id ) ) ) ); ?> ); - data = value, get_the_title( $this->value ) ); ?>; + data = $post_id, 'text' => html_entity_decode( get_the_title( $post_id ) ) ) ); ?>; @@ -1254,8 +1254,9 @@ function cmb_ajax_post_select() { $json = array( 'total' => $query->found_posts, 'posts' => array() ); - foreach ( $query->posts as $post_id ) - array_push( $json['posts'], array( 'id' => $post_id, 'text' => get_the_title( $post_id ) ) ); + foreach ( $query->posts as $post_id ) { + array_push( $json['posts'], array( 'id' => $post_id, 'text' => html_entity_decode( get_the_title( $post_id ) ) ) ); + } echo json_encode( $json );