mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 06:42:56 +02:00
In wp-includes/bookmark.php
, remove dead code:
* In `get_bookmarks()`, `$cache` is set twice before it is used. * In `sanitize_bookmark_field()`, `break` is unreachable after `return` See #27882. Built from https://develop.svn.wordpress.org/trunk@28316 git-svn-id: http://core.svn.wordpress.org/trunk@28144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5f27d149a3
commit
63a210e7c8
@ -132,7 +132,6 @@ function get_bookmarks($args = '') {
|
|||||||
$r = wp_parse_args( $args, $defaults );
|
$r = wp_parse_args( $args, $defaults );
|
||||||
extract( $r, EXTR_SKIP );
|
extract( $r, EXTR_SKIP );
|
||||||
|
|
||||||
$cache = array();
|
|
||||||
$key = md5( serialize( $r ) );
|
$key = md5( serialize( $r ) );
|
||||||
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
|
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
|
||||||
if ( is_array($cache) && isset( $cache[ $key ] ) ) {
|
if ( is_array($cache) && isset( $cache[ $key ] ) ) {
|
||||||
@ -356,7 +355,7 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
|
|||||||
// We return here so that the categories aren't filtered.
|
// We return here so that the categories aren't filtered.
|
||||||
// The 'link_category' filter is for the name of a link category, not an array of a link's link categories
|
// The 'link_category' filter is for the name of a link category, not an array of a link's link categories
|
||||||
return $value;
|
return $value;
|
||||||
break;
|
|
||||||
case 'link_visible' : // bool stored as Y|N
|
case 'link_visible' : // bool stored as Y|N
|
||||||
$value = preg_replace('/[^YNyn]/', '', $value);
|
$value = preg_replace('/[^YNyn]/', '', $value);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user