Ticket #3272: tinymce_graceful.diff
File tinymce_graceful.diff, 3.6 KB (added by , 18 years ago) |
---|
-
wp-includes/general-template.php
750 750 echo "<meta name='robots' content='noindex,nofollow' />\n"; 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; 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; 755 765 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); 766 return apply_filters('user_can_richedit', $wp_rich_edit); 760 767 } 761 768 762 769 function the_editor($content, $id = 'content', $prev_id = 'title') { -
wp-admin/profile-update.php
17 17 exit; 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'); 25 27 -
wp-admin/admin-functions.php
287 287 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 298 296 $post->post_excerpt = format_to_edit($post->post_excerpt); … … 350 348 } 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 361 356 $comment->comment_author = format_to_edit($comment->comment_author); -
wp-admin/profile.php
30 30 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'); ?> 37 39