Forums

Magic Fields
Mysterious Code being Returned () (1 post)

  1. andycheeseman
    Member
    Posted 5 months ago #

    I'm using MagicFields for WordPress and I'm checking a variable to see if it's true.

    A working example is...

    <?php
        if ( get('daytime_number',TRUE) ) {
            ?><div id='section_title'>Daytime Telephone</div><div id=section_detail'><?php
            echo get('daytime_number');
            ?></div><br /><?php
        }
    ?>

    But when I try and test if a multiline variable is TRUE using the following code...

    <?php
        if ( get('business_address')!=' ' ) {
            ?><div id='section_title'>Address</div><div id=section_detail'><?php
            echo get('business_address');
            ?></div><?php
        }
    ?>

    It always returns as TRUE even when the variable is empty. In the HTML, a comment is being generated like this...

    <div id='section_title'>Address</div><div id=section_detail'><p><!-- PHP 5.x --></p>
    </div>

    Any help or pointers you could provide me with would be greatly appreciated!

    Thanks, Andy.

    http://wordpress.org/extend/plugins/magic-fields/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 5 months ago by andycheeseman
  • This topic is not resolved
  • WordPress version: 3.2.1