Media Uploader in Theme and Plugin


Add this code to your global custom option function
if(function_exists( 'wp_enqueue_media' )){
wp_enqueue_media();
}else{
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
}

Header Logo Image URL:
<img class="header_logo" src="" height="100" width="100"/>
<input class="header_logo_url" type="text" name="header_logo" size="60" value="">
Upload

jQuery(document).ready(function($) {
$('.header_logo_upload').click(function(e) {
e.preventDefault();

var custom_uploader = wp.media({
title: 'Custom Image',
button: {
text: 'Upload Image'
},
multiple: false // Set this to true to allow multiple files to be selected
})
.on('select', function() {
var attachment = custom_uploader.state().get('selection').first().toJSON();
$('.header_logo').attr('src', attachment.url);
$('.header_logo_url').val(attachment.url);

})
.open();
});
});

Media Uploader Options
More Info for code

Fix – Notice: get_currentuserinfo is deprecated since version 4.5


Just find in plugin or theme directory with text get_currentuserinfo and replace with wp_get_current_user()

Because of deprecated function get_currentuserinfo and arrived new function _wp_get_current_user() Since: WordPress 4.5.0

function get_currentuserinfo() {
_deprecated_function( __FUNCTION__, '4.5', 'wp_get_current_user()' );
return wp_get_current_user();
}

More info

Wp_Query on tag & category base posts not getting when use “+” sign?


$query = new WP_Query( 'tag=bread+baking+recipe' );
$query = new WP_Query( 'category_name=staff+news' );

When u have try with + sign not getting post because it is a native PHP function called parse_str being ran if you submit the arguments as a string.

This is because you are submitting a string which is parsed like an URL, you’ll need to either URLEncode the + sign (use %2B instead) or submit the query arguments as an array,
$query = new WP_Query( array( 'category_name' => 'staff+news' ) );, to stop this.

More Info

Latest stable release of WordPress (Version 4.2.4)


WordPress 4.2.4 is available and patches six security vulnerabilities. The vulnerabilities were discovered by outside parties and members of the WordPress core security team. This release also fixes four bugs:

  • WPDB: When checking the encoding of strings against the database, make sure we’re only relying on the return value of strings that were sent to the database.
    #32279
  • Don’t blindly trust the output of glob() to be an array. #33093
  • Shortcodes: Handle do_shortcode('<[shortcode]') edge cases. #33116
  • Shortcodes: Protect newlines inside of CDATA. #33106

List of Files Revised

  • readme.html
  • wp-admin/about.php
  • wp-admin/includes/class-wp-upgrader.php
  • wp-admin/includes/post.php
  • wp-admin/includes/update-core.php
  • wp-admin/js/nav-menu.js
  • wp-admin/js/nav-menu.min.js
  • wp-admin/post.php
  • wp-includes/class-wp-customize-widgets.php
  • wp-includes/class-wp-embed.php
  • wp-includes/default-widgets.php
  • wp-includes/formatting.php
  • wp-includes/l10n.php
  • wp-includes/post.php
  • wp-includes/shortcodes.php
  • wp-includes/theme.php
  • wp-includes/version.php
  • wp-includes/wp-db.php