Code Duplication    Length = 7-8 lines in 3 locations

lib/endpoints/class-wp-rest-revisions-controller.php 2 locations

@@ 219-225 (lines=7) @@
216
			$data['slug'] = $post->post_name;
217
		}
218
219
		if ( ! empty( $schema['properties']['guid'] ) ) {
220
			$data['guid'] = array(
221
				/** This filter is documented in wp-includes/post-template.php */
222
				'rendered' => apply_filters( 'get_the_guid', $post->guid ),
223
				'raw'      => $post->guid,
224
			);
225
		}
226
227
		if ( ! empty( $schema['properties']['title'] ) ) {
228
			$data['title'] = array(
@@ 234-241 (lines=8) @@
231
			);
232
		}
233
234
		if ( ! empty( $schema['properties']['content'] ) ) {
235
236
			$data['content'] = array(
237
				'raw'      => $post->post_content,
238
				/** This filter is documented in wp-includes/post-template.php */
239
				'rendered' => apply_filters( 'the_content', $post->post_content ),
240
			);
241
		}
242
243
		if ( ! empty( $schema['properties']['excerpt'] ) ) {
244
			$data['excerpt'] = array(

lib/endpoints/class-wp-rest-posts-controller.php 1 location

@@ 1127-1133 (lines=7) @@
1124
			$data['date_gmt'] = $this->prepare_date_response( $post->post_date_gmt );
1125
		}
1126
1127
		if ( ! empty( $schema['properties']['guid'] ) ) {
1128
			$data['guid'] = array(
1129
				/** This filter is documented in wp-includes/post-template.php */
1130
				'rendered' => apply_filters( 'get_the_guid', $post->guid ),
1131
				'raw'      => $post->guid,
1132
			);
1133
		}
1134
1135
		if ( ! empty( $schema['properties']['modified'] ) ) {
1136
			$data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified );