Changeset 1408025
- Timestamp:
- 04/30/2016 10:44:45 AM (10 years ago)
- Location:
- copyfight
- Files:
-
- 2 edited
-
tags/1.3.10/class.copyfight-admin.php (modified) (3 diffs)
-
trunk/class.copyfight-admin.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
copyfight/tags/1.3.10/class.copyfight-admin.php
r1405607 r1408025 157 157 public static function display_posts_copyfight( $column, $post_id ) { 158 158 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 } 160 165 } 161 166 } … … 184 189 public static function copyfight_meta_box_callback( $post ) { 185 190 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' ) ); 187 192 188 193 $status = call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post->ID); … … 190 195 echo '<label for="copyfight_status">' . __( 'Status', 'copyfight' ) . ':</label> '; 191 196 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>'; 195 200 } else { 196 echo ' <option value="' . strtolower( $option ). '">' . $option . '</option>';201 echo ' <option value="' . $value . '">' . $option . '</option>'; 197 202 } 198 203 } -
copyfight/trunk/class.copyfight-admin.php
r1405615 r1408025 157 157 public static function display_posts_copyfight( $column, $post_id ) { 158 158 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 } 160 165 } 161 166 } … … 184 189 public static function copyfight_meta_box_callback( $post ) { 185 190 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' ) ); 187 192 188 193 $status = call_user_func(COPYFIGHT_CLASS_ADMIN . '::is_copyfight_enabled', $post->ID); … … 190 195 echo '<label for="copyfight_status">' . __( 'Status', 'copyfight' ) . ':</label> '; 191 196 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>'; 195 200 } else { 196 echo ' <option value="' . strtolower( $option ). '">' . $option . '</option>';201 echo ' <option value="' . $value . '">' . $option . '</option>'; 197 202 } 198 203 }
Note: See TracChangeset
for help on using the changeset viewer.