Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?

Try making a new post, pasting this string of emojis: “🐻🐝🐦🐈🐔🐄🦀🐕🐬🐘🐟🐸🐐🐎🐒🐼🐖🐑🐟🐢🐳” and then saving that post as a draft. When I do this (in WP version 4.7.4), it removes the emojis. First I create the post: After clicking “Save Draft”: The culprit here seems to be the crab emoji:🦀 If you take it out the … Read more

is_category() function

I have category which name is ’51m series’ (it has id 135). Why the expression is_category(51) is true on this category page? I think it should be false according to WordPress Codex. Is it a bug? Wordpress 3.5.2 category.php code: <?php get_header(); ?> <?php if (is_category(array(36, 63, 64, 65, 67))) { get_template_part(‘category’, ‘papers’); } elseif … Read more

Why are double-periods (“..”) invalid in a WordPress image filename?

ms-files.php contains the following code fragment: $file = rtrim( BLOGUPLOADDIR, “https://wordpress.stackexchange.com/” ) . “https://wordpress.stackexchange.com/” . str_replace( ‘..’, ”, $_GET[ ‘file’ ] ); if ( !is_file( $file ) ) { status_header( 404 ); die( ‘404 &#8212; File not found.’ ); } This code determines whether or not the file can be found. However, it does something … Read more

Weird behaviour when adding terms/term_taxonomies programmatically

This certainly looks like a bug to me. I put together the following code for you to test it on a fresh install. Basically, the code will add two sub categories under the “uncategorized” to achieve the following effect uncategorized sub-uncategorized sub-sub-uncategorized No problems with adding them to the wp_terms and wp_term_taxonomies. Both Parent ID’s … Read more

Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords

Some images that are uploaded to WordPress don’t show up in the Media Library. The images get uploaded and even cropped to the defined sizes, there is an entry in the Media Library, but the preview image doesn’t show. I can even use them as a featured image and they show up correctly on my … Read more