WordPress.org

Ready to get started?Download WordPress

Forums

News
unexpected T_IF (news theme) (3 posts)

  1. bswopes
    Member
    Posted 1 year ago #

    PHP Parse error: syntax error, unexpected T_IF in .../themes/news/searchform.php on line 13

    The line in question is:

    $search_id = if ( $search_num ) ? esc_attr( '-' . $search_num ) : '';

    This looks like it works as a fix:

    if ( $search_num ) { $search_id = esc_attr( '-' . $search_num ); } else { $search_id = '';}

    http://wordpress.org/extend/plugins/news/

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    Oh ternary operators how I loathe you.

  3. Andy McDonald
    Member
    Posted 1 year ago #

    Or just remove the 'if':

    $search_id = ( $search_num ) ? esc_attr( '-' . $search_num ) : '';

    Looks like that code was never tested...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags