Changeset 4417
- Timestamp:
- 10/24/2006 03:57:19 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r4413 r4417 288 288 // Get an existing post and format it for editing. 289 289 function get_post_to_edit($id) { 290 global $richedit;291 $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;292 290 293 291 $post = get_post($id); 294 292 295 $post->post_content = format_to_edit($post->post_content, $richedit);293 $post->post_content = format_to_edit($post->post_content, user_can_richedit()); 296 294 $post->post_content = apply_filters('content_edit_pre', $post->post_content); 297 295 … … 351 349 352 350 function get_comment_to_edit($id) { 353 global $richedit;354 $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;355 356 351 $comment = get_comment($id); 357 352 358 $comment->comment_content = format_to_edit($comment->comment_content, $richedit);353 $comment->comment_content = format_to_edit($comment->comment_content, user_can_richedit()); 359 354 $comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content); 360 355 -
trunk/wp-admin/profile-update.php
r3985 r4417 18 18 } 19 19 20 if ( !isset( $_POST['rich_editing'] ) ) 21 $_POST['rich_editing'] = 'false'; 22 update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); 20 if ( rich_edit_exists() ) { 21 if ( !isset( $_POST['rich_editing'] ) ) 22 $_POST['rich_editing'] = 'false'; 23 update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); 24 } 23 25 24 26 do_action('personal_options_update'); -
trunk/wp-admin/profile.php
r4349 r4417 31 31 <h3><?php _e('Personal Options'); ?></h3> 32 32 33 <?php if ( rich_edit_exists() ) : // don't bother showing the option if the editor has been removed ?> 33 34 <p><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> /> 34 35 <?php _e('Use the visual editor when writing') ?></label></p> 36 <?php endif; ?> 35 37 36 38 <?php do_action('profile_personal_options'); ?> -
trunk/wp-includes/general-template.php
r4371 r4417 751 751 } 752 752 753 function rich_edit_exists() { 754 global $wp_rich_edit_exists; 755 if ( !isset($wp_rich_edit_exists) ) 756 $wp_rich_edit_exists = file_exists(ABSPATH . WPINC . '/js/tinymce/tiny_mce.js'); 757 return $wp_rich_edit_exists; 758 } 759 753 760 function user_can_richedit() { 754 $can = true;755 756 if ( 'true' != get_user_option('rich_editing') || preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) )757 $ can =false;758 759 return apply_filters('user_can_richedit', $ can);761 global $wp_rich_edit; 762 763 if ( !isset($wp_rich_edit) ) 764 $wp_rich_edit = ( 'true' == get_user_option('rich_editing') && !preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) && rich_edit_exists() ) ? true : false; 765 766 return apply_filters('user_can_richedit', $wp_rich_edit); 760 767 } 761 768
Note: See TracChangeset
for help on using the changeset viewer.