How to update serialized data in the user meta data

Thats just PHP serialized array notation. You would get that same result by this code: $meta_value = array( ‘alumni’ => ‘Yes’, ‘donations_collected’ => ’10’ ); update_user_meta( $team_member_id, ‘wp_s2member_custom_fields’, $meta_value); So if you want to then change the donations_collected value to 11: $meta_value = get_user_meta( $team_member_id, ‘wp_s2member_custom_fields’, true ); $meta_value[‘donations_collected’]++; update_user_meta( $team_member_id, ‘wp_s2member_custom_fields’, $meta_value);

Plugin to auto convert custom fields to tag

Placing something like this in your functions.php should work. I haven’t had the opportunity to test this code yet and its a little messy (could be polished up) but should give you an very good starting point.. add_action(‘save_post’,’custom_field_add_tags’); function custom_field_add_tags($post_id) { $post = get_post($post_id); //get values of custom fields and put into array $tag1 = … Read more

How To Create a Metabox of HTML Content with Instructions For Editors When Editing a Post or Page?

Don’t know any plugin for that. But it can be solved creating a custom plugin with the Settings API and a Custom Meta Box. Adding a RichText Editor in the Settings Page /wp-admin/options-general.php <?php /* Plugin Name: Custom Editor in Settings Page */ add_action( ‘admin_init’, ‘register_settings_wpse_57647’ ); # Register settings function register_settings_wpse_57647() { register_setting( ‘general’, … Read more

Adding a custom field into the_content()

Try the_content filter to append your field onto the content: function wpa_content_filter( $content ) { global $post; if( $meta = get_post_meta( $post->ID, ‘reviewGrade’, true ) ) { return $content . $meta; } return $content; } add_filter( ‘the_content’, ‘wpa_content_filter’, 10 ); Use the priority argument of add_filter to control the order in which your function runs.

Use WP 3.1 Internal Linking ‘widget’ as a meta_box

WordPress 3.1 Internal Linking feature was coded as a TinyMCE editor plugin so its not really a widget or a meta box but you can code your own meta box and reuse the functiona needed for that. The files you need to look at are /wp-includes/js/tinymce/wp-mce-link.php /wp-includes/js/tinymce/plugins/wplink/js/wplink.js and maybe a few more but these are … Read more

Automatic Refresh all posts at once

you can do something like this: $args = array( ‘posts_per_page’ => 1000, ‘post_type’ => ‘post’ ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $casa_id = $post->ID; update_post_meta($post->ID, ‘casa_id’, $casa_id); } }

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