Advertisements

links_popup_script

Definition:
function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {}

Show the link to the links popup and the number of links.

Parameters

  • string $text: the text of the link
  • int $width: the width of the popup window
  • int $height: the height of the popup window
  • string $file: the page to open in the popup window
  • bool $count: the number of links in the db

Source code

function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {

	_deprecated_function( __FUNCTION__, '2.1' );



	if ( $count )

		$counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links");



	$javascript = "<a href=\"#\" onclick=\"javascript:window.open('$file?popup=1', '_blank', 'width=$width,height=$height,scrollbars=yes,status=no'); return false\">";

	$javascript .= $text;



	if ( $count )

		$javascript .= " ($counts)";



	$javascript .= "</a>\n\n";

		echo $javascript;

}

2249

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: