How to Add Custom Fields to User Profile – WordPress

Super easy way to add custom fields to the user profile on Wordpress. This will take you 3 seconds to implement. function modify_contact_methods($profile_fields) { // Add new fields - this can be as many as you like $profile_fields['cool_new_field'] = 'Twitter Username'; // Remove old fields unset($profile_fields['some_existing_field_you_hate']); return $profile_fields; } add_filter('user_contactmethods', 'modify_contact_methods'); //And if you...

0
0

Use WordPress Media Uploader in your Custom Plugin

This will make is Basicly what I did was adding this to my plugin: function test_admin_scripts() { wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_script('jquery'); } function test_admin_styles() { wp_enqueue_style('thickbox'); } add_action('admin_print_scripts', 'test_admin_scripts'); add_action('admin_print_styles', 'test_admin_styles'); And later this part: <script language="JavaScript"> jQuery(document).ready(function() { jQuery('#upload_image_button').click(function() { formfield = jQuery('#upload_image').attr('name'); tb_show('', 'media-upload.php?type=image&TB_iframe=true'); return false; }); window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#upload_image').val(imgurl); tb_remove(); } }); </script> <tr valign="top"> <td>Upload Image</td> <td><label for="upload_image"> <input id="upload_image" type="text" size="36" name="upload_image" value="<?php echo $yourimage; ?>"...

0
0