PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
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 13.9.2 14.0.1 All 504 releases
← All changes | sal/class.json-api-metadata.php +9 -4 12.7.316.3-a.1 View file →
@@ -4,8 +4,12 @@
4 4 *
5 5 * @package automattic/jetpack
6 6 */
7 7
8 +if ( ! defined( 'ABSPATH' ) ) {
9 + exit( 0 );
10 +}
11 +
8 12 /**
9 13 * Base class for WPCOM_JSON_API_Metadata
10 14 */
11 15 class WPCOM_JSON_API_Metadata {
@@ -30,13 +34,13 @@
30 34 if ( in_array( $key, apply_filters( 'rest_api_allowed_public_metadata', $whitelisted_meta ), true ) ) {
31 35 return true;
32 36 }
33 37
34 - if ( 0 === strpos( $key, 'geo_' ) ) {
38 + if ( str_starts_with( $key, 'geo_' ) ) {
35 39 return true;
36 40 }
37 41
38 - if ( 0 === strpos( $key, '_wpas_' ) ) {
42 + if ( str_starts_with( $key, '_wpas_' ) ) {
39 43 return true;
40 44 }
41 45
42 46 return false;
@@ -58,8 +62,9 @@
58 62 // display the correct newsletter access in Calypso.
59 63 $whitelist = array(
60 64 '_jetpack_newsletter_access',
61 65 '_jetpack_newsletter_tier_id',
66 + '_jetpack_dont_email_post_to_subs',
62 67 );
63 68
64 69 if ( in_array( $key, $whitelist, true ) ) {
65 70 return false;
@@ -64,13 +69,13 @@
64 69 if ( in_array( $key, $whitelist, true ) ) {
65 70 return false;
66 71 }
67 72
68 - if ( 0 === strpos( $key, '_jetpack_' ) ) {
73 + if ( str_starts_with( $key, '_jetpack_' ) ) {
69 74 return true;
70 75 }
71 76
72 - if ( 0 === strpos( $key, '_elasticsearch_' ) ) {
77 + if ( str_starts_with( $key, '_elasticsearch_' ) ) {
73 78 return true;
74 79 }
75 80
76 81 return false;