Skip to content

Commit

Permalink
Merge pull request #219 from level-level/fix/template-context-priorit…
Browse files Browse the repository at this point in the history
…y-v1

Fix/template context priority v1
  • Loading branch information
ken-ll authored Mar 11, 2021
2 parents b59cdf3 + 26b5377 commit 2bab966
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

<!--- Provide a general summary of your changes in the Title above -->

## Issue link
<!--- Link to the origin of the issue in Asana or HelpScout. -->

## Description
<!--- Describe your changes in detail -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
strategy:
matrix:
php: ['7.2', '7.3', '7.4']
php: ['7.4']
fail-fast: false
name: PHP ${{ matrix.php }}
runs-on: ubuntu-18.04
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Yes, at Level Level we use it for all of our new projects. It's already running

== Changelog ==

= 1.1.1 - March 11, 2021 =

* Change the priority of the clarkson_core_template_context filter from 10 to 5 to make sure Clarkson Core fills the context first.

= 1.1.0 =

* Adds a new `clarkson_core_block_context_{$name}` hook to modify variables available in the twig render function of a block.
Expand Down
10 changes: 5 additions & 5 deletions src/Template_Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class Template_Context {
* Register all hooks to add context to the template call.
*/
public function register_hooks():void {
add_filter( 'clarkson_core_template_context', array( $this, 'add_author' ), 10, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_term' ), 10, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_search_count' ), 10, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_posts' ), 10, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_post_type' ), 10, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_author' ), 5, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_term' ), 5, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_search_count' ), 5, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_posts' ), 5, 2 );
add_filter( 'clarkson_core_template_context', array( $this, 'add_post_type' ), 5, 2 );
}

/**
Expand Down

0 comments on commit 2bab966

Please sign in to comment.