Tag: Code Snippets

  • Detecting Back Button Usage in Non-SPAs

    The biggest project I work on at work is a React-based Web App (that ISN’T a Single Page Application). At its core it is a directory listing for people on a site which are represented by custom post types with associated custom taxonomies. We’ve tried to build it to be as flexible and customizable as…

  • Ordering items in HTML forms

    Recently, I was working on a plugin to convert ACF fields to the post content for a custom post type we use. The custom post type is used by another plugin I wrote that has per-site fields for the custom post type, varying from 3 fields to 37 fields. Since I wanted to make this…

  • Exporting WordPress pages in menu order

    The original title for this post was “How to print the Internet in the correct order”, but my humor can fall a bit flat some times so I thought I better stick to a more descriptive title. We recently had a project at work that required us to print out the contents of one of…

  • The cheap-n-easy way to use “templates” in WordPress plugins

    I’m continuing to work on the plugin I talked about in my last post, and have gotten to the point where we’re working on the front end display of the data. I recently sat down and really dedicated myself to figuring out the WordPress Plugin Boilerplate and really like the concept of using “partials” to reuse…

  • Loading custom values into ACF field default values

    A plugin I’m working on requires that the user be able to set the map center for a Google Map ACF field that is associated with a custom post type. Advanced Custom Fields has a good number of filters, but I wasn’t sure going in which filter I needed to use.  A quick Google lead…