Skip to content

Commit

Permalink
TMS-1075: Redipress 2 filters
Browse files Browse the repository at this point in the history
  • Loading branch information
eebbi committed Oct 10, 2024
1 parent 779d8bf commit d3ded34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- TMS-1075: Redipress 2 filters

## [1.10.3] - 2024-09-25

- TMS-1071: Fix events price element class
Expand Down
14 changes: 7 additions & 7 deletions lib/PostType/Artwork.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public function __construct() {
* @return void
*/
public function hooks() : void {
add_action( 'init', Closure::fromCallable( [ $this, 'register' ] ), 15 );
add_filter( 'tms/gutenberg/blocks', Closure::fromCallable( [ $this, 'allowed_blocks' ] ), 10, 1 );
\add_action( 'init', Closure::fromCallable( [ $this, 'register' ] ), 15 );
\add_filter( 'tms/gutenberg/blocks', Closure::fromCallable( [ $this, 'allowed_blocks' ] ), 10, 1 );

add_filter(
\add_filter(
'tms/base/breadcrumbs/before_prepare',
Closure::fromCallable( [ $this, 'format_single_breadcrumbs' ] ),
10,
3
);

add_filter( 'redipress/schema_fields', function ( $fields ) {
\add_filter( 'redipress/index/posts/schema_fields', function ( $fields ) {
$fields[] = new TextField( [
'name' => 'artists',
'sortable' => true,
Expand All @@ -81,15 +81,15 @@ public function hooks() : void {
return $fields;
}, PHP_INT_MAX, 1 );

add_filter( 'redipress/additional_field/artists', function ( $value, $post_id, $post ) {
\add_filter( 'redipress/additional_field/artists', function ( $value, $post_id, $post ) {
if ( $post->post_type === Artwork::SLUG ) {
$value = get_post_meta( $post_id, 'artists', true );
$value = \get_post_meta( $post_id, 'artists', true );
}

return $value;
}, 10, 3 );

add_filter( 'redipress/search_fields', function ( $fields ) {
\add_filter( 'redipress/search_fields', function ( $fields ) {
$fields[] = 'artists';

return $fields;
Expand Down

0 comments on commit d3ded34

Please sign in to comment.