PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | json-endpoints/class.wpcom-json-api-list-media-v1-1-endpoint.php +11 -5 13.0.2 → 16.3-a.7 View file →
@@ -1,6 +1,10 @@
1 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 2
3 +if ( ! defined( 'ABSPATH' ) ) {
4 + exit( 0 );
5 +}
6 +
3 7 /**
4 8 * List Media v1_1 endpoint.
5 9 */
6 10 new WPCOM_JSON_API_List_Media_v1_1_Endpoint(
@@ -53,8 +57,10 @@
53 57 );
54 58
55 59 /**
56 60 * List media v1_1 endpoint class.
61 + *
62 + * @phan-constructor-used-for-side-effects
57 63 */
58 64 class WPCOM_JSON_API_List_Media_v1_1_Endpoint extends WPCOM_JSON_API_Endpoint { // phpcs:ignore
59 65
60 66 /**
@@ -117,14 +123,14 @@
117 123
118 124 $query = array(
119 125 'post_type' => 'attachment',
120 126 'post_status' => 'inherit',
121 - 'post_parent' => isset( $args['post_ID'] ) ? $args['post_ID'] : null,
127 + 'post_parent' => $args['post_ID'] ?? null,
122 128 'posts_per_page' => $args['number'],
123 - 'post_mime_type' => isset( $args['mime_type'] ) ? $args['mime_type'] : null,
124 - 'order' => isset( $args['order'] ) ? $args['order'] : 'DESC',
125 - 'orderby' => isset( $args['order_by'] ) ? $args['order_by'] : 'date',
126 - 's' => isset( $args['search'] ) ? $args['search'] : null,
129 + 'post_mime_type' => $args['mime_type'] ?? null,
130 + 'order' => $args['order'] ?? 'DESC',
131 + 'orderby' => $args['order_by'] ?? 'date',
132 + 's' => $args['search'] ?? null,
127 133 'meta_query' => array(
128 134 array(
129 135 'key' => 'videopress_poster_image',
130 136 'compare' => 'NOT EXISTS',