Skip to content

Commit

Permalink
add advanced_posts_blocks_use_fallback_template filter
Browse files Browse the repository at this point in the history
  • Loading branch information
torounit committed Apr 16, 2022
1 parent f7d6aa9 commit 75b67f3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 39 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: Toro_Unit
Donate link: https://www.paypal.me/torounit
Tags: posts, blocks
Requires at least: 5.7
Tested up to: 5.8
Requires at least: 5.9
Tested up to: 5.9
Requires PHP: 7.3
Stable tag: 3.0.2
License: GPLv3 or later
Expand Down Expand Up @@ -108,6 +108,9 @@ endif;

## Changelog

### 4.0.0
* add `advanced_posts_blocks_use_fallback_template` filter.

### 3.0.1
* Child Posts Block: Bug fix for post type selector.

Expand Down
4 changes: 3 additions & 1 deletion src/blocks/children/class-renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public function render( array $attributes ) : string {
return $output;
}

$output = $this->get_content_from_default_template( $this->name );
if ( apply_filters( 'advanced_posts_blocks_use_fallback_template', true, $this->name ) ) {
$output = $this->get_content_from_default_template( $this->name );
}

return $output;
}
Expand Down
4 changes: 3 additions & 1 deletion src/blocks/post/class-renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public function render( array $attributes ) : string {
return $output;
}

$output = $this->get_content_from_default_template( $this->name );
if ( apply_filters( 'advanced_posts_blocks_use_fallback_template', true, $this->name ) ) {
$output = $this->get_content_from_default_template( $this->name );
}

return $output;
}
Expand Down
4 changes: 3 additions & 1 deletion src/blocks/posts/class-renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public function render( array $attributes ) : string {
return $output;
}

$output = $this->get_content_from_default_template( $this->name );
if ( apply_filters( 'advanced_posts_blocks_use_fallback_template', true, $this->name ) ) {
$output = $this->get_content_from_default_template( $this->name );
}

return $output;
}
Expand Down
22 changes: 0 additions & 22 deletions src/sample.test.js

This file was deleted.

7 changes: 0 additions & 7 deletions tests/js/jest.config.json

This file was deleted.

5 changes: 0 additions & 5 deletions tests/js/sample.test.js

This file was deleted.

0 comments on commit 75b67f3

Please sign in to comment.