url_shorten

Definition:
function url_shorten( $url ) {}

Shorten an URL, to be used as link text

Parameters

  • string $url

Source code

function url_shorten( $url ) {

	$short_url = str_replace( 'http://', '', stripslashes( $url ));

	$short_url = str_replace( 'www.', '', $short_url );

	if ('/' == substr( $short_url, -1 ))

		$short_url = substr( $short_url, 0, -1 );

	if ( strlen( $short_url ) > 35 )

		$short_url = substr( $short_url, 0, 32 ).'...';

	return $short_url;

}

3269

url_is_accessable_via_ssl

Definition:
function url_is_accessable_via_ssl($url)

Determines if the blog can be accessed over SSL.
Determines if blog can be accessed over SSL by using cURL to access the site using the https in the siteurl. Requires cURL extension to work correctly.

Parameters

  • string $url

Return values

returns:Whether SSL access is available

Source code

function url_is_accessable_via_ssl($url)

{

	if (in_array('curl', get_loaded_extensions())) {

		$ssl = preg_replace( '/^http:\/\//', 'https://',  $url );



		$ch = curl_init();

		curl_setopt($ch, CURLOPT_URL, $ssl);

		curl_setopt($ch, CURLOPT_FAILONERROR, true);

		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);



		curl_exec($ch);



		$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

		curl_close ($ch);



		if ($status == 200 || $status == 401) {

			return true;

		}

	}

	return false;

}

3267

urlencode_deep

Definition:
function urlencode_deep($value) {}

Navigates through an array and encodes the values to be used in a URL.
Uses a callback to pass the value of the array back to the function as a string.

Parameters

  • array|string $value: The array or string to be encoded.

Return values

returns:The encoded array (or string from the callback).

Source code

function urlencode_deep($value) {

	$value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value);

	return $value;

}

3265

upload_space_setting

Definition:
function upload_space_setting( $id ) {}

Parameters

  • $id

Source code

function upload_space_setting( $id ) {

	$quota = get_blog_option( $id, 'blog_upload_space' );

	if ( !$quota )

		$quota = '';



	?>

	<tr>

		<th><?php _e( 'Site Upload Space Quota '); ?></th>

		<td><input type="text" size="3" name="option[blog_upload_space]" value="<?php echo $quota; ?>" /> <?php _e( 'MB (Leave blank for network default)' ); ?></td>

	</tr>

	<?php

}

3263

upload_size_limit_filter

Definition:
function upload_size_limit_filter( $size ) {}

Parameters

  • $size

Return values

returns:of upload size limit in bytes

Source code

function upload_size_limit_filter( $size ) {

	$fileupload_maxk = 1024 * get_site_option( 'fileupload_maxk', 1500 );

	if ( get_site_option( 'upload_space_check_disabled' ) )

		return min( $size, $fileupload_maxk );



	return min( $size, $fileupload_maxk, get_upload_space_available() );

}

3261