diff --git a/src/wp-admin/admin-ajax.php b/src/wp-admin/admin-ajax.php
index 3ad60f95766e3..237645801143f 100644
--- a/src/wp-admin/admin-ajax.php
+++ b/src/wp-admin/admin-ajax.php
@@ -61,14 +61,12 @@
'image-editor',
'delete-comment',
'delete-tag',
- 'delete-link',
'delete-meta',
'delete-post',
'trash-post',
'untrash-post',
'delete-page',
'dim-comment',
- 'add-link-category',
'add-tag',
'get-tagcloud',
'get-comments',
diff --git a/src/wp-admin/edit-link-form.php b/src/wp-admin/edit-link-form.php
deleted file mode 100644
index 33e14da3fda4f..0000000000000
--- a/src/wp-admin/edit-link-form.php
+++ /dev/null
@@ -1,180 +0,0 @@
-Links / Edit Link' ), 'link-manager.php' );
- $submit_text = __( 'Update Link' );
- $form_name = 'editlink';
- $nonce_action = 'update-bookmark_' . $link_id;
-} else {
- /* translators: %s: URL to Links screen. */
- $heading = sprintf( __( 'Links / Add Link' ), 'link-manager.php' );
- $submit_text = __( 'Add Link' );
- $form_name = 'addlink';
- $nonce_action = 'add-bookmark';
-}
-
-require_once ABSPATH . 'wp-admin/includes/meta-boxes.php';
-
-add_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' );
-add_meta_box( 'linkcategorydiv', __( 'Categories' ), 'link_categories_meta_box', null, 'normal', 'core' );
-add_meta_box( 'linktargetdiv', __( 'Target' ), 'link_target_meta_box', null, 'normal', 'core' );
-add_meta_box( 'linkxfndiv', __( 'Link Relationship (XFN)' ), 'link_xfn_meta_box', null, 'normal', 'core' );
-add_meta_box( 'linkadvanceddiv', __( 'Advanced' ), 'link_advanced_meta_box', null, 'normal', 'core' );
-
-/** This action is documented in wp-admin/includes/meta-boxes.php */
-do_action( 'add_meta_boxes', 'link', $link );
-
-/**
- * Fires when link-specific meta boxes are added.
- *
- * @since 3.0.0
- *
- * @param object $link Link object.
- */
-do_action( 'add_meta_boxes_link', $link );
-
-/** This action is documented in wp-admin/includes/meta-boxes.php */
-do_action( 'do_meta_boxes', 'link', 'normal', $link );
-/** This action is documented in wp-admin/includes/meta-boxes.php */
-do_action( 'do_meta_boxes', 'link', 'advanced', $link );
-/** This action is documented in wp-admin/includes/meta-boxes.php */
-do_action( 'do_meta_boxes', 'link', 'side', $link );
-
-add_screen_option(
- 'layout_columns',
- array(
- 'max' => 2,
- 'default' => 2,
- )
-);
-
-get_current_screen()->add_help_tab(
- array(
- 'id' => 'overview',
- 'title' => __( 'Overview' ),
- 'content' =>
- '
' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '
' .
- '' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you do not use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '
' .
- '' . __( 'XFN stands for XHTML Friends Network , which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '
',
- )
-);
-
-get_current_screen()->set_help_sidebar(
- '' . __( 'For more information:' ) . '
' .
- '' . __( 'Documentation on Creating Links ' ) . '
' .
- '' . __( 'Support forums ' ) . '
'
-);
-
-require_once ABSPATH . 'wp-admin/admin-header.php';
-?>
-
-
-
-
-
-
-
-
-
-
- 'message',
- 'additional_classes' => array( 'updated' ),
- 'dismissible' => true,
- )
- );
-}
-?>
-
-
-
diff --git a/src/wp-admin/includes/admin.php b/src/wp-admin/includes/admin.php
index ce2ec0c68b855..06da64b5df5f0 100644
--- a/src/wp-admin/includes/admin.php
+++ b/src/wp-admin/includes/admin.php
@@ -21,9 +21,6 @@
/** WordPress Administration Hooks */
require_once ABSPATH . 'wp-admin/includes/admin-filters.php';
-/** WordPress Bookmark Administration API */
-require_once ABSPATH . 'wp-admin/includes/bookmark.php';
-
/** WordPress Comment Administration API */
require_once ABSPATH . 'wp-admin/includes/comment.php';
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
index 747bcc75e53eb..71d7593972c47 100644
--- a/src/wp-admin/includes/ajax-actions.php
+++ b/src/wp-admin/includes/ajax-actions.php
@@ -834,27 +834,6 @@ function wp_ajax_delete_tag() {
*
* @since 3.1.0
*/
-function wp_ajax_delete_link() {
- $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
-
- check_ajax_referer( "delete-bookmark_$id" );
-
- if ( ! current_user_can( 'manage_links' ) ) {
- wp_die( -1 );
- }
-
- $link = get_bookmark( $id );
- if ( ! $link || is_wp_error( $link ) ) {
- wp_die( 1 );
- }
-
- if ( wp_delete_link( $id ) ) {
- wp_die( 1 );
- } else {
- wp_die( 0 );
- }
-}
-
/**
* Handles deleting meta via AJAX.
*
@@ -1048,60 +1027,6 @@ function wp_ajax_dim_comment() {
wp_die( 0 );
}
-/**
- * Handles adding a link category via AJAX.
- *
- * @since 3.1.0
- *
- * @param string $action Action to perform.
- */
-function wp_ajax_add_link_category( $action ) {
- if ( empty( $action ) ) {
- $action = 'add-link-category';
- }
-
- check_ajax_referer( $action );
-
- $taxonomy_object = get_taxonomy( 'link_category' );
-
- if ( ! current_user_can( $taxonomy_object->cap->manage_terms ) ) {
- wp_die( -1 );
- }
-
- $names = explode( ',', wp_unslash( $_POST['newcat'] ) );
- $response = new WP_Ajax_Response();
-
- foreach ( $names as $category_name ) {
- $category_name = trim( $category_name );
- $slug = sanitize_title( $category_name );
-
- if ( '' === $slug ) {
- continue;
- }
-
- $category_id = wp_insert_term( $category_name, 'link_category' );
-
- if ( ! $category_id || is_wp_error( $category_id ) ) {
- continue;
- } else {
- $category_id = $category_id['term_id'];
- }
-
- $category_name = esc_html( $category_name );
-
- $response->add(
- array(
- 'what' => 'link-category',
- 'id' => $category_id,
- 'data' => " $category_name ",
- 'position' => -1,
- )
- );
- }
-
- $response->send();
-}
-
/**
* Handles adding a tag via AJAX.
*
diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php
deleted file mode 100644
index c64bac144c588..0000000000000
--- a/src/wp-admin/includes/bookmark.php
+++ /dev/null
@@ -1,380 +0,0 @@
-' . __( 'You need a higher level of permission.' ) . '' .
- '' . __( 'Sorry, you are not allowed to edit the links for this site.' ) . '
',
- 403
- );
- }
-
- $_POST['link_url'] = esc_url( $_POST['link_url'] );
- $_POST['link_name'] = esc_html( $_POST['link_name'] );
- $_POST['link_image'] = esc_html( $_POST['link_image'] );
- $_POST['link_rss'] = esc_url( $_POST['link_rss'] );
- if ( ! isset( $_POST['link_visible'] ) || 'N' !== $_POST['link_visible'] ) {
- $_POST['link_visible'] = 'Y';
- }
-
- if ( ! empty( $link_id ) ) {
- $_POST['link_id'] = $link_id;
- return wp_update_link( $_POST );
- } else {
- return wp_insert_link( $_POST );
- }
-}
-
-/**
- * Retrieves the default link for editing.
- *
- * @since 2.0.0
- *
- * @return stdClass Default link object.
- */
-function get_default_link_to_edit() {
- $link = new stdClass();
- if ( isset( $_GET['linkurl'] ) ) {
- $link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
- } else {
- $link->link_url = '';
- }
-
- if ( isset( $_GET['name'] ) ) {
- $link->link_name = esc_attr( wp_unslash( $_GET['name'] ) );
- } else {
- $link->link_name = '';
- }
-
- $link->link_visible = 'Y';
-
- return $link;
-}
-
-/**
- * Deletes a specified link from the database.
- *
- * @since 2.0.0
- *
- * @global wpdb $wpdb WordPress database abstraction object.
- *
- * @param int $link_id ID of the link to delete.
- * @return true Always true.
- */
-function wp_delete_link( $link_id ) {
- global $wpdb;
- /**
- * Fires before a link is deleted.
- *
- * @since 2.0.0
- *
- * @param int $link_id ID of the link to delete.
- */
- do_action( 'delete_link', $link_id );
-
- wp_delete_object_term_relationships( $link_id, 'link_category' );
-
- $wpdb->delete( $wpdb->links, array( 'link_id' => $link_id ) );
-
- /**
- * Fires after a link has been deleted.
- *
- * @since 2.2.0
- *
- * @param int $link_id ID of the deleted link.
- */
- do_action( 'deleted_link', $link_id );
-
- clean_bookmark_cache( $link_id );
-
- return true;
-}
-
-/**
- * Retrieves the link category IDs associated with the link specified.
- *
- * @since 2.1.0
- *
- * @param int $link_id Link ID to look up.
- * @return int[] The IDs of the requested link's categories.
- */
-function wp_get_link_cats( $link_id = 0 ) {
- $cats = wp_get_object_terms( $link_id, 'link_category', array( 'fields' => 'ids' ) );
- return array_unique( $cats );
-}
-
-/**
- * Retrieves link data based on its ID.
- *
- * @since 2.0.0
- *
- * @param int|stdClass $link Link ID or object to retrieve.
- * @return object Link object for editing.
- */
-function get_link_to_edit( $link ) {
- return get_bookmark( $link, OBJECT, 'edit' );
-}
-
-/**
- * Inserts a link into the database, or updates an existing link.
- *
- * Runs all the necessary sanitizing, provides default values if arguments are missing,
- * and finally saves the link.
- *
- * @since 2.0.0
- *
- * @global wpdb $wpdb WordPress database abstraction object.
- *
- * @param array $linkdata {
- * Elements that make up the link to insert.
- *
- * @type int $link_id Optional. The ID of the existing link if updating.
- * @type string $link_url The URL the link points to.
- * @type string $link_name The title of the link.
- * @type string $link_image Optional. A URL of an image.
- * @type string $link_target Optional. The target element for the anchor tag.
- * @type string $link_description Optional. A short description of the link.
- * @type string $link_visible Optional. 'Y' means visible, anything else means not.
- * @type int $link_owner Optional. A user ID.
- * @type int $link_rating Optional. A rating for the link.
- * @type string $link_rel Optional. A relationship of the link to you.
- * @type string $link_notes Optional. An extended description of or notes on the link.
- * @type string $link_rss Optional. A URL of an associated RSS feed.
- * @type int $link_category Optional. The term ID of the link category.
- * If empty, uses default link category.
- * }
- * @param bool $wp_error Optional. Whether to return a WP_Error object on failure. Default false.
- * @return int|WP_Error The link ID on success. The value 0 or WP_Error on failure.
- */
-function wp_insert_link( $linkdata, $wp_error = false ) {
- global $wpdb;
-
- $defaults = array(
- 'link_id' => 0,
- 'link_name' => '',
- 'link_url' => '',
- 'link_rating' => 0,
- );
-
- $parsed_args = wp_parse_args( $linkdata, $defaults );
- $parsed_args = wp_unslash( sanitize_bookmark( $parsed_args, 'db' ) );
-
- $link_id = $parsed_args['link_id'];
- $link_name = $parsed_args['link_name'];
- $link_url = $parsed_args['link_url'];
-
- $update = false;
- if ( ! empty( $link_id ) ) {
- $update = true;
- }
-
- if ( '' === trim( $link_name ) ) {
- if ( '' !== trim( $link_url ) ) {
- $link_name = $link_url;
- } else {
- return 0;
- }
- }
-
- if ( '' === trim( $link_url ) ) {
- return 0;
- }
-
- $link_rating = ( ! empty( $parsed_args['link_rating'] ) ) ? $parsed_args['link_rating'] : 0;
- $link_image = ( ! empty( $parsed_args['link_image'] ) ) ? $parsed_args['link_image'] : '';
- $link_target = ( ! empty( $parsed_args['link_target'] ) ) ? $parsed_args['link_target'] : '';
- $link_visible = ( ! empty( $parsed_args['link_visible'] ) ) ? $parsed_args['link_visible'] : 'Y';
- $link_owner = ( ! empty( $parsed_args['link_owner'] ) ) ? $parsed_args['link_owner'] : get_current_user_id();
- $link_notes = ( ! empty( $parsed_args['link_notes'] ) ) ? $parsed_args['link_notes'] : '';
- $link_description = ( ! empty( $parsed_args['link_description'] ) ) ? $parsed_args['link_description'] : '';
- $link_rss = ( ! empty( $parsed_args['link_rss'] ) ) ? $parsed_args['link_rss'] : '';
- $link_rel = ( ! empty( $parsed_args['link_rel'] ) ) ? $parsed_args['link_rel'] : '';
- $link_category = ( ! empty( $parsed_args['link_category'] ) ) ? $parsed_args['link_category'] : array();
- $link_updated = gmdate( 'Y-m-d H:i:s', current_time( 'timestamp', 0 ) );
-
- // Make sure we set a valid category.
- if ( ! is_array( $link_category ) || 0 === count( $link_category ) ) {
- $link_category = array( get_option( 'default_link_category' ) );
- }
-
- if ( $update ) {
- if ( false === $wpdb->update( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss', 'link_updated' ), compact( 'link_id' ) ) ) {
- if ( $wp_error ) {
- return new WP_Error( 'db_update_error', __( 'Could not update link in the database.' ), $wpdb->last_error );
- } else {
- return 0;
- }
- }
- } else {
- if ( false === $wpdb->insert( $wpdb->links, compact( 'link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss', 'link_updated' ) ) ) {
- if ( $wp_error ) {
- return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database.' ), $wpdb->last_error );
- } else {
- return 0;
- }
- }
- $link_id = (int) $wpdb->insert_id;
- }
-
- wp_set_link_cats( $link_id, $link_category );
-
- if ( $update ) {
- /**
- * Fires after a link was updated in the database.
- *
- * @since 2.0.0
- *
- * @param int $link_id ID of the link that was updated.
- */
- do_action( 'edit_link', $link_id );
- } else {
- /**
- * Fires after a link was added to the database.
- *
- * @since 2.0.0
- *
- * @param int $link_id ID of the link that was added.
- */
- do_action( 'add_link', $link_id );
- }
- clean_bookmark_cache( $link_id );
-
- return $link_id;
-}
-
-/**
- * Updates link with the specified link categories.
- *
- * @since 2.1.0
- *
- * @param int $link_id ID of the link to update.
- * @param int[] $link_categories Array of link category IDs to add the link to.
- */
-function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
- // If $link_categories isn't already an array, make it one:
- if ( ! is_array( $link_categories ) || 0 === count( $link_categories ) ) {
- $link_categories = array( get_option( 'default_link_category' ) );
- }
-
- $link_categories = array_map( 'intval', $link_categories );
- $link_categories = array_unique( $link_categories );
-
- wp_set_object_terms( $link_id, $link_categories, 'link_category' );
-
- clean_bookmark_cache( $link_id );
-}
-
-/**
- * Updates a link in the database.
- *
- * @since 2.0.0
- *
- * @param array $linkdata Link data to update. See wp_insert_link() for accepted arguments.
- * @return int The updated link ID on success. The value 0 on failure.
- */
-function wp_update_link( $linkdata ) {
- $link_id = (int) $linkdata['link_id'];
-
- $link = get_bookmark( $link_id, ARRAY_A );
-
- // Escape data pulled from DB.
- $link = wp_slash( $link );
-
- // Passed link category list overwrites existing category list if not empty.
- if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] )
- && count( $linkdata['link_category'] ) > 0
- ) {
- $link_cats = $linkdata['link_category'];
- } else {
- $link_cats = $link['link_category'];
- }
-
- // Merge old and new fields with new fields overwriting old ones.
- $linkdata = array_merge( $link, $linkdata );
- $linkdata['link_category'] = $link_cats;
-
- return wp_insert_link( $linkdata );
-}
-
-/**
- * Outputs the 'disabled' message for the WordPress Link Manager.
- *
- * @since 3.5.0
- * @access private
- *
- * @global string $pagenow The filename of the current screen.
- */
-function wp_link_manager_disabled_message() {
- global $pagenow;
-
- if ( ! in_array( $pagenow, array( 'link-manager.php', 'link-add.php', 'link.php' ), true ) ) {
- return;
- }
-
- add_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );
- $really_can_manage_links = current_user_can( 'manage_links' );
- remove_filter( 'pre_option_link_manager_enabled', '__return_true', 100 );
-
- if ( $really_can_manage_links ) {
- $plugins = get_plugins();
-
- if ( empty( $plugins['link-manager/link-manager.php'] ) ) {
- if ( current_user_can( 'install_plugins' ) ) {
- $install_url = wp_nonce_url(
- self_admin_url( 'update.php?action=install-plugin&plugin=link-manager' ),
- 'install-plugin_link-manager'
- );
-
- wp_die(
- sprintf(
- /* translators: %s: A link to install the Link Manager plugin. */
- __( 'If you are looking to use the link manager, please install the Link Manager plugin .' ),
- esc_url( $install_url )
- )
- );
- }
- } elseif ( is_plugin_inactive( 'link-manager/link-manager.php' ) ) {
- if ( current_user_can( 'activate_plugins' ) ) {
- $activate_url = wp_nonce_url(
- self_admin_url( 'plugins.php?action=activate&plugin=link-manager/link-manager.php' ),
- 'activate-plugin_link-manager/link-manager.php'
- );
-
- wp_die(
- sprintf(
- /* translators: %s: A link to activate the Link Manager plugin. */
- __( 'Please activate the Link Manager plugin to use the link manager.' ),
- esc_url( $activate_url )
- )
- );
- }
- }
- }
-
- wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
-}
diff --git a/src/wp-admin/includes/class-wp-links-list-table.php b/src/wp-admin/includes/class-wp-links-list-table.php
deleted file mode 100644
index ae1f50175c35b..0000000000000
--- a/src/wp-admin/includes/class-wp-links-list-table.php
+++ /dev/null
@@ -1,385 +0,0 @@
- 'bookmarks',
- 'screen' => $args['screen'] ?? null,
- )
- );
- }
-
- /**
- * @return bool
- */
- public function ajax_user_can() {
- return current_user_can( 'manage_links' );
- }
-
- /**
- * @global int $cat_id Link category ID.
- * @global string $s Search string.
- * @global string $orderby The field to order the links by.
- * @global string $order The direction to order the links.
- */
- public function prepare_items() {
- global $cat_id, $s, $orderby, $order;
-
- $cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
- $orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : '';
- $order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : '';
- $s = ! empty( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '';
-
- $args = array(
- 'hide_invisible' => 0,
- 'hide_empty' => 0,
- );
-
- if ( 'all' !== $cat_id ) {
- $args['category'] = $cat_id;
- }
- if ( ! empty( $s ) ) {
- $args['search'] = $s;
- }
- if ( ! empty( $orderby ) ) {
- $args['orderby'] = $orderby;
- }
- if ( ! empty( $order ) ) {
- $args['order'] = $order;
- }
-
- $this->items = get_bookmarks( $args );
- }
-
- /**
- * Displays the message for no items.
- */
- public function no_items() {
- _e( 'No links found.' );
- }
-
- /**
- * Gets the list of bulk actions.
- *
- * @return array
- */
- protected function get_bulk_actions() {
- $actions = array();
- $actions['delete'] = __( 'Delete' );
-
- return $actions;
- }
-
- /**
- * @global int $cat_id Link category ID.
- * @param string $which The location: 'top' or 'bottom'.
- */
- protected function extra_tablenav( $which ) {
- global $cat_id;
-
- if ( 'top' !== $which ) {
- return;
- }
- ?>
-
- $cat_id,
- 'name' => 'cat_id',
- 'taxonomy' => 'link_category',
- 'show_option_all' => get_taxonomy( 'link_category' )->labels->all_items,
- 'hide_empty' => true,
- 'hierarchical' => 1,
- 'show_count' => 0,
- 'orderby' => 'name',
- );
-
- echo '' . get_taxonomy( 'link_category' )->labels->filter_by_item . ' ';
-
- wp_dropdown_categories( $dropdown_options );
-
- submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
- ?>
-
- ' ',
- 'name' => _x( 'Name', 'link name' ),
- 'url' => __( 'URL' ),
- 'categories' => __( 'Categories' ),
- 'rel' => __( 'Relationship' ),
- 'visible' => __( 'Visible' ),
- 'rating' => __( 'Rating' ),
- );
- }
-
- /**
- * Gets the list of sortable columns.
- *
- * @return array
- */
- protected function get_sortable_columns() {
- return array(
- 'name' => array( 'name', false, _x( 'Name', 'link name' ), __( 'Table ordered by Name.' ), 'asc' ),
- 'url' => array( 'url', false, __( 'URL' ), __( 'Table ordered by URL.' ) ),
- 'visible' => array( 'visible', false, __( 'Visible' ), __( 'Table ordered by Visibility.' ) ),
- 'rating' => array( 'rating', false, __( 'Rating' ), __( 'Table ordered by Rating.' ) ),
- );
- }
-
- /**
- * Gets the name of the default primary column.
- *
- * @since 4.3.0
- *
- * @return string Name of the default primary column, in this case, 'name'.
- */
- protected function get_default_primary_column_name() {
- return 'name';
- }
-
- /**
- * Handles the checkbox column output.
- *
- * @since 4.3.0
- * @since 5.9.0 Renamed `$link` to `$item` to match parent class for PHP 8 named parameter support.
- *
- * @param object $item The current link object.
- */
- public function column_cb( $item ) {
- // Restores the more descriptive, specific name for use within this method.
- $link = $item;
-
- ?>
-
-
-
- link_name );
- ?>
-
-
- %s ',
- $edit_link,
- /* translators: %s: Link name. */
- esc_attr( sprintf( __( 'Edit “%s”' ), $link->link_name ) ),
- $link->link_name
- );
- }
-
- /**
- * Handles the link URL column output.
- *
- * @since 4.3.0
- *
- * @param object $link The current link object.
- */
- public function column_url( $link ) {
- $short_url = url_shorten( $link->link_url );
- echo "$short_url ";
- }
-
- /**
- * Handles the link categories column output.
- *
- * @since 4.3.0
- *
- * @global int $cat_id Link category ID.
- *
- * @param object $link The current link object.
- */
- public function column_categories( $link ) {
- global $cat_id;
-
- $cat_names = array();
- foreach ( $link->link_category as $category ) {
- $cat = get_term( $category, 'link_category', OBJECT, 'display' );
- if ( is_wp_error( $cat ) ) {
- echo $cat->get_error_message();
- }
- $cat_name = $cat->name;
- if ( (int) $cat_id !== $category ) {
- $cat_name = "$cat_name ";
- }
- $cat_names[] = $cat_name;
- }
- echo implode( ', ', $cat_names );
- }
-
- /**
- * Handles the link relation column output.
- *
- * @since 4.3.0
- *
- * @param object $link The current link object.
- */
- public function column_rel( $link ) {
- echo empty( $link->link_rel ) ? ' ' : $link->link_rel;
- }
-
- /**
- * Handles the link visibility column output.
- *
- * @since 4.3.0
- *
- * @param object $link The current link object.
- */
- public function column_visible( $link ) {
- if ( 'Y' === $link->link_visible ) {
- _e( 'Yes' );
- } else {
- _e( 'No' );
- }
- }
-
- /**
- * Handles the link rating column output.
- *
- * @since 4.3.0
- *
- * @param object $link The current link object.
- */
- public function column_rating( $link ) {
- echo $link->link_rating;
- }
-
- /**
- * Handles the default column output.
- *
- * @since 4.3.0
- * @since 5.9.0 Renamed `$link` to `$item` to match parent class for PHP 8 named parameter support.
- *
- * @param object $item Link object.
- * @param string $column_name Current column name.
- */
- public function column_default( $item, $column_name ) {
- // Restores the more descriptive, specific name for use within this method.
- $link = $item;
-
- /**
- * Fires for each registered custom link column.
- *
- * @since 2.1.0
- *
- * @param string $column_name Name of the custom column.
- * @param int $link_id Link ID.
- */
- do_action( 'manage_link_custom_column', $column_name, $link->link_id );
- }
-
- /**
- * Generates the list table rows.
- *
- * @since 3.1.0
- */
- public function display_rows() {
- foreach ( $this->items as $link ) {
- $link = sanitize_bookmark( $link );
- $link->link_name = esc_attr( $link->link_name );
- $link->link_category = wp_get_link_cats( $link->link_id );
- ?>
-
- single_row_columns( $link ); ?>
-
- ' . __( 'Edit' ) . '';
- $actions['delete'] = sprintf(
- '%s ',
- wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ),
- /* translators: %s: Link name. */
- esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ),
- __( 'Delete' )
- );
-
- return $this->row_actions( $actions );
- }
-
- /**
- * Returns a clean label for the primary (Name) column's row header `aria-label`.
- *
- * Provides screen readers with just the link name as the row header name,
- * preventing them from computing the name from the full cell content.
- *
- * @since 7.1.0
- *
- * @param object $link The current link object.
- * @return string The link name.
- */
- protected function get_primary_column_aria_label( $link ) {
- $link_name = html_entity_decode( $link->link_name, ENT_QUOTES, get_bloginfo( 'charset' ) );
- $link_name = wp_strip_all_tags( $link_name );
-
- return $link_name;
- }
-}
diff --git a/src/wp-admin/includes/list-table.php b/src/wp-admin/includes/list-table.php
index 1e2c190c80fe9..7c18fe07880b3 100644
--- a/src/wp-admin/includes/list-table.php
+++ b/src/wp-admin/includes/list-table.php
@@ -27,7 +27,6 @@ function _get_list_table( $class_name, $args = array() ) {
'WP_Users_List_Table' => 'users',
'WP_Comments_List_Table' => 'comments',
'WP_Post_Comments_List_Table' => array( 'comments', 'post-comments' ),
- 'WP_Links_List_Table' => 'links',
'WP_Plugin_Install_List_Table' => 'plugin-install',
'WP_Themes_List_Table' => 'themes',
'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ),
diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php
index 535a00cd3fe94..82a658f73c9eb 100644
--- a/src/wp-admin/includes/meta-boxes.php
+++ b/src/wp-admin/includes/meta-boxes.php
@@ -1090,397 +1090,11 @@ function page_attributes_meta_box( $post ) {
// Link-related Meta Boxes.
//
-/**
- * Displays link create form fields.
- *
- * @since 2.7.0
- *
- * @param object $link Current link object.
- */
-function link_submit_meta_box( $link ) {
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
- link_visible, 'N' ); ?> />
-
-
-
-
-
-
-
-
- %s',
- wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ),
- /* translators: %s: Link name. */
- esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ),
- __( 'Delete' )
- );
- }
- ?>
-
-
-
- link_id ) ) { ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- link_target ) && ( '_blank' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
- _blank — new window or tab.' ); ?>
-
- link_target ) && ( '_top' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
- _top — current window or tab, with no frames.' ); ?>
-
- link_target ) && ( '' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
- _none — same window or tab.' ); ?>
-
-
- link_rel ?? '';
- $link_rels = preg_split( '/\s+/', $link_rel );
-
- // Mark the specified value as checked if it matches the current link's relationship.
- if ( '' !== $xfn_value && in_array( $xfn_value, $link_rels, true ) ) {
- echo ' checked="checked"';
- }
-
- if ( '' === $xfn_value ) {
- // Mark the 'none' value as checked if the current link does not match the specified relationship.
- if ( 'family' === $xfn_relationship
- && ! array_intersect( $link_rels, array( 'child', 'parent', 'sibling', 'spouse', 'kin' ) )
- ) {
- echo ' checked="checked"';
- }
- if ( 'friendship' === $xfn_relationship
- && ! array_intersect( $link_rels, array( 'friend', 'acquaintance', 'contact' ) )
- ) {
- echo ' checked="checked"';
- }
- if ( 'geographical' === $xfn_relationship
- && ! array_intersect( $link_rels, array( 'co-resident', 'neighbor' ) )
- ) {
- echo ' checked="checked"';
- }
- // Mark the 'me' value as checked if it matches the current link's relationship.
- if ( 'identity' === $xfn_relationship
- && in_array( 'me', $link_rels, true )
- ) {
- echo ' checked="checked"';
- }
- }
-}
-/**
- * Displays XFN form fields.
- *
- * @since 2.6.0
- *
- * @param object $link Current link object.
- */
-function link_xfn_meta_box( $link ) {
- ?>
-
-XFN.' ); ?>
-
-
- 'link_category',
- 'orderby' => 'name',
- 'hide_empty' => 0,
- )
- );
-
- if ( empty( $categories ) ) {
- return;
- }
-
- foreach ( $categories as $category ) {
- $cat_id = $category->term_id;
-
- /** This filter is documented in wp-includes/category-template.php */
- $name = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );
- $checked = in_array( $cat_id, $checked_categories, true ) ? ' checked="checked"' : '';
- echo ' ', $name, ' ';
- }
-}
/**
* Adds hidden fields with the data for use in the inline editor for posts and pages.
diff --git a/src/wp-admin/link-add.php b/src/wp-admin/link-add.php
deleted file mode 100644
index c99630990cfbe..0000000000000
--- a/src/wp-admin/link-add.php
+++ /dev/null
@@ -1,34 +0,0 @@
-current_action();
-
-if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
- check_admin_referer( 'bulk-bookmarks' );
-
- $redirect_to = admin_url( 'link-manager.php' );
- $bulklinks = (array) $_REQUEST['linkcheck'];
-
- if ( 'delete' === $doaction ) {
- foreach ( $bulklinks as $link_id ) {
- $link_id = (int) $link_id;
-
- wp_delete_link( $link_id );
- }
-
- $redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to );
- } else {
- $screen = get_current_screen()->id;
-
- /** This action is documented in wp-admin/edit.php */
- $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
- }
- wp_redirect( $redirect_to );
- exit;
-} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
- wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
- exit;
-}
-
-$wp_list_table->prepare_items();
-
-// Used in the HTML title tag.
-$title = __( 'Links' );
-$this_file = 'link-manager.php';
-$parent_file = $this_file;
-
-get_current_screen()->add_help_tab(
- array(
- 'id' => 'overview',
- 'title' => __( 'Overview' ),
- 'content' =>
- '' . sprintf(
- /* translators: %s: URL to Widgets screen. */
- __( 'You can add links here to be displayed on your site, usually using Widgets . By default, links to several sites in the WordPress community are included as examples.' ),
- 'widgets.php'
- ) . '
' .
- '' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '
' .
- '' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '
',
- )
-);
-get_current_screen()->add_help_tab(
- array(
- 'id' => 'deleting-links',
- 'title' => __( 'Deleting Links' ),
- 'content' =>
- '' . __( 'If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.' ) . '
',
- )
-);
-
-get_current_screen()->set_help_sidebar(
- '' . __( 'For more information:' ) . '
' .
- '' . __( 'Documentation on Managing Links ' ) . '
' .
- '' . __( 'Support forums ' ) . '
'
-);
-
-get_current_screen()->set_screen_reader_content(
- array(
- 'heading_list' => __( 'Links list' ),
- )
-);
-
-require_once ABSPATH . 'wp-admin/admin-header.php';
-
-if ( ! current_user_can( 'manage_links' ) ) {
- wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
-}
-
-?>
-
-
-
-
-
-
-
-
-';
- printf(
- /* translators: %s: Search query. */
- __( 'Search results for: %s' ),
- '
' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . ' '
- );
- echo '';
-}
-?>
-
-
-
- 'message',
- 'additional_classes' => array( 'updated' ),
- 'dismissible' => true,
- )
- );
- $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );
-}
-?>
-
-
-
-
-
-query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
- */
-
- wp_redirect( $this_file );
- exit;
-
- case 'add':
- check_admin_referer( 'add-bookmark' );
-
- $redir = wp_get_referer();
- if ( add_link() ) {
- $redir = add_query_arg( 'added', 'true', $redir );
- }
-
- wp_redirect( $redir );
- exit;
-
- case 'save':
- $link_id = (int) $_POST['link_id'];
- check_admin_referer( 'update-bookmark_' . $link_id );
-
- edit_link( $link_id );
-
- wp_redirect( $this_file );
- exit;
-
- case 'delete':
- $link_id = (int) $_GET['link_id'];
- check_admin_referer( 'delete-bookmark_' . $link_id );
-
- wp_delete_link( $link_id );
-
- wp_redirect( $this_file );
- exit;
-
- case 'edit':
- wp_enqueue_script( 'link' );
- wp_enqueue_script( 'xfn' );
-
- if ( wp_is_mobile() ) {
- wp_enqueue_script( 'jquery-touch-punch' );
- }
-
- $parent_file = 'link-manager.php';
- $submenu_file = 'link-manager.php';
- // Used in the HTML title tag.
- $title = __( 'Edit Link' );
-
- $link_id = (int) $_GET['link_id'];
-
- $link = get_link_to_edit( $link_id );
- if ( ! $link ) {
- wp_die( __( 'Link not found.' ) );
- }
-
- require ABSPATH . 'wp-admin/edit-link-form.php';
- require_once ABSPATH . 'wp-admin/admin-footer.php';
- break;
-
- default:
- break;
-}
diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php
index 2a3430ebc3df8..164822e0fe634 100644
--- a/src/wp-admin/menu.php
+++ b/src/wp-admin/menu.php
@@ -86,11 +86,7 @@
unset( $taxonomy, $submenu_index );
-$menu[15] = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' );
- $submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' );
- $submenu['link-manager.php'][10] = array( __( 'Add Link' ), 'manage_links', 'link-add.php' );
- $submenu['link-manager.php'][15] = array( __( 'Link Categories' ), 'manage_categories', 'edit-tags.php?taxonomy=link_category' );
// $menu[20] = Pages.
diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php
index 5ba568792209c..2c267c3c5da19 100644
--- a/src/wp-includes/admin-bar.php
+++ b/src/wp-includes/admin-bar.php
@@ -1042,10 +1042,6 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
$actions['media-new.php'] = array( $cpts['attachment']->labels->name_admin_bar, 'new-media' );
}
- if ( current_user_can( 'manage_links' ) ) {
- $actions['link-add.php'] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' );
- }
-
if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->create_posts ) ) {
$actions['post-new.php?post_type=page'] = array( $cpts['page']->labels->name_admin_bar, 'new-page' );
}
diff --git a/src/wp-includes/bookmark-template.php b/src/wp-includes/bookmark-template.php
deleted file mode 100644
index 893494a7e92cd..0000000000000
--- a/src/wp-includes/bookmark-template.php
+++ /dev/null
@@ -1,328 +0,0 @@
-`.
- * @type string $after The HTML or text to append to each bookmark. Default ``.
- * @type string $link_before The HTML or text to prepend to each bookmark inside the anchor
- * tags. Default empty.
- * @type string $link_after The HTML or text to append to each bookmark inside the anchor
- * tags. Default empty.
- * @type string $between The string for use in between the link, description, and image.
- * Default "\n".
- * @type int|bool $show_rating Whether to show the link rating. Accepts 1|true or 0|false.
- * Default 0|false.
- *
- * }
- * @return string Formatted output in HTML
- */
-function _walk_bookmarks( $bookmarks, $args = '' ) {
- $defaults = array(
- 'show_updated' => 0,
- 'show_description' => 0,
- 'show_images' => 1,
- 'show_name' => 0,
- 'before' => '',
- 'after' => ' ',
- 'between' => "\n",
- 'show_rating' => 0,
- 'link_before' => '',
- 'link_after' => '',
- );
-
- $parsed_args = wp_parse_args( $args, $defaults );
-
- $output = ''; // Blank string to start with.
-
- foreach ( (array) $bookmarks as $bookmark ) {
- if ( ! isset( $bookmark->recently_updated ) ) {
- $bookmark->recently_updated = false;
- }
- $output .= $parsed_args['before'];
- if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
- $output .= '';
- }
- $the_link = '#';
- if ( ! empty( $bookmark->link_url ) ) {
- $the_link = esc_url( $bookmark->link_url );
- }
- $desc = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) );
- $name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );
- $title = $desc;
-
- if ( $parsed_args['show_updated'] ) {
- if ( ! str_starts_with( $bookmark->link_updated_f, '00' ) ) {
- $title .= ' (';
- $title .= sprintf(
- /* translators: %s: Date and time of last update. */
- __( 'Last updated: %s' ),
- gmdate(
- get_option( 'links_updated_date_format' ),
- $bookmark->link_updated_f + (int) ( (float) get_option( 'gmt_offset' ) * HOUR_IN_SECONDS )
- )
- );
- $title .= ')';
- }
- }
- $alt = ' alt="' . $name . ( $parsed_args['show_description'] ? ' ' . $title : '' ) . '"';
-
- if ( '' !== $title ) {
- $title = ' title="' . $title . '"';
- }
- $rel = $bookmark->link_rel;
-
- $target = $bookmark->link_target;
- if ( '' !== $target ) {
- $target = ' target="' . $target . '"';
- }
-
- if ( '' !== $rel ) {
- $rel = ' rel="' . esc_attr( $rel ) . '"';
- }
-
- $output .= '';
-
- $output .= $parsed_args['link_before'];
-
- if ( '' !== $bookmark->link_image && $parsed_args['show_images'] ) {
- if ( str_starts_with( $bookmark->link_image, 'http' ) ) {
- $output .= ' ';
- } else { // If it's a relative path.
- $output .= ' ';
- }
- if ( $parsed_args['show_name'] ) {
- $output .= " $name";
- }
- } else {
- $output .= $name;
- }
-
- $output .= $parsed_args['link_after'];
-
- $output .= ' ';
-
- if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
- $output .= ' ';
- }
-
- if ( $parsed_args['show_description'] && '' !== $desc ) {
- $output .= $parsed_args['between'] . $desc;
- }
-
- if ( $parsed_args['show_rating'] ) {
- $output .= $parsed_args['between'] . sanitize_bookmark_field(
- 'link_rating',
- $bookmark->link_rating,
- $bookmark->link_id,
- 'display'
- );
- }
- $output .= $parsed_args['after'] . "\n";
- } // End while.
-
- return $output;
-}
-
-/**
- * Retrieves or echoes all of the bookmarks.
- *
- * List of default arguments are as follows:
- *
- * These options define how the Category name will appear before the category
- * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will
- * display for only the 'title_li' string and only if 'title_li' is not empty.
- *
- * @since 2.1.0
- *
- * @see _walk_bookmarks()
- *
- * @param string|array $args {
- * Optional. String or array of arguments to list bookmarks.
- *
- * @type string $orderby How to order the links by. Accepts post fields. 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 1+ 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 int|bool $echo Whether to echo or return the formatted bookmarks. Accepts
- * 1|true (echo) or 0|false (return). Default 1|true.
- * @type int|bool $categorize Whether to show links listed by category or in a single column.
- * Accepts 1|true (by category) or 0|false (one column). Default 1|true.
- * @type int|bool $show_description Whether to show the bookmark descriptions. Accepts 1|true or 0|false.
- * Default 0|false.
- * @type string $title_li What to show before the links appear. Default 'Bookmarks'.
- * @type string $title_before The HTML or text to prepend to the $title_li string. Default ''.
- * @type string $title_after The HTML or text to append to the $title_li string. Default ' '.
- * @type string|array $class The CSS class or an array of classes to use for the $title_li.
- * Default 'linkcat'.
- * @type string $category_before The HTML or text to prepend to $title_before if $categorize is true.
- * String must contain '%id' and '%class' to inherit the category ID and
- * the $class argument used for formatting in themes.
- * Default ''.
- * @type string $category_after The HTML or text to append to $title_after if $categorize is true.
- * Default ' '.
- * @type string $category_orderby How to order the bookmark category based on term scheme if $categorize
- * is true. Default 'name'.
- * @type string $category_order Whether to order categories in ascending or descending order if
- * $categorize is true. Accepts 'ASC' (ascending) or 'DESC' (descending).
- * Default 'ASC'.
- * }
- * @return void|string Void if 'echo' argument is true, HTML list of bookmarks if 'echo' is false.
- */
-function wp_list_bookmarks( $args = '' ) {
- $defaults = array(
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'limit' => -1,
- 'category' => '',
- 'exclude_category' => '',
- 'category_name' => '',
- 'hide_invisible' => 1,
- 'show_updated' => 0,
- 'echo' => 1,
- 'categorize' => 1,
- 'title_li' => __( 'Bookmarks' ),
- 'title_before' => '',
- 'title_after' => ' ',
- 'category_orderby' => 'name',
- 'category_order' => 'ASC',
- 'class' => 'linkcat',
- 'category_before' => '',
- 'category_after' => ' ',
- );
-
- $parsed_args = wp_parse_args( $args, $defaults );
-
- $output = '';
-
- if ( ! is_array( $parsed_args['class'] ) ) {
- $parsed_args['class'] = explode( ' ', $parsed_args['class'] );
- }
- $parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] );
- $parsed_args['class'] = trim( implode( ' ', $parsed_args['class'] ) );
-
- if ( $parsed_args['categorize'] ) {
- $cats = get_terms(
- array(
- 'taxonomy' => 'link_category',
- 'name__like' => $parsed_args['category_name'],
- 'include' => $parsed_args['category'],
- 'exclude' => $parsed_args['exclude_category'],
- 'orderby' => $parsed_args['category_orderby'],
- 'order' => $parsed_args['category_order'],
- 'hierarchical' => 0,
- )
- );
- if ( empty( $cats ) ) {
- $parsed_args['categorize'] = false;
- }
- }
-
- if ( $parsed_args['categorize'] ) {
- // Split the bookmarks into ul's for each category.
- foreach ( (array) $cats as $cat ) {
- $params = array_merge( $parsed_args, array( 'category' => $cat->term_id ) );
- $bookmarks = get_bookmarks( $params );
- if ( empty( $bookmarks ) ) {
- continue;
- }
- $output .= str_replace(
- array( '%id', '%class' ),
- array( "linkcat-$cat->term_id", $parsed_args['class'] ),
- $parsed_args['category_before']
- );
- /**
- * Filters the category name.
- *
- * @since 2.2.0
- *
- * @param string $cat_name The category name.
- */
- $catname = apply_filters( 'link_category', $cat->name );
-
- $output .= $parsed_args['title_before'];
- $output .= $catname;
- $output .= $parsed_args['title_after'];
- $output .= "\n\t\n";
- $output .= _walk_bookmarks( $bookmarks, $parsed_args );
- $output .= "\n\t \n";
- $output .= $parsed_args['category_after'] . "\n";
- }
- } else {
- // Output one single list using title_li for the title.
- $bookmarks = get_bookmarks( $parsed_args );
-
- if ( ! empty( $bookmarks ) ) {
- if ( ! empty( $parsed_args['title_li'] ) ) {
- $output .= str_replace(
- array( '%id', '%class' ),
- array( 'linkcat-' . $parsed_args['category'], $parsed_args['class'] ),
- $parsed_args['category_before']
- );
- $output .= $parsed_args['title_before'];
- $output .= $parsed_args['title_li'];
- $output .= $parsed_args['title_after'];
- $output .= "\n\t\n";
- $output .= _walk_bookmarks( $bookmarks, $parsed_args );
- $output .= "\n\t \n";
- $output .= $parsed_args['category_after'] . "\n";
- } else {
- $output .= _walk_bookmarks( $bookmarks, $parsed_args );
- }
- }
- }
-
- /**
- * Filters the bookmarks list before it is echoed or returned.
- *
- * @since 2.5.0
- *
- * @param string $html The HTML list of bookmarks.
- */
- $html = apply_filters( 'wp_list_bookmarks', $output );
-
- if ( $parsed_args['echo'] ) {
- echo $html;
- } else {
- return $html;
- }
-}
diff --git a/src/wp-includes/bookmark.php b/src/wp-includes/bookmark.php
deleted file mode 100644
index 9e44d781909ed..0000000000000
--- a/src/wp-includes/bookmark.php
+++ /dev/null
@@ -1,472 +0,0 @@
-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 ( OBJECT === $output ) {
- return $_bookmark;
- } elseif ( ARRAY_A === $output ) {
- return get_object_vars( $_bookmark );
- } elseif ( ARRAY_N === $output ) {
- return array_values( get_object_vars( $_bookmark ) );
- } else {
- return $_bookmark;
- }
-}
-
-/**
- * Retrieves 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. Default 'display'.
- * @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 int|string $category A category ID, or a comma-separated list of category IDs to include
- * links from. Ignored if `$category_name` is passed. Default empty.
- * @type string $category_name Category to retrieve links for by name. Takes precedence over
- * `$category`. 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 object[] 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, true ) ) {
- $orderparams[] = 'link_' . $ordparam;
- } elseif ( in_array( $ordparam, $keys, true ) ) {
- $orderparams[] = $ordparam;
- }
- }
- $orderby = implode( ',', $orderparams );
- }
-
- if ( empty( $orderby ) ) {
- $orderby = 'link_name';
- }
-
- $order = strtoupper( $parsed_args['order'] );
- if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ), true ) ) {
- $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 ( -1 !== $parsed_args['limit'] ) {
- $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. How to filter the fields. Default 'display'.
- * @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', 'db',
- * 'display', 'attribute', or 'js'. Default 'display'.
- * @return mixed The filtered value.
- */
-function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) {
- $int_fields = array( 'link_id', 'link_rating' );
- if ( in_array( $field, $int_fields, true ) ) {
- $value = (int) $value;
- }
-
- switch ( $field ) {
- 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, true ) ) {
- $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 );
- }
- }
-
- // Restore the type for integer fields after esc_attr().
- if ( in_array( $field, $int_fields, true ) ) {
- $value = (int) $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' );
-}
diff --git a/src/wp-includes/capabilities.php b/src/wp-includes/capabilities.php
index 645ab5588ee5e..8070c0cd76bda 100644
--- a/src/wp-includes/capabilities.php
+++ b/src/wp-includes/capabilities.php
@@ -688,13 +688,6 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
$caps[] = 'do_not_allow';
}
break;
- case 'manage_links':
- if ( get_option( 'link_manager_enabled' ) ) {
- $caps[] = $cap;
- } else {
- $caps[] = 'do_not_allow';
- }
- break;
case 'customize':
$caps[] = 'edit_theme_options';
break;
diff --git a/src/wp-includes/default-widgets.php b/src/wp-includes/default-widgets.php
index d9f6e73dc7ac1..7206695c1453b 100644
--- a/src/wp-includes/default-widgets.php
+++ b/src/wp-includes/default-widgets.php
@@ -15,9 +15,6 @@
/** WP_Widget_Pages class */
require_once ABSPATH . WPINC . '/widgets/class-wp-widget-pages.php';
-/** WP_Widget_Links class */
-require_once ABSPATH . WPINC . '/widgets/class-wp-widget-links.php';
-
/** WP_Widget_Search class */
require_once ABSPATH . WPINC . '/widgets/class-wp-widget-search.php';
diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php
index b50328793857e..a5d2d06295cce 100644
--- a/src/wp-includes/link-template.php
+++ b/src/wp-includes/link-template.php
@@ -1669,67 +1669,7 @@ function edit_comment_link( $text = null, $before = '', $after = '' ) {
echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID, $text ) . $after;
}
-/**
- * Displays the edit bookmark link.
- *
- * @since 2.7.0
- *
- * @param int|stdClass $link Optional. Bookmark ID. Default is the ID of the current bookmark.
- * @return string|null The edit bookmark link URL.
- */
-function get_edit_bookmark_link( $link = 0 ) {
- $link = get_bookmark( $link );
- if ( ! current_user_can( 'manage_links' ) ) {
- return null;
- }
-
- $location = admin_url( 'link.php?action=edit&link_id=' ) . $link->link_id;
-
- /**
- * Filters the bookmark edit link.
- *
- * @since 2.7.0
- *
- * @param string $location The edit link.
- * @param int $link_id Bookmark ID.
- */
- return apply_filters( 'get_edit_bookmark_link', $location, $link->link_id );
-}
-
-/**
- * Displays the edit bookmark link anchor content.
- *
- * @since 2.7.0
- *
- * @param string $link Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
- * @param string $before Optional. Display before edit link. Default empty.
- * @param string $after Optional. Display after edit link. Default empty.
- * @param int $bookmark Optional. Bookmark ID. Default is the current bookmark.
- */
-function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
- $bookmark = get_bookmark( $bookmark );
-
- if ( ! current_user_can( 'manage_links' ) ) {
- return;
- }
-
- if ( empty( $link ) ) {
- $link = __( 'Edit This' );
- }
-
- $link = '' . $link . ' ';
-
- /**
- * Filters the bookmark edit link anchor tag.
- *
- * @since 2.7.0
- *
- * @param string $link Anchor tag for the edit link.
- * @param int $link_id Bookmark ID.
- */
- echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
-}
/**
* Retrieves the edit user link.
diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
index 597fdf4118d68..92f18eff17f48 100644
--- a/src/wp-includes/taxonomy.php
+++ b/src/wp-includes/taxonomy.php
@@ -133,40 +133,6 @@ function create_initial_taxonomies() {
)
);
- register_taxonomy(
- 'link_category',
- 'link',
- array(
- 'hierarchical' => false,
- 'labels' => array(
- 'name' => __( 'Link Categories' ),
- 'singular_name' => __( 'Link Category' ),
- 'search_items' => __( 'Search Link Categories' ),
- 'popular_items' => null,
- 'all_items' => __( 'All Link Categories' ),
- 'edit_item' => __( 'Edit Link Category' ),
- 'update_item' => __( 'Update Link Category' ),
- 'add_new_item' => __( 'Add Link Category' ),
- 'new_item_name' => __( 'New Link Category Name' ),
- 'separate_items_with_commas' => null,
- 'add_or_remove_items' => null,
- 'choose_from_most_used' => null,
- 'back_to_items' => __( '← Go to Link Categories' ),
- ),
- 'capabilities' => array(
- 'manage_terms' => 'manage_links',
- 'edit_terms' => 'manage_links',
- 'delete_terms' => 'manage_links',
- 'assign_terms' => 'manage_links',
- ),
- 'query_var' => false,
- 'rewrite' => false,
- 'public' => false,
- 'show_ui' => true,
- '_builtin' => true,
- )
- );
-
register_taxonomy(
'post_format',
'post',
diff --git a/src/wp-includes/theme-compat/sidebar.php b/src/wp-includes/theme-compat/sidebar.php
index f27fce57806e6..b3fd05474e00c 100644
--- a/src/wp-includes/theme-compat/sidebar.php
+++ b/src/wp-includes/theme-compat/sidebar.php
@@ -135,8 +135,6 @@
-
-
diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php
index 7a3cb5673a4fa..dac41f0318ff0 100644
--- a/src/wp-includes/widgets.php
+++ b/src/wp-includes/widgets.php
@@ -1844,9 +1844,6 @@ function wp_widgets_init() {
register_widget( 'WP_Widget_Archives' );
- if ( get_option( 'link_manager_enabled' ) ) {
- register_widget( 'WP_Widget_Links' );
- }
register_widget( 'WP_Widget_Media_Audio' );
diff --git a/src/wp-includes/widgets/class-wp-widget-links.php b/src/wp-includes/widgets/class-wp-widget-links.php
deleted file mode 100644
index 6e9c3e569437d..0000000000000
--- a/src/wp-includes/widgets/class-wp-widget-links.php
+++ /dev/null
@@ -1,188 +0,0 @@
- __( 'Your blogroll' ),
- 'customize_selective_refresh' => true,
- );
- parent::__construct( 'links', __( 'Links' ), $widget_ops );
- }
-
- /**
- * Outputs the content for the current Links widget instance.
- *
- * @since 2.8.0
- *
- * @param array $args Display arguments including 'before_title', 'after_title',
- * 'before_widget', and 'after_widget'.
- * @param array $instance Settings for the current Links widget instance.
- */
- public function widget( $args, $instance ) {
- $show_description = $instance['description'] ?? false;
- $show_name = $instance['name'] ?? false;
- $show_rating = $instance['rating'] ?? false;
- $show_images = $instance['images'] ?? true;
- $category = $instance['category'] ?? false;
- $orderby = $instance['orderby'] ?? 'name';
- $order = 'rating' === $orderby ? 'DESC' : 'ASC';
- $limit = $instance['limit'] ?? -1;
-
- $before_widget = preg_replace( '/ id="[^"]*"/', ' id="%id"', $args['before_widget'] );
-
- $widget_links_args = array(
- 'title_before' => $args['before_title'],
- 'title_after' => $args['after_title'],
- 'category_before' => $before_widget,
- 'category_after' => $args['after_widget'],
- 'show_images' => $show_images,
- 'show_description' => $show_description,
- 'show_name' => $show_name,
- 'show_rating' => $show_rating,
- 'category' => $category,
- 'class' => 'linkcat widget',
- 'orderby' => $orderby,
- 'order' => $order,
- 'limit' => $limit,
- );
-
- /**
- * Filters the arguments for the Links widget.
- *
- * @since 2.6.0
- * @since 4.4.0 Added the `$instance` parameter.
- *
- * @see wp_list_bookmarks()
- *
- * @param array $widget_links_args An array of arguments to retrieve the links list.
- * @param array $instance The settings for the particular instance of the widget.
- */
- wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) );
- }
-
- /**
- * Handles updating settings for the current Links widget instance.
- *
- * @since 2.8.0
- *
- * @param array $new_instance New settings for this instance as input by the user via
- * WP_Widget::form().
- * @param array $old_instance Old settings for this instance.
- * @return array Updated settings to save.
- */
- public function update( $new_instance, $old_instance ) {
- $new_instance = (array) $new_instance;
- $instance = array(
- 'images' => 0,
- 'name' => 0,
- 'description' => 0,
- 'rating' => 0,
- );
- foreach ( $instance as $field => $val ) {
- if ( isset( $new_instance[ $field ] ) ) {
- $instance[ $field ] = 1;
- }
- }
-
- $instance['orderby'] = 'name';
- if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ), true ) ) {
- $instance['orderby'] = $new_instance['orderby'];
- }
-
- $instance['category'] = (int) $new_instance['category'];
- $instance['limit'] = ! empty( $new_instance['limit'] ) ? (int) $new_instance['limit'] : -1;
-
- return $instance;
- }
-
- /**
- * Outputs the settings form for the Links widget.
- *
- * @since 2.8.0
- *
- * @param array $instance Current settings.
- */
- public function form( $instance ) {
-
- // Defaults.
- $instance = wp_parse_args(
- (array) $instance,
- array(
- 'images' => true,
- 'name' => true,
- 'description' => false,
- 'rating' => false,
- 'category' => false,
- 'orderby' => 'name',
- 'limit' => -1,
- )
- );
- $link_cats = get_terms( array( 'taxonomy' => 'link_category' ) );
- $limit = (int) $instance['limit'];
- if ( ! $limit ) {
- $limit = -1;
- }
- ?>
-
-
-
-
-
- term_id ); ?>>
- name ); ?>
-
-
-
-
-
- >
- >
- >
- >
-
-
-
-
- id="get_field_id( 'images' ); ?>" name="get_field_name( 'images' ); ?>" />
-
-
-
- id="get_field_id( 'name' ); ?>" name="get_field_name( 'name' ); ?>" />
-
-
-
- id="get_field_id( 'description' ); ?>" name="get_field_name( 'description' ); ?>" />
-
-
-
- id="get_field_id( 'rating' ); ?>" name="get_field_name( 'rating' ); ?>" />
-
-
-
-
-
-
-
- \n";
-?>
-
-
-
-
-
- GMT
-
-
-
- 'link_category',
- 'hierarchical' => 0,
- )
- );
-} else {
- $cats = get_categories(
- array(
- 'taxonomy' => 'link_category',
- 'hierarchical' => 0,
- 'include' => $link_cat,
- )
- );
-}
-
-foreach ( (array) $cats as $cat ) :
- /** This filter is documented in wp-includes/bookmark-template.php */
- $catname = apply_filters( 'link_category', $cat->name );
-
- ?>
-
- $cat->term_id ) );
- foreach ( (array) $bookmarks as $bookmark ) :
- /**
- * Filters the OPML outline link title text.
- *
- * @since 2.2.0
- *
- * @param string $title The OPML outline title text.
- */
- $title = apply_filters( 'link_title', $bookmark->link_name );
- ?>
-
-
-
-
-
-
diff --git a/src/wp-settings.php b/src/wp-settings.php
index 1d55db83e2d85..4bd4bb06b4e9c 100644
--- a/src/wp-settings.php
+++ b/src/wp-settings.php
@@ -238,8 +238,6 @@
require ABSPATH . WPINC . '/rewrite.php';
require ABSPATH . WPINC . '/class-wp-rewrite.php';
require ABSPATH . WPINC . '/feed.php';
-require ABSPATH . WPINC . '/bookmark.php';
-require ABSPATH . WPINC . '/bookmark-template.php';
require ABSPATH . WPINC . '/kses.php';
require ABSPATH . WPINC . '/cron.php';
require ABSPATH . WPINC . '/deprecated.php';