WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/make clickable

Description

Convert plain text URI to HTML links.

Converts URI, www, FTP, and email addresses. Finishes by fixing links within links.

Usage

<?php make_clickable$text ); ?>

Parameters

$text
(string) (required) Content to convert URIs.
Default: None

Return Values

$r 
(string) Content with converted URIs.

Examples

Display all URLs in clickable links

<?php 
$string = "This is a long text that contains some links like http://www.wordpress.org and http://www.wordpress.com .";
echo make_clickable( $string ); 
?>

Notes

This function can be fed long strings with URIs and email links and will convert them into clickable links. You are not limited to feeding it just the link text itself (see the long string in the example above).

Change Log

Since: 0.71

Source File

make_clickable() is located in wp-includes/formatting.php.

Related

See also index of Function Reference and index of Template Tags.