Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
Adds a simple "Unpublish" button to the publish meta box, allowing users to quickly change a published post to pending in a single click (the usual method of manually changing the status to Draft/Pending and then updating is arguably not very user friendly).
$post_typeargument support for Index helper's
compatibilityoptions for custom admin pages.
query_argsoption for post list/select fields.
- When setting up an enqueue, you can now pass
'mtime'for the version and it'll use the file's modification time.
A number of bugs ranging from minor to WTF have been fixed, namely:
- Shorthand processing works more predictably now.
- Fixed do_preload logic on qs-media.js; gallery editors now working properly again.
- User and Term meta now support the
- Fixed meta box saving to work with Quick/Bulk editing better.
- Fixed logic for checking if a taxonomy exists for the order manager.
- Fixed meta box data saving to unslash post fields.
- Fixed post type registration to respect passing FALSE for the supports option.
- Fixed the Sections helper
get_sections()function to prevent accidentally returning ALL sections.
This will very likely be the last major release of QuickStart. I'm working on recreating the entire system into a stand-alone framework that can be used as a vendor component in a theme, plugin, or as a drop-in for the WordPress core. In hindsight, QuickStart should never have been a plugin as it's too easy to break a site using it when updating, and should be safe to modify on a case-by-case basis if needed. Also, I'm working on distributing a number of the helpers as standalone plugins, rather than arbitrarily packaged into the system.
So... funny story folks...
WordPress 4.4 added it's own
get/the_post_thumbnail_url() function, which of course works differently than the one added by the
The one in the attachment helper has been renamed to
get/the_post_attachment_image_url(), please update your theme files if you're using it.
Oh, and the update notice system was broken; damn copy pasta typo.
- Adds autoloading access to a collection of custom walker classes for use with
wp_nav_menu()(currently only one available: Walker_Inline_Nav_Menu)
- Adds filter to
wp_nav_menu_argsthat adjusts the output for inline nav menus if the class is detected.
Numeric Values for Select and Input List fields
Select and checklist/radiolist fields now support a
"numeric_values" boolean option; this allows you to pass a numeric array as the values list and not have the values used as the keys (since apparently a numeric string key and an integer key are indistinguishable).
- Admin menu re-ordering now properly handles comments menu.
- Fixed bugs with handling options for
- Sidebar registration is restored (was completely broken during the Setup restructuring and didn't notice).
- Improved sanity checks on
Template::doc_start()has been rejigged to support custom IE version flagging (or none at all).
handle_shorthand()tool has been moved to an namespaced functions file (wasn't worth putting in a Trait and besides those aren't supported in PHP version before 5.4)
- Rewrote the autoloader and moved it to a separate file.
- Moved update notice check to
Fixed a how-did-I-miss-that bug in the request hook of the Index Page feature that completely broke it. Seriously, I'm baffled how I didn't notice that during unit testing
Also added some better sanity checks to the
handle_shorthand() utility, namely for the event when a closure is passed as the "name".
Also added some future proofing for both WordPress 4.4 as well as checking/displaying notices about any drastic changes in future updates to QuickStart.
Section Manager Feature
A new feature can be registered for post types:
section_manager. The feature registers a hidden post type called
qs_section, and adds a meta box to applicable post types allowing you to add/edit/order sections, for use cases where a page would have separate/independent content objects included, such as asides or chunks that need their own management. By default this will only apply to pages.
You can now write even less config code by describing common details of fields, field types, meta boxes, post types, and taxonomies by including those details in an abbreviated notation in the name itself. Here's an admittedly over the top example:
'post_types' => array( // This... 'email@example.com#dashicons-art=title,editor,revisions' => array( 'meta_boxes' => array( 'poster@side/high' => array( 'type' => 'media.gallery', ), ), ), // ...would be the same as 'project' => array( 'position' => 25.5, 'icon' => 'dashicons-art', 'supports' => array('title', 'editor', 'revisions'), 'meta_boxes' => array( 'poster' => array( 'context' => 'side', 'priority' => 'high', 'type' => 'media', 'gallery' => true, ), ), ), ),
The details will be documented in detail on the Codex.
Special Select and Input List Fields
You can now quickly create select or input list fields that list available posts, menus, or templates. The available field type names are
templatelist. When a post select/list field is used on the edit screen for a post, the current post will be excluded automatically.
Post Select/List Options
post_type: A specific post type to filter for (will default to the current post's type or otherwise page). The
_type_optionpseudo-option aliases to this.
post_status: An array of statuses to filter for (defaults to publish, private and draft).
exclude: A single ID or array of IDs of posts to exclude (will default to the current post if applicable).
none_option: The name of the option to display for selecting no post at all.
orderby: A field or array of fields to order by (defaults to menu_order followed by post_title).
order: The order of the posts to retrieve (defaults to asc)
parent: The parent post ID to filter by (defaults to 0 if the post type is hierarchical, or false which won't filter at all).
Menu Select/List Options
None. Just grabs all available navigation menus to select from.
Template Select/List Options
default: The value of the first, default option (default is "default")
default_name: The label of the first, default option (default is "Default Template")
Widget Loading Tool
This tool allows you to quickly register a list of widgets identified only by their name, provided they all have the same naming convention for their respective files. This is intended for setups where each widget is in it's own file.
Tools::setup_widgets( array( // The list of widget classes 'Featured_Profile', 'Generic_Promo', 'Latest_News', 'Twitter_Feed', ), THEME_PATH . '/inc/widgets/', // The path they're all located in false, // Filenames follow WP naming conventions (e.g. Featured_Profile > class-featured-profile.php), null, // A prefix that applies to all widget names false, // Apply the prefix to the filenames as well );
The tool will go through each widget, create the filename from the widget name, load the file if it exists, and then add the hook to register the widget class provided it actually worked.
The WPEdit helper has been heavily revised.
- The CSS enqueue hook now actually works.
- The included CSS is now heavily specific so as to prevent theme styling from messing with the buttons (via an unhealthy amount of !important flags).
- The settings for each button can now be passed as an array, and the settings now include a capability option (speaking of which, the permissions check for post edit buttons has been fixed to actually test for the current user being able to edit the post in question).
- There is now a toggle button added to the admin bar, allowing you to toggle the visibility of all the buttons on and off.
Map Field Geocoding Revisions
Google is deprecating the use of browser keys on the Geocoding API, so the map field no longer accepts a key parameter. Instead, the geocoding feature is now passed to an AJAX hook setup by QuickStart which geocodes the address on the server side. To pass your own API key instead of using/defining the default
GOOGLE_API_SERVER_KEY constant, the
geocode_address() tool now supports a filter for replacing the API key being used.
- Added a new
qs:media-changedevent that's triggered when a qs-media field item is removed.
- Settings fields can now accept a
callback_argsoptions, for overwriting the default
Tools::build_settings_fieldcallback and setting/args callback arguments.
- You can now pass a callback as a settings field's arguments itself, similar to that of regular fields or meta boxes.
- Added special classes to repeater fields wrapper;
single-field, to identify if the basic structure of the items within.
Smart_Pluginclass now supports callback removal, details here.
Tweaks and Bug Fixes
- Fixed alias functions not returning results (oops).
- Updated order manager feature's admin pages to use the post type's capability when registering.
- Column setup now just uses the
get_index()to check for tag/category archives since
is_tax()doesn't cover those.
Tools::upload()to make sure the necessary wp-includes are loaded.
- Constants are now setup after all plugins are loaded, to account for stuff like Domain Mapping changing stuff.
Template::title_filterto global in
- Fixed post type archive check on
- Fixed post type existence check on order manager feature.
- Fixed bug with prefixing post field value in
- Tweaked patterns on custom post type archive rewrites.
- Overhauled rewrites for custom index pages; now parses request URI on the fly to check if it's for a valid index page before handling as a date/paged archive query.
- Numerous class name additions and changes changes to field HTML.
- The search field in the map field type no longer clears on submit, in case of typo corrections and whatnot.
- The QS Helpers CSS/JS enqueues are now loaded with the plugin rather than once
- Added helper to hide the customizer (via capability removal).
Custom post types will now have date archive rewrites setup (e.g.
/event/2015/05/06/page/2/), and the index helper now includes
get_post_type_[date/year/month/day]_link() functions. The index page feature also adds blanket date archive permalinks, so it'll match for any pages that have date/page arguments appended to it (e.g.
/events-index/2015/05/06/page/2/). There is now an
add_rewrites() method in Tools to easily add multiple rewrites via a single array.
Also added new utilities for more precise testing of ajax/backend/frontend:
is_ajax()will test wether or not a wordpress ajax request is being handled.
is_login()will test wether or not the login/register page is being viewed.
is_frontend()will test ether or not we're on the front-end (including front-end only ajax requests).
Term Meta Helper
- Adds functionality for term meta data, stored in a custom termmeta table, and approrpiately extends off the existing Meta Data API, functioning the exact same as post/user/comment meta.
- Adds filter to term_clauses that enables support for basic term meta filtering and ordering (e.g.
'orderby' => 'meta_value_num',
'meta_key' => 'menu_order').
- Note: term meta is stored by term_id, not term_taxonomy_id, due to WordPress' change of splitting terms that are shared between taxonomies into separate ones.
Term Meta and User Meta Fields
You can now register custom fields for the edit term and edit user screens.
- For terms, define the custom fields via a
'meta_fields'entry in your taxonomy definition (you can also do this for existing taxonomies). The term_meta helper will automatically be loaded.
- For users, define the custom fields via a
'user_meta'entry in the root of the Setup configs array.
Term Support for Order Manager
The order manager feature now supports term ordering; register the necessary taxonomies alongside your post types. These should be registered via the new
'objects' setting, though it will automatically use the value in
'post_types' if present. Note: currently will not support post types with the same name as a taxonomy properly
WP Edit Helper
Some useful utilities for inserting WordPress style Edit This buttons into parts of your theme, for editing parts of the site that aren't the queried object itself (e.g. nav menus, custom option stuff, child objects, etc.)
There is now special handling for the
hidden input type; simply forces the
type attribute and doesn't bother with wrapping in a field.
load_helperstool now accepts an 'all' argument, allowing you to load all the regular helpers.
hidetools have been moved to their own separate helper files (e.g. hide/posts). The
hidetool itself now also takes an 'all' argument, to load all the hide helpers.
hide_commentstool/helper now enforces the disabling of comments; filters have been added to set
xmlrpc_enabledto false, as well as cause the
default_ping_statusoptions to always return "closed". Trackbacks support is also removed from all post types when this helper is loaded.
- Extra editors can now accept
- New post_type_save_field method in Tools; setup a save hook to save a value to a specific post field (e.g. menu_order).
- New maybe_prefix_post_field method in Tools; will prefix field names that should start with "post_".
Notable Internal Changes
Smart_Pluginclass (i.e. the thing Setup, Tools and Callbacks are based on) has been reworked to be more flexible. You can now setup callbacks/hooks via the
setup_callback()method (in object or static context). Said callbacks can be attached to custom hooks, or created as just the callback with a number of accepted callback arguments specified. Usage details can be found on the new GitHub Project for it. Note: the
$static_method_hooksproperties are now just a static version of
$method_hookswhen defining the extending classes.
- Many of the functions used for hooks in the helpers have been renamed, they now all follow a
- The chunk making logic of the
post_chunkshelper is now available for external use via the
- The QS.media helpers now use
value-emptyclasses rather than
.show()to hide/show the remove button on single media fields.
- Now that WordPress 4.2 identifies the Front and Posts pages in the page listing table, the index_page feature will do the same with any pages set as a post type index page.
Okay, let's hope there won't be a need for 2 patches in 48 hours again.
These are just embarrassing...
- relabel_posts actually works again now.
- qs-helpers.js is enqueued with jquery-ui-sortable dependency now.
- fixed arguments list for ga_code so it works properly again now.
Fixed a bug with
get_index() not working properly on singular post entries, and added a new
qs_helper_is_index_page filter to
is_index_page() so you can filter the ID before the check is performed.