Articles of bug

Possible bug: update_user_meta is updating two unique meta entries

On a CPT page I am checking to see if the user is logged in; if they are, I’m checking to see if they have a meta entry which is ‘session-‘ + the current page’s stub. If they do, I increment the value by one. I thought this was all working fine, but I’ve just […]

remove_menu_page breaks “Add media”

Using the the remove_menu_page function results in a really strange bug. By adding the code below in the functions.php file the integrated “Add media” widget starts to bug. function remove_menu_pages() { // Remove admin menu pages that are not used remove_menu_page( ‘link-manager.php’ ); remove_menu_page( ‘tools.php’ ); } add_action( ‘admin_init’, ‘remove_menu_pages’ ); When clicking “Add Media” […]

Are .MP3 files with capital letter extensions allowed in shortcode?

In WordPress 3.6, using the new shortcode, I can add a player for an .mp3 file like this: However, if the .mp3 file has capital letters in the extension, it doesn’t work: If I specify the format in the shortcode, it still fails, although in a different way: Looking at function wp_audio_shortcode in “wp-includes/media.php”, I […]

Add Media has stopped working in the front end since 4.5 update

I’ve got a page that calls wp_editor in the front end. Since upgrading to 4.5, the Add Media button no longer does anything at all. It works fine if you call it in the admin section. There’s no word from WordPress on this yet, but I’ve seen this complaint in a bunch of plugins all […]

Programmatically insert hierarchical terms & set terms for post causes glitch?

This question already has an answer here: Inserting terms in an Hierarchical Taxonomy 5 answers

wp_enqueue_script with dependencies doesn't work

I’m having this code: wp_register_script(‘parent’,’parent.js’, array(‘child’), ‘1’, true); wp_register_script(‘child’, ‘child.js’, array(‘grandchild’), ‘1’, true); wp_register_script(‘grandchild’, ‘grandchild.js’, array(), ‘1’, true); wp_enqueue_script(‘parent’); and it works fine, rendering grandchild.js, then child.js, then parent.js in footer. Every combination of just parent and child works fine, regardless of TRUE or FALSE ‘render in footer’. But when I register ‘child’ to be […]

get_template_directory_uri does not seem to work when defining WP_CONTENT_DIR

I have defined in my config: define( ‘WP_CONTENT_DIR’, dirname(__FILE__) . ‘/somedirectory’ ); after Codex: Editing WP Config BUT <?php echo get_template_directory_uri(); ?> prints out: http://dev.domain.com/wp-content/themes/mytheme Even though it should print out http://dev.domain.com/somedirectory/themes/mytheme Has anyone else experienced this or know of a fix?

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 […]

Bug in Stackoverflow styled badge system script

I have modified an old Stackoverflow inspired badge system script to work with the latest WordPress version. You can view the code here (and please feel free to use it if you wish). It has a condition system that detects Post tags, Post count and Comment count. You can create custom badges and assign conditions […]

Dashboard says “no posts found” even though there are some posts

I have a weird bug on the dashboard: the dashboard says there are a total of 3 posts, but the list is empty and says “No posts found” (see image below) It’s a fresh install on a shared Windows hosting, using SQL Server as the database with the WP Db Abstraction plugin. I tried reinstalling […]