Plugin Directory

Changeset 1408025


Ignore:
Timestamp:
04/30/2016 10:44:45 AM (10 years ago)
Author:
getcopyfight
Message:

version 1.3.10

Location:
copyfight
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • copyfight/tags/1.3.10/class.copyfight-admin.php

    r1405607 r1408025  
    157157    public static function display_posts_copyfight( $column, $post_id ) {
    158158        if ($column == 'copyfight') {
    159             echo '<input type="checkbox" disabled', call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post_id) ? ' checked' : '', '/>';
     159            $status = call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post_id);
     160            if ( $status == 'enabled' ) {
     161                echo '<input type="checkbox" disabled checked/>';
     162            } else {
     163                echo '<input type="checkbox" disabled />';
     164            }
    160165        }
    161166    }
     
    184189    public static function copyfight_meta_box_callback( $post ) {
    185190        wp_nonce_field( 'copyfight_save_meta_box_data', 'copyfight_meta_box_nonce' );
    186         $options = array( 'Enabled', 'Disabled' );
     191        $options = array( 'enabled' => __( 'Enabled', 'copyfight' ), 'disabled' => __( 'Disabled', 'copyfight' ) );
    187192
    188193        $status = call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post->ID);
     
    190195        echo '<label for="copyfight_status">' . __( 'Status', 'copyfight' ) . ':</label> ';
    191196        echo '<select name="copyfight_status">';
    192         foreach ( $options as $option ) {
    193             if ( strtolower( $option ) == $status ) {
    194                 echo '  <option selected value="' . strtolower( $option ) . '">' . $option . '</option>';
     197        foreach ( $options as $value => $option ) {
     198            if ( $value == $status ) {
     199                echo '  <option selected value="' . $value . '">' . $option . '</option>';
    195200            } else {
    196                 echo '  <option value="' . strtolower( $option ) . '">' . $option . '</option>';
     201                echo '  <option value="' . $value . '">' . $option . '</option>';
    197202            }
    198203        }
  • copyfight/trunk/class.copyfight-admin.php

    r1405615 r1408025  
    157157    public static function display_posts_copyfight( $column, $post_id ) {
    158158        if ($column == 'copyfight') {
    159             echo '<input type="checkbox" disabled', call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post_id) ? ' checked' : '', '/>';
     159            $status = call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post_id);
     160            if ( $status == 'enabled' ) {
     161                echo '<input type="checkbox" disabled checked/>';
     162            } else {
     163                echo '<input type="checkbox" disabled />';
     164            }
    160165        }
    161166    }
     
    184189    public static function copyfight_meta_box_callback( $post ) {
    185190        wp_nonce_field( 'copyfight_save_meta_box_data', 'copyfight_meta_box_nonce' );
    186         $options = array( 'Enabled', 'Disabled' );
     191        $options = array( 'enabled' => __( 'Enabled', 'copyfight' ), 'disabled' => __( 'Disabled', 'copyfight' ) );
    187192
    188193        $status = call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post->ID);
     
    190195        echo '<label for="copyfight_status">' . __( 'Status', 'copyfight' ) . ':</label> ';
    191196        echo '<select name="copyfight_status">';
    192         foreach ( $options as $option ) {
    193             if ( strtolower( $option ) == $status ) {
    194                 echo '  <option selected value="' . strtolower( $option ) . '">' . $option . '</option>';
     197        foreach ( $options as $value => $option ) {
     198            if ( $value == $status ) {
     199                echo '  <option selected value="' . $value . '">' . $option . '</option>';
    195200            } else {
    196                 echo '  <option value="' . strtolower( $option ) . '">' . $option . '</option>';
     201                echo '  <option value="' . $value . '">' . $option . '</option>';
    197202            }
    198203        }
Note: See TracChangeset for help on using the changeset viewer.