Skip to content

1.0.0

Compare
Choose a tag to compare
@NielsdeBlaauw NielsdeBlaauw released this 30 Nov 09:25
· 80 commits to master since this release
fa096a4

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 and Clarkson_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 new get_object() method.
  • Adds new clarkson_core_template_context filter.
  • Adds object as the first of objects 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 mimic get_objects and get_users on Object factory.
  • Adds clarkson_term_types and clarkson_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 to Clarkson_Term and Clarkson_User.
  • Adds get_roles() method (returns role name as string) to Clarkson_User.
  • Adds get_role_objects() method (returns Clarkson_Role) to Clarkson_User.
  • The get_children() and get_attachments() methods on the Clarkson_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 in 0.2.0.
  • The Clarkson_Term and Clarkson_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 from Clarkson_User because a user can have multiple roles. Replaced with get_roles() method, which returns an array of role names.
  • The get_children() and get_attachments() methods on the Clarkson_Object now return Clarkson_Object[] instead of WP_Post[].
  • Template objects are now standalone objects (Clarkson_Template), instead of extending Clarkson_Object.