Insert dynamic content into posts

Everytime you upload a new image, the afip_new_post_content filter is called which can be used to change the post content before creation – http://wordpress.org/extend/plugins/automatic-featured-image-posts/ Assuming you have a list of URLs stored somewhere – like in the database – you need a function that would get a url from this list, then delete the url … Read more

Title image is missing ( but is not the WP 3.5 issue )

you can try this filter add_filter(‘wp_get_attachment_image_attributes’, ‘my_img_title’, 10, 2); function my_img_title($attr, $attachment = null){ $attr[‘title’] = get_post($attachment->ID)->post_title; return $attr; } It should give the the extra title attribute in the img tag. You can also use the ‘post_thumbnail_html’ filter to edit the html output. ps: here is a similar question: Display info from custom fields … Read more

wp_remote_get with Google Books API

I’m pretty sure you have to add the keywords or the search terms directly to the query, for example: $key = ‘flowers’; // search for word flowers in book titles. // fill rest in as you desire $args = array( ‘timeout’ => ‘5’, ‘redirection’ => ‘5’, ‘sslverify’ => false // for localhost ); //check for … Read more

get USER ID in functions.php using user_register action

You are giving $wpdb->get_results a string for its second parameter. It should be a constant– ARRAY_N— meaning you need to remove the quotes $getunion = $wpdb->get_results( “SELECT value from wp_bp_xprofile_data where user_id = $getid AND field_id = 4”, ARRAY_N ); Since you claim it works in the second instance, I am assuming $wpdb compensates, but … Read more

How to add additional JavaScript code [duplicate]

Technically yes, you can add those lines to your header.php file just after the wp_head() function and it’ll load the jQuery from a remote source, just like it was on your local machine. If you want to do it properly, take a look at http://codex.wordpress.org/Function_Reference/wp_enqueue_script which will allow you to add it through the wp_head() … Read more

How to handle image resize in media_handle_sideload?

If you look at media_handle_sideload in source, you can see how it works. The function that generates the various sizes is within wp_generate_attachment_metadata, the image_make_intermediate_size function. You could possibly use the wp_handle_sideload function instead and manually resize it via image_make_intermediate_size.

User cannot authenticate after signup when object cache enabled

This is now solved The solution was this in the activation script: $blog_real_id = $wpdb->get_var(“select blog_id from wp_bp_user_blogs where user_id = “.$user_id.” limit 1″); wp_cache_key_delete(“1:users:”.$user_id); wp_cache_key_delete($blog_real_id.”:users:”.$user_id); This clears the cached user info for blog id 1 and the signed up blog ud. For some reason the password hash that is in memcache is wrong. Clearing … Read more