no more WPLANG in wp-config
as of 4.0, WP doesnt use
define('WPLANG', 'en_GB');
in wp-config but uses
$locale='fr_FR';
It provides crucial plugin info and many pointers. Like plugin folder, plugins name, plugins main file . More importantly, it could help you with a global unique_slug. More on this, and get_file_data() workaround later…
My metaboxes suddenly stopped working. If that’s the case for you, and you are clueless, try resetting $id for your meta_box
<?php function notify_post_status( $post_id = NULL, $user = ” ) { if ( ! isset($_POST[“post_id”]) ) { $post_id = $_POST[“post_id”]; } else { return $post_id; } $post = get_post($post_id); $status = $post->post_status; $type = $post->post_type; $author_id = intval($post->post_author); $user = get_userdata( $author_id ); //ignore admin if( $author_id == 1 ) return; // Which statuses should…
Long story short: BAD IDEA, don’t. It’s widely recommended to edit some of the spam comments -removing the spam url and editing comment content to something more related- and approving them in order to gain you some SEO advantage.It’s supposed to give you SEO advantage if your article has more comments (You could fake it…
If you are familiar with WordPress, you should already know that you should almost never have to use get_posts(). Your best bet is to use WP_Query . As good as wp_query is, you should still fine-tune it depending on your needs, it does make a difference. For example, if you just need 1 random post…
Time and again i fall for this same simple mistake. This may not be intuitive in the context of serialized arrays. If you fetch a serialized array with this method you want $single to be true to actually get an unserialized array back. If you pass in false, or leave it out, you will have…