Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




comments_popup_script [ WordPress Function ]

comments_popup_script ( $width = 400, $height = 400, $file = '' )
Parameters:
  • (int) $width Optional. The width of the popup window
  • (int) $height Optional. The height of the popup window
  • (string) $file Optional. Sets the location of the popup window
Defined at:



Displays the JS popup script to show a comment.

If the $file parameter is empty, then the home page is assumed. The defaults for the window are 400px by 400px.

For the comment link popup to work, this function has to be called or the normal comment link will be assumed.

Source


<?php
function comments_popup_script($width=400$height=400$file='') {
    global 
$wpcommentspopupfile$wpcommentsjavascript;

    if (empty (
$file)) {
        
$wpcommentspopupfile '';  // Use the index.
    
} else {
        
$wpcommentspopupfile $file;
    }

    
$wpcommentsjavascript 1;
    
$javascript "<script type='text/javascript'>\nfunction wpopen (macagna) {\n    window.open(macagna, '_blank', 'width=$width,height=$height,scrollbars=yes,status=yes');\n}\n</script>\n";
    echo 
$javascript;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics