Software Engineering in Web Development, Backend Services, and More

Category: Articles (Page 208 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

Programmatically Upload Files in WordPress (and Create Associated Meta Data)

This is post one of two on how to upload files in WordPress and created associated meta data.

In a recent project, I’ve been working on a plugin in which the user needs to upload a file to a custom post type by using an input element (of type file, obviously) rather than using the WordPress media uploader.

In addition to being able to upload the file, the user must also be able to view the file and remove the file (via Ajax) by an available anchor.

In order to do this, the plugin has to do the following:

  1. Upload the file to the `uploads` directory
  2. Save the file URL to the custom post type’s post meta data
  3. Save the file path to the custom post type’s post meta data
  4. Delete the file from the `uploads directory
  5. Clear the post meta data referencing the file

The primary reason that you have to store the file’s location on disk is because you can’t rely on PHP to delete a file via remote requests.

To that end, you need to be able to store not only where the file is on disk (for the sake of being able to delete), but also the URL of the file so that visitors or viewers can access the file via their browser.

Over the next two articles, I’ll share how to programmatically upload files in WordPress and save their associated meta data, and then I’ll share how to programmatically delete the files in WordPress as well as their associated meta data.
Continue reading

Developers Must Know Everything, Or I’m Out of a Job

I was talking with a fellow developer recently about some of the more recent “tools of the trade,” so to speak.

That is, we were discussing some of the newer frameworks that have been made available, web server software, configuration management tools, and dependency management applications.

I don’t know if this is a good thing or a bad thing, but the truth is that for the past couple of years, my technology stack hasn’t changed all of that much: Everything from the database all the way up through the IDE that I use has remained the same.

This isn’t to say that learning new technologies isn’t important, but I think that there’s something in our culture – at least in the United States – that invites us to spend our time spreading ourselves very thin across a variety of technologies rather than becoming specialized in a smaller subset of tools.

Continue reading

Writing Open Source Code (Or “Here Be Dragons”)

Here Be Dragons

I don’t know if this is something that every developer experiences – regardless of what level of the stack you work on – but I know that for those who truly care about getting better at what we do, there’s often this constant feeling of “I think this could be better.”

Or, perhaps another way of saying it, is that one of the challenges in writing open source code is the criticism that can come that infuse a level of self-doubt.

For example, how many times have those of you who have contributed to a larger project, built something of your own from the ground up, or simply tried to write a small add-on to an existing solution, ended up with something that works, but have this sinking feeling that this just isn’t as elegant – or, I dunno, optimal – as it should be.

I mean, surely it’s not just me, right?

Continue reading

Developers Need Help Marketing WordPress Themes

If you hang around the WordPress Community long enough (that is, those people who are involved in working on WordPress or building something on WordPress in some way), you’ll notice that we all have a tendency to aim to build the best thing possible – whatever that may be.

At least, that’s what we claim to be doing.

And I’m just as guilty of this as the next person.

But let’s face it: developers need help marketing WordPress themes. Perhaps designers do, too. And let’s not forget plugins or other add-ons.

Basically, I think that we get so involved with the community of which we’re a part, we forget about the market and the terms in which they think. We’re busy trying to help one another other, perhaps even impress one another, and even working to try to out-do each other (I mean, come on, that is competition, right?), that we end up marketing our products in the same way every single time.

And you know what I’m talking about.

Continue reading

Officially Partnering with Envato and WordPress

For the past several years, I’ve contributed a number of articles and premium tutorials to Envato specifically around WordPress.

The content has ranged from topics such as Strategies For Supporting WordPress Plugins up through my current series on Using WordPress For Web Application Development.

To say that I enjoy contributing code and content to WordPress is an understatement.

To that end, I’m proud to announce that I – or, more specifically, Pressware – is officially partnering with Envato and WPTuts+ in 2014.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑