Ticket #17850: 17850.diff

File 17850.diff, 710 bytes (added by ryan, 2 years ago)
Line 
1Index: wp-includes/meta.php
2===================================================================
3--- wp-includes/meta.php        (revision 18324)
4+++ wp-includes/meta.php        (working copy)
5@@ -588,8 +588,12 @@
6  * @return bool True if the key is protected, false otherwise.
7  */
8 function is_protected_meta( $meta_key, $meta_type = null ) {
9-       $protected = (  '_' == $meta_key[0] );
10+       $protected = false;
11+       $protected_keys = array( '_edit_last', '_edit_lock', '_thumbnail_id' );
12 
13+       if ( 0 === strpos( $meta_key, '_wp_' ) || 0 === strpos( $meta_key, '_menu_item_' ) || in_array( $meta_key, $protected_keys ) )
14+               $protected = true;
15+
16        return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type );
17 }
18