WordPress.org

Make WordPress Core

Changeset 13769 for trunk/wp-app.php


Ignore:
Timestamp:
03/19/2010 09:15:00 PM (10 years ago)
Author:
nacin
Message:

Remove unnecessary ternary operators such as (expr) ? true : false.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r13427 r13769  
    413413        }
    414414
    415         $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true;
     415        $publish = ! ( isset( $entry->draft ) && 'yes' == trim( $entry->draft ) );
    416416
    417417        $cap = ($publish) ? 'publish_posts' : 'edit_posts';
     
    506506            $this->auth_required(__('Sorry, you do not have the right to edit this post.'));
    507507
    508         $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;
     508        $publish = ! ( isset($parsed->draft) && 'yes' == trim($parsed->draft) );
    509509        $post_status = ($publish) ? 'publish' : 'draft';
    510510
Note: See TracChangeset for help on using the changeset viewer.