Add custom field to image editor

To add a custom field to attachments, place the following code in your functions.php. add_filter(‘attachment_fields_to_edit’, ‘edit_media_custom_field’, 11, 2 ); add_filter(‘attachment_fields_to_save’, ‘save_media_custom_field’, 11, 2 ); function edit_media_custom_field( $form_fields, $post ) { $form_fields[‘custom_field’] = array( ‘label’ => ‘Custom Field’, ‘input’ => ‘text’, ‘value’ => get_post_meta( $post->ID, ‘_custom_field’, true ) ); return $form_fields; } function save_media_custom_field( $post, $attachment … Read more

Display thumbnail from custom field

can you explain why do you need custom fields ? (personally i think they are HUGELY over-used.. especially for images ) if there is no specific reason why you need it , you could use the the_post_thumbnail(); function . like so : the_post_thumbnail(‘thumbnail’); // Thumbnail (default 150px x 150px max) the_post_thumbnail(‘medium’); // Medium resolution (default … Read more

How to add/save Custom Field in user settings/profile “Checkbox list”

Justin Tadlock has a good tutorial to get you started: http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields There are some specifics to dealing with checkboxes however, and some custom code if you want to make checkboxes that correspond to tags/categories. To generate the form fields and save the data use the following snippet: <?php function user_interests_fields( $user ) { // get … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)