Changeset 53199 for trunk/src/wp-admin/includes/meta-boxes.php
- Timestamp:
- 04/17/2022 05:24:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/meta-boxes.php
r53198 r53199 1189 1189 * @param string $xfn_relationship 1190 1190 * @param string $xfn_value 1191 * @param mixed $deprecated Never used.1191 * @param mixed $deprecated Never used. 1192 1192 */ 1193 1193 function xfn_check( $xfn_relationship, $xfn_value = '', $deprecated = '' ) { … … 1198 1198 } 1199 1199 1200 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; 1201 $rels = preg_split( '/\s+/', $link_rel ); 1202 1203 if ( '' !== $xfn_value && in_array( $xfn_value, $rels, true ) ) { 1200 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; 1201 $link_rels = preg_split( '/\s+/', $link_rel ); 1202 1203 // Mark the specified value as checked if it matches the link relationship. 1204 if ( '' !== $xfn_value && in_array( $xfn_value, $link_rels, true ) ) { 1204 1205 echo ' checked="checked"'; 1205 1206 } 1206 1207 1207 1208 if ( '' === $xfn_value ) { 1209 // Mark the 'none' value as checked if the link does not match the specified relationship. 1208 1210 if ( 'family' === $xfn_relationship 1209 && strpos( $link_rel, 'child' ) === false 1210 && strpos( $link_rel, 'parent' ) === false 1211 && strpos( $link_rel, 'sibling' ) === false 1212 && strpos( $link_rel, 'spouse' ) === false 1213 && strpos( $link_rel, 'kin' ) === false 1211 && ! array_intersect( $link_rels, array( 'child', 'parent', 'sibling', 'spouse', 'kin' ) ) 1214 1212 ) { 1215 1213 echo ' checked="checked"'; … … 1217 1215 1218 1216 if ( 'friendship' === $xfn_relationship 1219 && strpos( $link_rel, 'friend' ) === false 1220 && strpos( $link_rel, 'acquaintance' ) === false 1221 && strpos( $link_rel, 'contact' ) === false ) { 1222 echo ' checked="checked"'; 1223 } 1224 1225 if ( 'geographical' === $xfn_relationship 1226 && strpos( $link_rel, 'co-resident' ) === false 1227 && strpos( $link_rel, 'neighbor' ) === false 1217 && ! array_intersect( $link_rels, array( 'friend', 'acquaintance', 'contact' ) ) 1228 1218 ) { 1229 1219 echo ' checked="checked"'; 1230 1220 } 1231 1221 1222 if ( 'geographical' === $xfn_relationship 1223 && ! array_intersect( $link_rels, array( 'co-resident', 'neighbor' ) ) 1224 ) { 1225 echo ' checked="checked"'; 1226 } 1227 1228 // Mark the 'me' value as checked if it matches the link relationship. 1232 1229 if ( 'identity' === $xfn_relationship 1233 && in_array( 'me', $ rels, true )1230 && in_array( 'me', $link_rels, true ) 1234 1231 ) { 1235 1232 echo ' checked="checked"';
Note: See TracChangeset
for help on using the changeset viewer.