The Theme Review Team Releases Two Feature Packages, an Autoloader and a Customize Section Button

Two weeks ago, Justin Tadlock published a proposal on behalf of the Theme Review Team to create a set of standardized packages that theme authors can drop-into their themes. This week, the team has released two feature packages that illustrate what the project is trying to accomplish.

The first is an Autoloader that provides the means necessary for theme authors to autoload PHP classes. While Composer is recommended, the team has created a PSR-4 compliant autoloader as an alternative for those not ready for Composer.

“This is a foundational package that will allow you to use any other packages that we create,” Tadlock explained. “You could even use it for autoloading your own theme classes if you choose to do so (assuming they follow the PSR-4 autoloading standard for class and folder names).”

The second package provides a Customizer Section Button that enables theme authors to create a link or button that points to a URL. This feature was originally developed to allow developers a standard way to display a Pro/Upsell link within the customizer. However, the package is generic enough that developers can use it to link to any URL.

Tadlock also provided feedback on a number of ideas that were proposed. Packages up for consideration include, Breadcrumbs, Sliders and Sections, Mobile Navigation, Color Control with Transparency, Appearance > Theme Name Page, and Standard Template Hooks.

To read his feedback and learn more about the project, including how to get involved, read the feature package update and the initial proposal.

6

6 responses to “The Theme Review Team Releases Two Feature Packages, an Autoloader and a Customize Section Button”

  1. Oh god. He is registering yet another autoloader for count($this->loaders) TIMES count($collections).

    https://github.com/WPTRT/autoload/blob/master/src/Loader.php#L102

    Can it be any more inefficient? Just shoot me now. Ugh.

    -Mike

    P.S. Core should have ONE autoloader function — that only runs a tiny amount of code for each attempt to load a class file — for all themes and for plugins) to use, and they should do it via a class map created with a build script just like themes create CSS from SCSS files today.

    Every theme and every plugin creating their own autoloaders is just a nightmare.

  2. > Packages up for consideration include, Breadcrumbs, Sliders and Sections, Mobile Navigation, Color Control with Transparency, Appearance > Theme Name Page, and Standard Template Hooks.

    The autoloader is not really needed as I think theme authors should be using Composer. It’s a standard in the PHP world right now.

    The customizer button is already there for a long time.

    These 2 packages are not what I expect. I’d love to see implementation of the packages above. They are truly improvements.

    • If you go too ambitious with your first project, it can sometimes take too long to get off the ground. Often, it is better to start with smaller projects to solve some of the bigger issues that you’ll run into later.

      For example, some of the things we needed to figure out were:

      – Project naming.
      – Namespacing.
      – Build process for assets.
      – Whether to force Composer usage.

      Those are “big” questions. By working on a smaller project to start with, we could explore some variations and decide on answers to those questions without it getting too much in the way of releasing a 1.0. Then, those questions are already answered for future projects.

      Sure, the end result of the two packages may not be all that exciting. However, they’ve allowed us to get something, anything, off the ground and set us up for success in the long term. I’ll take small wins any day.

      As for Composer, we’re strongly pushing theme authors to use it for dependency management and autoloading. However, some folks need a little help getting there. This is strictly a transitional tool. Not everyone grasps Composer right off the bat. We want to gently nudge them into that world, not shove them in head first.

  3. I somehow missed this post when it was first published. I did want to make one correction. This was not a “release” of those projects. It was an announcement that they were under development and a call for contribution. I think we may have gotten a few comments from people who thought they were ready for production. :)

    We have officially released the above-mentioned packages today though.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.