Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/wp-admin/edit-link-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
exit;
}

_deprecated_file( basename( __FILE__ ), '7.2.0', '', __( 'The Link Manager is deprecated. Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.' ) );

if ( ! empty( $link_id ) ) {
/* translators: %s: URL to Links screen. */
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
Expand Down
27 changes: 27 additions & 0 deletions src/wp-admin/includes/bookmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@
* Adds a link using values provided in $_POST.
*
* @since 2.0.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @return int The link ID on success. The value 0 on failure.
*/
function add_link() {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

return edit_link();
}

/**
* Updates or inserts a link using values provided in $_POST.
*
* @since 2.0.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @param int $link_id Optional. ID of the link to edit. Default 0.
* @return int The link ID on success. The value 0 on failure.
*/
function edit_link( $link_id = 0 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

if ( ! current_user_can( 'manage_links' ) ) {
wp_die(
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
Expand Down Expand Up @@ -54,10 +60,13 @@ function edit_link( $link_id = 0 ) {
* Retrieves the default link for editing.
*
* @since 2.0.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @return stdClass Default link object.
*/
function get_default_link_to_edit() {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$link = new stdClass();
if ( isset( $_GET['linkurl'] ) ) {
$link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
Expand All @@ -80,13 +89,16 @@ function get_default_link_to_edit() {
* Deletes a specified link from the database.
*
* @since 2.0.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

global $wpdb;
/**
* Fires before a link is deleted.
Expand Down Expand Up @@ -119,11 +131,14 @@ function wp_delete_link( $link_id ) {
* Retrieves the link category IDs associated with the link specified.
*
* @since 2.1.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$cats = wp_get_object_terms( $link_id, 'link_category', array( 'fields' => 'ids' ) );
return array_unique( $cats );
}
Expand All @@ -132,11 +147,14 @@ function wp_get_link_cats( $link_id = 0 ) {
* Retrieves link data based on its ID.
*
* @since 2.0.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @param int|stdClass $link Link ID or object to retrieve.
* @return object Link object for editing.
*/
function get_link_to_edit( $link ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

return get_bookmark( $link, OBJECT, 'edit' );
}

Expand All @@ -147,6 +165,7 @@ function get_link_to_edit( $link ) {
* and finally saves the link.
*
* @since 2.0.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
Expand All @@ -172,6 +191,8 @@ function get_link_to_edit( $link ) {
* @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 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

global $wpdb;

$defaults = array(
Expand Down Expand Up @@ -271,11 +292,14 @@ function wp_insert_link( $linkdata, $wp_error = false ) {
* Updates link with the specified link categories.
*
* @since 2.1.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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() ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

// 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' ) );
Expand All @@ -293,11 +317,14 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
* Updates a link in the database.
*
* @since 2.0.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$link_id = (int) $linkdata['link_id'];

$link = get_bookmark( $link_id, ARRAY_A );
Expand Down
3 changes: 3 additions & 0 deletions src/wp-admin/includes/class-wp-links-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ class WP_Links_List_Table extends WP_List_Table {
* Constructor.
*
* @since 3.1.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @param array $args An associative array of arguments.
*/
public function __construct( $args = array() ) {
_deprecated_class( __CLASS__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

parent::__construct(
array(
'plural' => 'bookmarks',
Expand Down
3 changes: 3 additions & 0 deletions src/wp-admin/includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,13 @@ function wp_popular_terms_checklist( $taxonomy, $default_term = 0, $number = 10,
* Outputs a link category checklist element.
*
* @since 2.5.1
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @param int $link_id Optional. The link ID. Default 0.
*/
function wp_link_category_checklist( $link_id = 0 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$default = 1;

$checked_categories = array();
Expand Down
2 changes: 2 additions & 0 deletions src/wp-admin/link-add.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

_deprecated_file( basename( __FILE__ ), '7.2.0', '', __( 'The Link Manager is deprecated. Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.' ) );

if ( ! current_user_can( 'manage_links' ) ) {
wp_die( __( 'Sorry, you are not allowed to add links to this site.' ) );
}
Expand Down
3 changes: 3 additions & 0 deletions src/wp-admin/link-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

_deprecated_file( basename( __FILE__ ), '7.2.0', '', __( 'The Link Manager is deprecated. Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.' ) );

if ( ! current_user_can( 'manage_links' ) ) {
wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
}
Expand Down
2 changes: 2 additions & 0 deletions src/wp-admin/link-parse-opml.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
exit;
}

_deprecated_file( basename( __FILE__ ), '7.2.0', '', __( 'The Link Manager is deprecated. Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.' ) );

/**
* @global string $opml
*/
Expand Down
2 changes: 2 additions & 0 deletions src/wp-admin/link.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

_deprecated_file( basename( __FILE__ ), '7.2.0', '', __( 'The Link Manager is deprecated. Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.' ) );

$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
$link_id = ! empty( $_REQUEST['link_id'] ) ? absint( $_REQUEST['link_id'] ) : 0;
Expand Down
3 changes: 3 additions & 0 deletions src/wp-includes/bookmark-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
* display for only the 'title_li' string and only if 'title_li' is not empty.
*
* @since 2.1.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @see _walk_bookmarks()
*
Expand Down Expand Up @@ -209,6 +210,8 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
* @return void|string Void if 'echo' argument is true, HTML list of bookmarks if 'echo' is false.
*/
function wp_list_bookmarks( $args = '' ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$defaults = array(
'orderby' => 'name',
'order' => 'ASC',
Expand Down
18 changes: 18 additions & 0 deletions src/wp-includes/bookmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Retrieves bookmark data.
*
* @since 2.1.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @global object $link Current link object.
* @global wpdb $wpdb WordPress database abstraction object.
Expand All @@ -22,6 +23,8 @@
* @return array|object|null Type returned depends on $output value.
*/
function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

global $wpdb;

if ( empty( $bookmark ) ) {
Expand Down Expand Up @@ -69,13 +72,16 @@ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {
* Retrieves single bookmark data item or field.
*
* @since 2.3.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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' ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$bookmark = (int) $bookmark;
$bookmark = get_bookmark( $bookmark );

Expand All @@ -102,6 +108,7 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
* results will be stored to the cache.
*
* @since 2.1.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
Expand Down Expand Up @@ -135,6 +142,8 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
* @return object[] List of bookmark row objects.
*/
function get_bookmarks( $args = '' ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

global $wpdb;

$defaults = array(
Expand Down Expand Up @@ -327,12 +336,15 @@ function get_bookmarks( $args = '' ) {
* Sanitizes all bookmark fields.
*
* @since 2.3.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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' ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$fields = array(
'link_id',
'link_url',
Expand Down Expand Up @@ -389,6 +401,7 @@ function sanitize_bookmark( $bookmark, $context = 'display' ) {
* and is passed the `$value`, `$bookmark_id`, and `$context`, respectively.
*
* @since 2.3.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @param string $field The bookmark field.
* @param mixed $value The bookmark field value.
Expand All @@ -398,6 +411,8 @@ function sanitize_bookmark( $bookmark, $context = 'display' ) {
* @return mixed The filtered value.
*/
function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$int_fields = array( 'link_id', 'link_rating' );
if ( in_array( $field, $int_fields, true ) ) {
$value = (int) $value;
Expand Down Expand Up @@ -462,10 +477,13 @@ function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) {
* Deletes the bookmark cache.
*
* @since 2.7.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @param int $bookmark_id Bookmark ID.
*/
function clean_bookmark_cache( $bookmark_id ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

wp_cache_delete( $bookmark_id, 'bookmark' );
wp_cache_delete( 'get_bookmarks', 'bookmark' );
clean_object_term_cache( $bookmark_id, 'link' );
Expand Down
6 changes: 6 additions & 0 deletions src/wp-includes/link-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1673,11 +1673,14 @@ function edit_comment_link( $text = null, $before = '', $after = '' ) {
* Displays the edit bookmark link.
*
* @since 2.7.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$link = get_bookmark( $link );

if ( ! current_user_can( 'manage_links' ) ) {
Expand All @@ -1701,13 +1704,16 @@ function get_edit_bookmark_link( $link = 0 ) {
* Displays the edit bookmark link anchor content.
*
* @since 2.7.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*
* @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 ) {
_deprecated_function( __FUNCTION__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$bookmark = get_bookmark( $bookmark );

if ( ! current_user_can( 'manage_links' ) ) {
Expand Down
3 changes: 3 additions & 0 deletions src/wp-includes/widgets/class-wp-widget-links.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ class WP_Widget_Links extends WP_Widget {
* Sets up a new Links widget instance.
*
* @since 2.8.0
* @deprecated 7.2.0 Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.
*/
public function __construct() {
_deprecated_class( __CLASS__, '7.2.0', 'the WP Links plugin (https://github.com/georgestephanis/wp-links)' );

$widget_ops = array(
'description' => __( 'Your blogroll' ),
'customize_selective_refresh' => true,
Expand Down
2 changes: 2 additions & 0 deletions src/wp-links-opml.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

require_once __DIR__ . '/wp-load.php';

_deprecated_file( basename( __FILE__ ), '7.2.0', '', __( 'The Link Manager is deprecated. Use the WP Links plugin (https://github.com/georgestephanis/wp-links) instead.' ) );

header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
$link_cat = '';
if ( ! empty( $_GET['link_cat'] ) ) {
Expand Down
Loading