Releases: level-level/Clarkson-Core
Releases · level-level/Clarkson-Core
1.1.2
1.1.1
0.4.6
0.4.5
0.4.4
1.1.0
1.0.0
Clarkson Core 1.0.0 🎉
New/changed features
- Now uses the actual WordPress template hierarchy, solving a lot of edge cases around template loading.
- The twig environment is exposed through the new
clarkson_twig_environment
filter. - Normalises the
Clarkson_User
andClarkson_Term
object creation interfaces. - Minor docblock typehint improvements in
Clarkson_Object
. - Extends parameters available in
Clarkson_Core_Gutenberg_Block_Type::clarkson_render_callback
Clarkson_Object
has a newget_object()
method.- Adds new
clarkson_core_template_context
filter. - Adds
object
as the first ofobjects
to twig context. - There is now an object hierarchy:
- Objects: \Clarkson_Core\WordPress_Object$post_type, \Clarkson_Core\WordPress_Object\base_object, \Clarkson_Core\WordPress_Object\Clarkson_Object
- Terms: \Clarkson_Core\WordPress_Object$taxonomy, \Clarkson_Core\WordPress_Object\base_term, \Clarkson_Core\WordPress_Object\Clarkson_Term
- Users: \Clarkson_Core\WordPress_Object\user, \Clarkson_Core\WordPress_Object\Clarkson_User
- Templates: \Clarkson_Core\WordPress_Object$template, \Clarkson_Core\WordPress_Object\base_template, \Clarkson_Core\WordPress_Object\Clarkson_Template,
- Post Types: \Clarkson_Core\WordPress_Object\post_type_$post_type, \Clarkson_Core\WordPress_Object\base_post_type, \Clarkson_Core\WordPress_Object\Clarkson_Post_Type
- Blocks: \Gutenberg\Blocks$block_name, \Gutenberg\Blocks\base_block, Clarkson_Core\Gutenberg\Block_Type
- Adds
get_terms()
method to mimicget_objects
andget_users
on Object factory. - Adds
clarkson_term_types
andclarkson_user_type
filters to overwrite class lookup. - Adds
Clarkson_Post_Type
object.post_type
is also automatically added to the template context on archive pages. - The twig environment is now only created once per request.
Clarkson_Object::get_many
can now set it a variable to it's \WP_Query.- Adds a filter
clarkson_core_{$post_type}_templates
to manipulate templates per post type. - Adds
::get_many
,::get_one
and::get
methods toClarkson_Term
andClarkson_User
. - Adds
get_roles()
method (returns role name as string) toClarkson_User
. - Adds
get_role_objects()
method (returnsClarkson_Role
) toClarkson_User
. - The
get_children()
andget_attachments()
methods on theClarkson_Object
now accepts a Post arguments parameter.
Backward incompatible changes:
- Removes compatibility for WordPress < 4.7.
- Removes 'page-' template file name compatibility.
- Themes that relied on incorrect loading of template files may experience some incompatibility.
- Removes
Clarkson_Object::get_json
, which was deprecated in0.2.0
. - The
Clarkson_Term
andClarkson_User
interfaces have changed, and you might now get an Exception, instead of an invalid object. - Removes deprecated features everywhere except for wordpress-objects/
- Removes loading of user roles instead of a user object.
- Removes deprecated construction of objects by id. Use ::get instead.
- Objects, term and user creation calls (such as ::get and ::get_one) now return null instead of throwing an error when no valid result is found.
- Updates twig from v1 to v3. See https://twig.symfony.com/doc/1.x/deprecated.html and https://twig.symfony.com/doc/2.x/deprecated.html
- Updates required PHP version to 7.2.
- Removes
get_role()
method fromClarkson_User
because a user can have multiple roles. Replaced withget_roles()
method, which returns an array of role names. - The
get_children()
andget_attachments()
methods on theClarkson_Object
now returnClarkson_Object[]
instead ofWP_Post[]
. - Template objects are now standalone objects (
Clarkson_Template
), instead of extendingClarkson_Object
.
1.0.0-rc5
- Fixes issue with non-absolute paths not being rendered.
1.0.0-rc4
- Correctly renders templates in symlinked folders.