Category: WordPress

  • WordPress REST API returns 500 error when updating serialized meta with an unchanged value

    Take care when updating posts via the WordPress REST API to not send unchanged serialized meta values. The entire update will fail and return a 500 error. The JSON response looks like this: { “code”: “rest_meta_database_error”, “message”: “Could not update meta value in database.”, “data”: { “key”: “meta_key_name”, “status”: 500 } } This error comes […]

  • Setting post_parent with the WordPress REST API

    WordPress 4.9.4 does not support the post_parent attribute in the REST API, so I wrote a plugin that does. Download here: https://github.com/csalzano/wp-api-add-post-parent Someday, WordPress core will allow the manipulation of the post_parent attribute, and I look forward to deleting this plugin and this blog post when they become obsolete. Until then, I believe this implementation resembles […]

  • Spinners and loading animations built into WooCommerce

    WooCommerce is a big plugin that ships with several JavaScript loading animations. There is no reason to roll your own when you need one. This week, I am hacking on WooCommerce to convert “Add to Cart” buttons to prevent redirecting users to different pages. Here’s a great tutorial I used to accomplish this goal. Without […]

  • Thickbox.js: a modal API hidden in WordPress core

    Yesterday, I needed to create a modal, but I didn’t want to create a modal. “Surely, this is already in WordPress.”Corey Salzano So, I went looking for a modal in WordPress core, and I was delighted when I found one. Thickbox is JavaScript library that was created more than one decade ago and began shipping with […]

  • WPEngine caches WordPress REST API GET responses

    Logged out users of a website hosted at WPEngine may receive cached responses to REST API calls via the GET method. API calls work correctly while logged in, but paths in the /wp-json/ directory are cached like much like the rest of the front-end. How to prevent cached REST API responses As of June 2017, […]

  • Presenting at the October Philly #burbswp meetup

    I am presenting at the October Philly ‘burbs meetup @ Michael’s Deli in King of Prussia, PA. More details

  • When renaming your WP admin user, don’t neglect your comments

    A few months ago, popular people in the WordPress community (including Matt) made a push to stop using the user name “admin.” A considerably-sized brute force attack targeted this user name specifically since so many users never change or create an administrator with another name. I followed the wisdom of the crowd and this post […]

  • Clobber spam users WordPress plugin

    I’ve built another plugin for WordPress websites with open registration. This plugin makes it easy to prevent spam accounts from publishing posts. Frequently asked questions What does this thing do? This plugin adds an item to the Users menu of your administration dashboard. Click the “Clobber Spam” link and you will see a page that […]

  • Top users WordPress plugin

    I wrote a new plugin to list the contributors to a WordPress website. The comment and post counts are added together, and the top X users are listed in a simple table alongside the counts. Download top-users-by-comment-plus-post-count.zip. Installation instructions Upload the `top-users-by-comment-plus-post-count` folder to the `/wp-content/plugins/` directory Activate the plugin through the ‘Plugins’ menu in […]

  • Disable comment author links in WordPress

    I just wrote a new plugin to disable commenter names from linking to the website URLs they may provide when commenting. Some themes allow commenters to provide a home page URL along with their comment. The comment author’s name then becomes a link to that website wherever it appears on your site. This plugin removes […]

  • Add content to the bottom of every WordPress post

    Bottom of every post is a WordPress plugin I wrote in July of 2011. This plugin is a simple filter that adds some content to the bottom of each post. I thought for sure a plugin like this would already exist, and I was surprised to find a few very complex solutions with way more […]

  • Export comments WordPress plugin

    I launched a new WordPress plugin to export a blog’s comments. Specifically, this plugin creates a tab-delimited text version of the wp_comments database table. Options include approved, pending or spam (or any combination of) comments. This page will soon expand. For now… Download this plugin from WordPress.org