/
home
/
altere25
/
berryglowbeauty.com
/
wp-includes
/
/home/altere25/berryglowbeauty.com/wp-includes
mkdir
upload
Name
Size
Mode
Actions
blocks/
-
0755
rm
certificates/
-
0755
rm
css/
-
0755
rm
customize/
-
0755
rm
fonts/
-
0755
rm
ID3/
-
0755
rm
images/
-
0755
rm
IXR/
-
0755
rm
js/
-
0755
rm
pomo/
-
0755
rm
random_compat/
-
0755
rm
Requests/
-
0755
rm
rest-api/
-
0755
rm
SimplePie/
-
0755
rm
sodium_compat/
-
0755
rm
Text/
-
0755
rm
theme-compat/
-
0755
rm
widgets/
-
0755
rm
.htaccess
178
0644
edit
dl
rm
admin-bar.php
30952
0644
edit
dl
rm
atomlib.php
11840
0644
edit
dl
rm
author-template.php
16995
0644
edit
dl
rm
blocks.php
19242
0644
edit
dl
rm
bookmark-template.php
12497
0644
edit
dl
rm
bookmark.php
15014
0644
edit
dl
rm
cache.php
21874
0644
edit
dl
rm
canonical.php
29474
0644
edit
dl
rm
capabilities.php
34089
0644
edit
dl
rm
category-template.php
52638
0644
edit
dl
rm
category.php
12378
0644
edit
dl
rm
class-feed.php
544
0644
edit
dl
rm
class-http.php
38763
0644
edit
dl
rm
class-IXR.php
2573
0644
edit
dl
rm
class-json.php
43390
0644
edit
dl
rm
class-oembed.php
410
0644
edit
dl
rm
class-phpass.php
7317
0644
edit
dl
rm
class-phpmailer.php
148592
0644
edit
dl
rm
class-pop3.php
20919
0644
edit
dl
rm
class-requests.php
29798
0644
edit
dl
rm
class-simplepie.php
89264
0644
edit
dl
rm
class-smtp.php
40919
0644
edit
dl
rm
class-snoopy.php
37785
0644
edit
dl
rm
class-walker-category-dropdown.php
2127
0644
edit
dl
rm
class-walker-category.php
7874
0644
edit
dl
rm
class-walker-comment.php
13685
0644
edit
dl
rm
class-walker-nav-menu.php
8669
0644
edit
dl
rm
class-walker-page-dropdown.php
2299
0644
edit
dl
rm
class-walker-page.php
7033
0644
edit
dl
rm
class-wp-admin-bar.php
16951
0644
edit
dl
rm
class-wp-ajax-response.php
5235
0644
edit
dl
rm
class-wp-block-parser.php
15215
0644
edit
dl
rm
class-wp-block-styles-registry.php
4663
0644
edit
dl
rm
class-wp-block-type-registry.php
5091
0644
edit
dl
rm
class-wp-block-type.php
4815
0644
edit
dl
rm
class-wp-comment-query.php
44514
0644
edit
dl
rm
class-wp-comment.php
8961
0644
edit
dl
rm
class-wp-customize-control.php
25054
0644
edit
dl
rm
class-wp-customize-manager.php
203252
0644
edit
dl
rm
class-wp-customize-nav-menus.php
54963
0644
edit
dl
rm
class-wp-customize-panel.php
9596
0644
edit
dl
rm
class-wp-customize-section.php
10168
0644
edit
dl
rm
class-wp-customize-setting.php
28191
0644
edit
dl
rm
class-wp-customize-widgets.php
66978
0644
edit
dl
rm
class-wp-date-query.php
35276
0644
edit
dl
rm
class-wp-dependency.php
2501
0644
edit
dl
rm
class-wp-editor.php
68219
0644
edit
dl
rm
class-wp-embed.php
14746
0644
edit
dl
rm
class-wp-error.php
4923
0644
edit
dl
rm
class-wp-fatal-error-handler.php
7429
0644
edit
dl
rm
class-wp-feed-cache-transient.php
2560
0644
edit
dl
rm
class-wp-feed-cache.php
749
0644
edit
dl
rm
class-wp-hook.php
14294
0644
edit
dl
rm
class-wp-http-cookie.php
7146
0644
edit
dl
rm
class-wp-http-curl.php
12327
0644
edit
dl
rm
class-wp-http-encoding.php
6542
0644
edit
dl
rm
class-wp-http-ixr-client.php
3331
0644
edit
dl
rm
class-wp-http-proxy.php
6077
0644
edit
dl
rm
class-wp-http-requests-hooks.php
1949
0644
edit
dl
rm
class-wp-http-requests-response.php
4343
0644
edit
dl
rm
class-wp-http-response.php
2951
0644
edit
dl
rm
class-wp-http-streams.php
16070
0644
edit
dl
rm
class-wp-image-editor-gd.php
13886
0644
edit
dl
rm
class-wp-image-editor-imagick.php
28828
0644
edit
dl
rm
class-wp-image-editor.php
13911
0644
edit
dl
rm
class-wp-list-util.php
6407
0644
edit
dl
rm
class-wp-locale-switcher.php
5022
0644
edit
dl
rm
class-wp-locale.php
13893
0644
edit
dl
rm
class-wp-matchesmapregex.php
1804
0644
edit
dl
rm
class-wp-meta-query.php
27847
0644
edit
dl
rm
class-wp-metadata-lazyloader.php
5384
0644
edit
dl
rm
class-wp-network-query.php
18368
0644
edit
dl
rm
class-wp-network.php
12284
0644
edit
dl
rm
class-wp-oembed-controller.php
6027
0644
edit
dl
rm
class-wp-oembed.php
30174
0644
edit
dl
rm
class-wp-paused-extensions-storage.php
4933
0644
edit
dl
rm
class-wp-post-type.php
19527
0644
edit
dl
rm
class-wp-post.php
6441
0644
edit
dl
rm
class-wp-query.php
131083
0644
edit
dl
rm
class-wp-recovery-mode-cookie-service.php
6459
0644
edit
dl
rm
class-wp-recovery-mode-email-service.php
10122
0644
edit
dl
rm
class-wp-recovery-mode-key-service.php
4284
0644
edit
dl
rm
class-wp-recovery-mode-link-service.php
3370
0644
edit
dl
rm
class-wp-recovery-mode.php
11358
0644
edit
dl
rm
class-wp-rewrite.php
59893
0644
edit
dl
rm
class-wp-role.php
2661
0644
edit
dl
rm
class-wp-roles.php
8300
0644
edit
dl
rm
class-wp-session-tokens.php
7430
0644
edit
dl
rm
class-wp-simplepie-file.php
2326
0644
edit
dl
rm
class-wp-simplepie-sanitize-kses.php
1775
0644
edit
dl
rm
class-wp-site-query.php
28531
0644
edit
dl
rm
class-wp-site.php
7367
0644
edit
dl
rm
class-wp-tax-query.php
19440
0644
edit
dl
rm
class-wp-taxonomy.php
10688
0644
edit
dl
rm
class-wp-term-query.php
35423
0644
edit
dl
rm
class-wp-term.php
5265
0644
edit
dl
rm
class-wp-text-diff-renderer-inline.php
716
0644
edit
dl
rm
class-wp-text-diff-renderer-table.php
16796
0644
edit
dl
rm
class-wp-theme.php
50973
0644
edit
dl
rm
class-wp-user-meta-session-tokens.php
2990
0644
edit
dl
rm
class-wp-user-query.php
31298
0644
edit
dl
rm
class-wp-user-request.php
1996
0644
edit
dl
rm
class-wp-user.php
21766
0644
edit
dl
rm
class-wp-walker.php
12718
0644
edit
dl
rm
class-wp-widget-factory.php
2853
0644
edit
dl
rm
class-wp-widget.php
17842
0644
edit
dl
rm
class-wp-xmlrpc-server.php
210072
0644
edit
dl
rm
class-wp.php
24551
0644
edit
dl
rm
class.wp-dependencies.php
11524
0644
edit
dl
rm
class.wp-scripts.php
17756
0644
edit
dl
rm
class.wp-styles.php
10532
0644
edit
dl
rm
comment-template.php
91640
0644
edit
dl
rm
comment.php
117233
0644
edit
dl
rm
compat.php
12982
0644
edit
dl
rm
cron.php
32451
0644
edit
dl
rm
date.php
409
0644
edit
dl
rm
default-constants.php
10122
0644
edit
dl
rm
default-filters.php
25894
0644
edit
dl
rm
default-widgets.php
2180
0644
edit
dl
rm
deprecated.php
114644
0644
edit
dl
rm
embed-template.php
344
0644
edit
dl
rm
embed.php
47367
0644
edit
dl
rm
error-protection.php
3387
0644
edit
dl
rm
error_log
1764
0644
edit
dl
rm
feed-atom-comments.php
5405
0644
edit
dl
rm
feed-atom.php
3081
0644
edit
dl
rm
feed-rdf.php
2660
0644
edit
dl
rm
feed-rss.php
1190
0644
edit
dl
rm
feed-rss2-comments.php
4150
0644
edit
dl
rm
feed-rss2.php
3782
0644
edit
dl
rm
feed.php
22022
0644
edit
dl
rm
formatting.php
298428
0644
edit
dl
rm
functions.php
228155
0644
edit
dl
rm
functions.wp-scripts.php
12824
0644
edit
dl
rm
functions.wp-styles.php
8219
0644
edit
dl
rm
general-template.php
152465
0644
edit
dl
rm
http.php
24324
0644
edit
dl
rm
kses.php
58723
0644
edit
dl
rm
l10n.php
53102
0644
edit
dl
rm
link-template.php
143524
0644
edit
dl
rm
load.php
43291
0644
edit
dl
rm
locale.php
162
0644
edit
dl
rm
media-template.php
57710
0644
edit
dl
rm
media.php
149717
0644
edit
dl
rm
meta.php
47749
0644
edit
dl
rm
ms-blogs.php
24413
0644
edit
dl
rm
ms-default-constants.php
4785
0644
edit
dl
rm
ms-default-filters.php
6414
0644
edit
dl
rm
ms-deprecated.php
21344
0644
edit
dl
rm
ms-files.php
2649
0644
edit
dl
rm
ms-functions.php
87638
0644
edit
dl
rm
ms-load.php
19624
0644
edit
dl
rm
ms-network.php
3658
0644
edit
dl
rm
ms-settings.php
4134
0644
edit
dl
rm
ms-site.php
43073
0644
edit
dl
rm
nav-menu-template.php
22053
0644
edit
dl
rm
nav-menu.php
41317
0644
edit
dl
rm
option.php
70145
0644
edit
dl
rm
pluggable-deprecated.php
6262
0644
edit
dl
rm
pluggable.php
99833
0644
edit
dl
rm
plugin.php
32317
0644
edit
dl
rm
post-formats.php
7053
0644
edit
dl
rm
post-template.php
62915
0644
edit
dl
rm
post-thumbnail-template.php
8988
0644
edit
dl
rm
post.php
244611
0644
edit
dl
rm
query.php
32929
0644
edit
dl
rm
registration-functions.php
202
0644
edit
dl
rm
registration.php
202
0644
edit
dl
rm
rest-api.php
46630
0644
edit
dl
rm
revision.php
21686
0644
edit
dl
rm
rewrite.php
18030
0644
edit
dl
rm
rss-functions.php
214
0644
edit
dl
rm
rss.php
23208
0644
edit
dl
rm
script-loader.php
113551
0644
edit
dl
rm
session.php
264
0644
edit
dl
rm
shortcodes.php
21704
0644
edit
dl
rm
spl-autoload-compat.php
443
0644
edit
dl
rm
taxonomy.php
157961
0644
edit
dl
rm
template-loader.php
3190
0644
edit
dl
rm
template.php
21046
0644
edit
dl
rm
theme.php
104876
0644
edit
dl
rm
update.php
25573
0644
edit
dl
rm
user.php
124532
0644
edit
dl
rm
vars.php
5815
0644
edit
dl
rm
version.php
762
0644
edit
dl
rm
widgets.php
58750
0644
edit
dl
rm
wlwmanifest.xml
1045
0644
edit
dl
rm
wp-db.php
103829
0644
edit
dl
rm
wp-diff.php
662
0644
edit
dl
rm
Edit:
/home/altere25/berryglowbeauty.com/wp-includes/bookmark.php
(15014B)
<?php /** * Link/Bookmark API * * @package WordPress * @subpackage Bookmark */ /** * Retrieve Bookmark data * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|stdClass $bookmark * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to * an stdClass object, an associative array, or a numeric array, respectively. Default OBJECT. * @param string $filter Optional, default is 'raw'. * @return array|object|null Type returned depends on $output value. */ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) { global $wpdb; if ( empty( $bookmark ) ) { if ( isset( $GLOBALS['link'] ) ) { $_bookmark = & $GLOBALS['link']; } else { $_bookmark = null; } } elseif ( is_object( $bookmark ) ) { wp_cache_add( $bookmark->link_id, $bookmark, 'bookmark' ); $_bookmark = $bookmark; } else { if ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) { $_bookmark = & $GLOBALS['link']; } else { $_bookmark = wp_cache_get( $bookmark, 'bookmark' ); if ( ! $_bookmark ) { $_bookmark = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark ) ); if ( $_bookmark ) { $_bookmark->link_category = array_unique( wp_get_object_terms( $_bookmark->link_id, 'link_category', array( 'fields' => 'ids' ) ) ); wp_cache_add( $_bookmark->link_id, $_bookmark, 'bookmark' ); } } } } if ( ! $_bookmark ) { return $_bookmark; } $_bookmark = sanitize_bookmark( $_bookmark, $filter ); if ( $output == OBJECT ) { return $_bookmark; } elseif ( $output == ARRAY_A ) { return get_object_vars( $_bookmark ); } elseif ( $output == ARRAY_N ) { return array_values( get_object_vars( $_bookmark ) ); } else { return $_bookmark; } } /** * Retrieve single bookmark data item or field. * * @since 2.3.0 * * @param string $field The name of the data field to return * @param int $bookmark The bookmark ID to get field * @param string $context Optional. The context of how the field will be used. * @return string|WP_Error */ function get_bookmark_field( $field, $bookmark, $context = 'display' ) { $bookmark = (int) $bookmark; $bookmark = get_bookmark( $bookmark ); if ( is_wp_error( $bookmark ) ) { return $bookmark; } if ( ! is_object( $bookmark ) ) { return ''; } if ( ! isset( $bookmark->$field ) ) { return ''; } return sanitize_bookmark_field( $field, $bookmark->$field, $bookmark->link_id, $context ); } /** * Retrieves the list of bookmarks * * Attempts to retrieve from the cache first based on MD5 hash of arguments. If * that fails, then the query will be built from the arguments and executed. The * results will be stored to the cache. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string|array $args { * Optional. String or array of arguments to retrieve bookmarks. * * @type string $orderby How to order the links by. Accepts 'id', 'link_id', 'name', 'link_name', * 'url', 'link_url', 'visible', 'link_visible', 'rating', 'link_rating', * 'owner', 'link_owner', 'updated', 'link_updated', 'notes', 'link_notes', * 'description', 'link_description', 'length' and 'rand'. * When `$orderby` is 'length', orders by the character length of * 'link_name'. Default 'name'. * @type string $order Whether to order bookmarks in ascending or descending order. * Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'. * @type int $limit Amount of bookmarks to display. Accepts any positive number or * -1 for all. Default -1. * @type string $category Comma-separated list of category ids to include links from. * Default empty. * @type string $category_name Category to retrieve links for by name. Default empty. * @type int|bool $hide_invisible Whether to show or hide links marked as 'invisible'. Accepts * 1|true or 0|false. Default 1|true. * @type int|bool $show_updated Whether to display the time the bookmark was last updated. * Accepts 1|true or 0|false. Default 0|false. * @type string $include Comma-separated list of bookmark IDs to include. Default empty. * @type string $exclude Comma-separated list of bookmark IDs to exclude. Default empty. * @type string $search Search terms. Will be SQL-formatted with wildcards before and after * and searched in 'link_url', 'link_name' and 'link_description'. * Default empty. * } * @return array List of bookmark row objects. */ function get_bookmarks( $args = '' ) { global $wpdb; $defaults = array( 'orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'include' => '', 'exclude' => '', 'search' => '', ); $parsed_args = wp_parse_args( $args, $defaults ); $key = md5( serialize( $parsed_args ) ); $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ); if ( 'rand' !== $parsed_args['orderby'] && $cache ) { if ( is_array( $cache ) && isset( $cache[ $key ] ) ) { $bookmarks = $cache[ $key ]; /** * Filters the returned list of bookmarks. * * The first time the hook is evaluated in this file, it returns the cached * bookmarks list. The second evaluation returns a cached bookmarks list if the * link category is passed but does not exist. The third evaluation returns * the full cached results. * * @since 2.1.0 * * @see get_bookmarks() * * @param array $bookmarks List of the cached bookmarks. * @param array $parsed_args An array of bookmark query arguments. */ return apply_filters( 'get_bookmarks', $bookmarks, $parsed_args ); } } if ( ! is_array( $cache ) ) { $cache = array(); } $inclusions = ''; if ( ! empty( $parsed_args['include'] ) ) { $parsed_args['exclude'] = ''; //ignore exclude, category, and category_name params if using include $parsed_args['category'] = ''; $parsed_args['category_name'] = ''; $inclinks = wp_parse_id_list( $parsed_args['include'] ); if ( count( $inclinks ) ) { foreach ( $inclinks as $inclink ) { if ( empty( $inclusions ) ) { $inclusions = ' AND ( link_id = ' . $inclink . ' '; } else { $inclusions .= ' OR link_id = ' . $inclink . ' '; } } } } if ( ! empty( $inclusions ) ) { $inclusions .= ')'; } $exclusions = ''; if ( ! empty( $parsed_args['exclude'] ) ) { $exlinks = wp_parse_id_list( $parsed_args['exclude'] ); if ( count( $exlinks ) ) { foreach ( $exlinks as $exlink ) { if ( empty( $exclusions ) ) { $exclusions = ' AND ( link_id <> ' . $exlink . ' '; } else { $exclusions .= ' AND link_id <> ' . $exlink . ' '; } } } } if ( ! empty( $exclusions ) ) { $exclusions .= ')'; } if ( ! empty( $parsed_args['category_name'] ) ) { $parsed_args['category'] = get_term_by( 'name', $parsed_args['category_name'], 'link_category' ); if ( $parsed_args['category'] ) { $parsed_args['category'] = $parsed_args['category']->term_id; } else { $cache[ $key ] = array(); wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); /** This filter is documented in wp-includes/bookmark.php */ return apply_filters( 'get_bookmarks', array(), $parsed_args ); } } $search = ''; if ( ! empty( $parsed_args['search'] ) ) { $like = '%' . $wpdb->esc_like( $parsed_args['search'] ) . '%'; $search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like ); } $category_query = ''; $join = ''; if ( ! empty( $parsed_args['category'] ) ) { $incategories = wp_parse_id_list( $parsed_args['category'] ); if ( count( $incategories ) ) { foreach ( $incategories as $incat ) { if ( empty( $category_query ) ) { $category_query = ' AND ( tt.term_id = ' . $incat . ' '; } else { $category_query .= ' OR tt.term_id = ' . $incat . ' '; } } } } if ( ! empty( $category_query ) ) { $category_query .= ") AND taxonomy = 'link_category'"; $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; } if ( $parsed_args['show_updated'] ) { $recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated '; } else { $recently_updated_test = ''; } $get_updated = ( $parsed_args['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : ''; $orderby = strtolower( $parsed_args['orderby'] ); $length = ''; switch ( $orderby ) { case 'length': $length = ', CHAR_LENGTH(link_name) AS length'; break; case 'rand': $orderby = 'rand()'; break; case 'link_id': $orderby = "$wpdb->links.link_id"; break; default: $orderparams = array(); $keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes', 'link_description' ); foreach ( explode( ',', $orderby ) as $ordparam ) { $ordparam = trim( $ordparam ); if ( in_array( 'link_' . $ordparam, $keys ) ) { $orderparams[] = 'link_' . $ordparam; } elseif ( in_array( $ordparam, $keys ) ) { $orderparams[] = $ordparam; } } $orderby = implode( ',', $orderparams ); } if ( empty( $orderby ) ) { $orderby = 'link_name'; } $order = strtoupper( $parsed_args['order'] ); if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) { $order = 'ASC'; } $visible = ''; if ( $parsed_args['hide_invisible'] ) { $visible = "AND link_visible = 'Y'"; } $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query"; $query .= " $exclusions $inclusions $search"; $query .= " ORDER BY $orderby $order"; if ( $parsed_args['limit'] != -1 ) { $query .= ' LIMIT ' . absint( $parsed_args['limit'] ); } $results = $wpdb->get_results( $query ); if ( 'rand()' !== $orderby ) { $cache[ $key ] = $results; wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); } /** This filter is documented in wp-includes/bookmark.php */ return apply_filters( 'get_bookmarks', $results, $parsed_args ); } /** * Sanitizes all bookmark fields * * @since 2.3.0 * * @param stdClass|array $bookmark Bookmark row * @param string $context Optional, default is 'display'. How to filter the * fields * @return stdClass|array Same type as $bookmark but with fields sanitized. */ function sanitize_bookmark( $bookmark, $context = 'display' ) { $fields = array( 'link_id', 'link_url', 'link_name', 'link_image', 'link_target', 'link_category', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_updated', 'link_rel', 'link_notes', 'link_rss', ); if ( is_object( $bookmark ) ) { $do_object = true; $link_id = $bookmark->link_id; } else { $do_object = false; $link_id = $bookmark['link_id']; } foreach ( $fields as $field ) { if ( $do_object ) { if ( isset( $bookmark->$field ) ) { $bookmark->$field = sanitize_bookmark_field( $field, $bookmark->$field, $link_id, $context ); } } else { if ( isset( $bookmark[ $field ] ) ) { $bookmark[ $field ] = sanitize_bookmark_field( $field, $bookmark[ $field ], $link_id, $context ); } } } return $bookmark; } /** * Sanitizes a bookmark field. * * Sanitizes the bookmark fields based on what the field name is. If the field * has a strict value set, then it will be tested for that, else a more generic * filtering is applied. After the more strict filter is applied, if the `$context` * is 'raw' then the value is immediately return. * * Hooks exist for the more generic cases. With the 'edit' context, the {@see 'edit_$field'} * filter will be called and passed the `$value` and `$bookmark_id` respectively. * * With the 'db' context, the {@see 'pre_$field'} filter is called and passed the value. * The 'display' context is the final context and has the `$field` has the filter name * and is passed the `$value`, `$bookmark_id`, and `$context`, respectively. * * @since 2.3.0 * * @param string $field The bookmark field. * @param mixed $value The bookmark field value. * @param int $bookmark_id Bookmark ID. * @param string $context How to filter the field value. Accepts 'raw', 'edit', 'attribute', * 'js', 'db', or 'display' * @return mixed The filtered value. */ function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) { switch ( $field ) { case 'link_id': // ints case 'link_rating': $value = (int) $value; break; case 'link_category': // array( ints ) $value = array_map( 'absint', (array) $value ); // 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 return $value; case 'link_visible': // bool stored as Y|N $value = preg_replace( '/[^YNyn]/', '', $value ); break; case 'link_target': // "enum" $targets = array( '_top', '_blank' ); if ( ! in_array( $value, $targets ) ) { $value = ''; } break; } if ( 'raw' == $context ) { return $value; } if ( 'edit' == $context ) { /** This filter is documented in wp-includes/post.php */ $value = apply_filters( "edit_{$field}", $value, $bookmark_id ); if ( 'link_notes' == $field ) { $value = esc_html( $value ); // textarea_escaped } else { $value = esc_attr( $value ); } } elseif ( 'db' == $context ) { /** This filter is documented in wp-includes/post.php */ $value = apply_filters( "pre_{$field}", $value ); } else { /** This filter is documented in wp-includes/post.php */ $value = apply_filters( "{$field}", $value, $bookmark_id, $context ); if ( 'attribute' == $context ) { $value = esc_attr( $value ); } elseif ( 'js' == $context ) { $value = esc_js( $value ); } } return $value; } /** * Deletes the bookmark cache. * * @since 2.7.0 * * @param int $bookmark_id Bookmark ID. */ function clean_bookmark_cache( $bookmark_id ) { wp_cache_delete( $bookmark_id, 'bookmark' ); wp_cache_delete( 'get_bookmarks', 'bookmark' ); clean_object_term_cache( $bookmark_id, 'link' ); }
Save
cmd:
run