Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 119 of 219)

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

Get Values of Multiple Elements in jQuery

There are a number of JavaScript libraries and frameworks available right now – more than there have ever been before – and I think that’s a great thing.

If you’re a WordPress developer, odds are you’ve worked with at least one of three variations of JavaScript:

  1. jQuery since its included as part of core as is the choice library for the front-end
  2. Backbone since its also included as part of core and is used in features like the Media Uploader
  3. Vanilla JavaScript because sometimes the rest is overkill

And if you’re building advanced themes, plugins, or even web applications with WordPress, then odds are you’ve had to do some fancy stuff with JavaScript (using one or none of the aforementioned libraries). One of the challenges we face, though, is there’s no formal documentation of how to use jQuery within the context of WordPress core.

Should there be, though? I mean the jQuery Documentation is solid.

jQuery API

Anyway, one of the things I’ve stumbled across when writing my own code or in performing code audits is the way in which some developers attempt to get values of multiple elements in jQuery. Though there are some ways that work, there are always some options better than others.

Continue reading

Quick Tip: WordPress Helper Functions For Templates

A little over a week ago, I shared a post about one way I try to work well with designers when working with WordPress. That is, I talked about how of stubbing out files they may need in order to get their work done.

Starting Up a Plugin

As mentioned in the post:

There are plenty of tips that can be shared and I’ll probably share more in the future.

So I thought I’d try to make this a regular thing by continuing to share some of the things I’ve learned – both what to do and what not to do – when partnering with designers or I’ve learned when simply working alone or with others on WordPress projects.

And one of the things I’ve found to be helpful is to provide helper functions when needing to call into more complicated functionality.

Continue reading

What Is the Vendor Directory?

With the rise of package managers, build tools, and other similar software being brought to WordPress, we’re seeing more advanced directory structures in both our themes and our plugins.

Some of these tools have been around a long time – at least in one form or another – as it relates to software development, but it’s still relatively new with respect to WordPress.

If you’re new to WordPress development or you’re new to some of the various tools we have at our disposal for working on these types of projects, then it’s easy to get overwhelmed with some of the organizational choices of said projects.

Relax: that’s normal. It’s a natural part of the learning curve.

Though there’s a lot that can be talked about with respect to all of this, I thought it might be worth tackling just one aspect of it in this particular article.

Continue reading

Live Code Reviews at WordCamp Tampa

At the end of September (September 25th – 27th, to be exact), there are going to be a lot of great people at WordCamp Tampa.

Code Reviews at WordCamp Tampa

 

As of now, the schedule is still being put together, so I don’t know any more details than what you can find on the website; however, there is one event that I think anyone who is coming. should consider attending: A live code audit.

In short, it’s your code in front of a panel of other people critiquing it in front of all of your peers. Sounds scary, right?

Years ago, I used to think so – but then I realized just how great code reviews can be and I urge anyone who is writing code for a living to have someone else review their work.

Continue reading

Quick Tip: Searching Custom Post Types

Say what you will about the built in WordPress search functionality – sure, it could stand to be improved (personally I’m a fan of SearchWP) – but not all projects warrant the same requirements, right?

Sometimes, the built-in search functionality works just fine out-of-the-box. It gets a little more involved if you start introducing, say, custom taxonomies or custom post types, though.

That is, say you’re working on a project or have a client who needs help with modifying the built in search functionality so that it allows for searching custom post types. There’s actually a lot of flexibility provided in how you tailor the search results, but for this case it’s pretty easy. Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑