W3cubDocs

/WordPress

wp_get_links( string $args = '' )

This function has been deprecated. Use wp_list_bookmarks() instead.

Gets the links associated with category.

Description

See also

Parameters

$args

(string) (Optional) a query string

Default value: ''

Return

(null|string)

Source

File: wp-includes/deprecated.php

function wp_get_links($args = '') {
	_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_bookmarks()' );

	if ( strpos( $args, '=' ) === false ) {
		$cat_id = $args;
		$args = add_query_arg( 'category', $cat_id, $args );
	}

	$defaults = array(
		'after' => '<br />',
		'before' => '',
		'between' => ' ',
		'categorize' => 0,
		'category' => '',
		'echo' => true,
		'limit' => -1,
		'orderby' => 'name',
		'show_description' => true,
		'show_images' => true,
		'show_rating' => false,
		'show_updated' => true,
		'title_li' => '',
	);

	$parsed_args = wp_parse_args( $args, $defaults );

	return wp_list_bookmarks($parsed_args);
}

Changelog

Version Description
2.1.0 Use wp_list_bookmarks()
1.0.1 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_links