Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // USER PROFILE STUFF
- // Add TinyMCE editor to the "Bio info" field in a user profile
- function pands_user_bio_visual_editor( $user ) {
- // Requires WP 3.3+ and author level capabilities
- if ( function_exists('wp_editor') && current_user_can('publish_posts') ):
- ?>
- <script type="text/javascript">
- (function($){
- // Remove the textarea before displaying visual editor
- $('#description').parents('tr').remove();
- })(jQuery);
- </script>
- <table class="form-table">
- <tr>
- <th><label for="description"><?php _e('Biographical Info'); ?></label></th>
- <td>
- <?php
- $description = get_user_meta( $user->ID, 'description', true);
- wp_editor( $description, 'description' );
- ?>
- <p class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p>
- </td>
- </tr>
- </table>
- <?php
- endif;
- }
- add_action('show_user_profile', 'pands_user_bio_visual_editor');
- add_action('edit_user_profile', 'pands_user_bio_visual_editor');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement