Using WordPress ‘links_popup_script()’ PHP function

The links_popup_script() WordPress PHP function displays a link that opens a popup window containing a list of links.

Usage

links_popup_script($text, $width, $height, $file, $count);

Parameters

  • $text (string) – Optional, the text of the link, default: ‘Links’.
  • $width (int) – Optional, the width of the popup window, default: 400.
  • $height (int) – Optional, the height of the popup window, default: 400.
  • $file (string) – Optional, the page to open in the popup window, default: ‘links.all.php’.
  • $count (bool) – Optional, the number of links in the database, default: true.

More information

See WordPress Developer Resources: links_popup_script()

Examples

This example will create a default link that opens a popup window containing a list of links.

links_popup_script();

This example shows how to create a link with custom text.

links_popup_script("Click for Links");

This example demonstrates how to customize the popup window dimensions.

links_popup_script("Links", 600, 500);

This example shows how to open a custom page in the popup window.

links_popup_script("Links", 400, 400, "custom-links-page.php");

This example demonstrates how to display the link without showing the number of links in the database.

links_popup_script("Links", 400, 400, "links.all.php", false);