Software Engineering in Web Development, Backend Services, and More

Tag: WordPress (Page 217 of 220)

Articles, tips, and resources for WordPress-based development.

Programmatically Create a User in WordPress

If you're an advanced developer or just want the TL;DR version of this, skip to the code.

When it comes to building a certain type of web app, I obviously think that WordPress is a viable option. Out of all of the contract work I’ve done in the past couple of years, about half of the projects have required some form of user management.

That is, they usually want users to create their own accounts, set a few fields such as their name and email address, and then be emailed when all is setup.

Out of the box, WordPress offers easy user management through its dashboard and if you’re running some type of blog or editorial site, there’s no need to deviate. But if you’re building an application, there are alternative ways to handle users.

Case in point: say that designer has created a solid look and feel for the site. If you force users to use the built-in dashboard to create or manage their profiles, then you’re yanking them out of the site, dropping them into some new experience, and then returning them to the site from which they came.

Lame, right?

There are better ways to introduce user registration and profile management into an app built on WordPress. Though your mileage may vary based on the needs of you project, here’s a how you can programmatically create a user in WordPress.

Continue reading

WordPress Generators and Why I Dislike Them

WordPress Generators

At this point, it’s relatively easy to find a generator to do almost anything you want with WordPress. In fact, you can assemble an entire theme with custom post types, taxonomies, and options all without actually writing any code.

Bummer.

But you know what I’m talking about – generators are small web-based tools that are used to, er, generate code for you based on a couple of inputs that you specify on an interface.

Off the top of my head, I can think of…

  • Generators for custom post types
  • Options frameworks for easily creating settings pages
  • Generators for taxonomies
  • Custom theme generators
  • …and more.

Don’t get me wrong, I think that these tools have their place in the development space (in fact, my boilerplates have even been converted to generators!).

But as a profesional developer and someone who cares about writing quality code tailored exactly for the problem at hand and as someone who wants to create the highest-quality products that I can, I dislike WordPress generators.

Continue reading

PEAR Command Not Found

Over the weekend, I updated my MAMP PRO installation to 2.1.0. After doing so, I needed to reinstall PHPUnit via Pear but I hit a snag: I kept receive the “pear command not found” console message.

Pear Command Not Found

Luckily, it’s a relatively easy fix but it does come with a caveat:

Continue reading

Add a Separator To The WordPress Menu

As far as the WordPress community is concerned, developers tend to be divided on how plugins and themes should insert themselves into the WordPress menu.

On one hand, some feel that because WordPress offers the ability to insert custom menu items into existing menus, then plugin and theme content should follow suit and exist only in the predefined menu; however, others feel that because WordPress offers the ability to define custom menu items, then they should take advantage of it.

In fact, opinionated plugins have been written specifically for on this.

I don’t have a hard stance on this issue – though I tend to lean in the direction of adding new functionality to existing menus, I think that there are perfectly suitable cases for defining custom menus.

But if you’re going to define a custom menu item, then you should place it logically among the existing menu items: If you’re writing a theme, its menu should be placed near the ‘Appearance’ options rather than, say, the ‘Dashboard’ options. Then again, there are times where makes sense to isolate a menu item to its own section. In order to do this, a custom separator may need to be added in addition to the menu.

Adding a separator to the WordPress menu isn’t difficult and though there are a variety of ways to do it, the easiest way to do about doing so is using a couple of custom functions registered with the WordPress API.

Below, I give a working example for how to add a separator to the WordPress menu. I also look at how the default menu is structured, the proper way to add your own separator, and an example plugin for doing just that. If you’re an advanced developer, it may be more beneficial (and quicker!) for you to refer to the source code on GitHub.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑