WordPress.org

Ready to get started?Download WordPress

Forums

Proper way to use defaults? (2 posts)

  1. Kelson
    Member
    Posted 11 years ago #

    It seems that at least in some cases, using a null string for a function parameter does not cause the function to use the default. For instance, if you put "comments_popup_script('','','comments.php')" in your templete, you end up with the width and height being blank instead of 400. This is only mildly annoying in some browsers (Mozilla just ignores the bogus values), but some, like Konqueror and Safari, assume you meant 0 and open the smallest window allowed.
    Sure, I can work around it by actually assigning a value when I call the function, but it *is* a bit annoying not to be able to use the defaults in cases like this.
    (Incidentally, this is with PHP 4.3.2 on Apache 1.3.)

  2. rayne
    Member
    Posted 11 years ago #

    I thought to leave a parameter blank you just put commas like this:
    comments_popup_script(,,'comments.php');
    I don't think you need the extra quotes.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.