Using a PHP debugger such as Xdebug along with an IDE such as PHPStorm can simplify troubleshooting complex problems. Xdebug offers a helpful stacktrace and can integrate with an IDE allowing you to set up breakpoints and evaluate the application state within the IDE. more…
PHP Articles
Exclude Custom Post Type From Search in WordPress
I ran into an issue the other day where I had custom post types showing up in WordPress search results. If you are manually registering your post types simply add the ‘exclude_from_search’ argument before registering. more…
Setting a WordPress Custom Post Type Parent to a Specific Page
Custom post types in WordPress are a great way to add and structure content to a website. Unlike a page however, custom post types cannot have a parent page assigned to them, at least not directly. This could be a major drawback if you want to have a custom post type nest under a specific page in menus and in the URL. more…
Force Password Complexity Requirements in WordPress
By default WordPress does not require strong or complex passwords but it is easy to add the functionality. Here is a great article explaining why strong passwords are so important. more…
Change the WordPress User Registration Welcome Email
When a user registers on your WordPress site or you create a user manually in wp-admin an email is sent automatically. In many cases this email will not be adequate; you may want to add a link, customize some of the copy, or create an HTML email with images. more…
Force URLS to use HTTP or HTTPS in Symfony 2
Using spl_autoload_register to Load All Classes in a PHP Project
If you have a several classes in your PHP project then you already know how annoying it can be to constantly include the class files before instantiating your class. more…
Create a Custom Page Link Sidebar Widget for WordPress
Creating a custom widget in WordPress is pretty easy and is a great way to allow users to modify their sidebar content. In this example we’ll create a widget that displays some copy and then renders a link to another page on the site. If you’re unfamiliar with WordPress widgets, the Widgets API Codex Reference is very helpful. more…
Modify a WordPress Custom Post Type Configuration After it has Been Registered
I came across a situation today where a plugin had registered a custom post type and I needed to change some of that configuration, namely I wanted to exclude the post type from search results. The solution is pretty simple. more…
Format the Created At Date in Twitter’s REST API
The Twitter REST API returns a created_at date with each API call as part of the JSON response. The problem is that the date returned is not a standard format nor is it in a format that is pleasing or useful in most circumstances. more…