Easiest Way to Create a Patch for Submission to WordPress Core?

The easiest way to create a patch is described here: http://wordpress.org/download/svn/ Can I create patches from older version or must I use trunk? You should create the patch against the same version you want it applied against. In other words, don’t expect a patch created against WP 3.0.1 to apply cleanly on WP 3.1-alpha. If … Read more

Update media library files after upload via FTP

Avoid direct upload WordPress doesn’t scan upload directory for new files, instead use WordPress media uploader to add files WordPress automatically creates folder and store them accordingly. But you can use this plugin to import those uploaded files into WordPress, it should help you https://wordpress.org/plugins/add-from-server/

Is There a Way to Completely Turn Off Pingbacks/Trackbacks?

<?php /* Plugin Name: [RPC] XMLRPCless Blog Plugin URI: http://earnestodev.com/ Description: Disable XMLRPC advertising/functionality blog-wide. Version: 0.0.7 Author: EarnestoDev Author URI: http://earnestodev.com/ */ // Disable X-Pingback HTTP Header. add_filter(‘wp_headers’, function($headers, $wp_query){ if(isset($headers[‘X-Pingback’])){ // Drop X-Pingback unset($headers[‘X-Pingback’]); } return $headers; }, 11, 2); // Disable XMLRPC by hijacking and blocking the option. add_filter(‘pre_option_enable_xmlrpc’, function($state){ return ‘0’; … Read more

How to provide a local fallback for Font Awesome if CDN fails?

The problem is that I’m pretty sure it’s impossible to check if CSS is effectively added to a page via PHP: CSS is parsed by the browser, so client side, and has completely no effect on server side. Of course, in PHP it’s possible to check if CDN is responsive or not… Option 1 Send … Read more

$wpdb won’t insert NULL into table column

Update: Since WordPress 4.4. this is now supported by the insert, update, replace and delete methods of wpdb and the ticket #15158 has been closed as fixed. Thanks to @dmsnell for commenting about that update. On the other hand, the null support in wpdb::prepare() is currently closed as wontfix in ticket #12819. Previous answer: NULL … Read more

What are all the Properties of the WordPress Post Object?

Post object is mostly queried row of wp_posts database table with some extras. It is easy to dump content of one and see: object(stdClass) public ‘ID’ => int public ‘post_author’ => string public ‘post_date’ => string public ‘post_date_gmt’ => string public ‘post_content’ => string public ‘post_title’ => string public ‘post_excerpt’ => string public ‘post_status’ => … Read more