diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 0b45e20..379cc35 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -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.18.9] - 2024-09-25 - TMS-1067: Show price-info for event in listing if it's free diff --git a/lib/PostType/Artwork.php b/lib/PostType/Artwork.php index 0a5fa49..ad3982f 100644 --- a/lib/PostType/Artwork.php +++ b/lib/PostType/Artwork.php @@ -63,22 +63,22 @@ 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( + \add_filter( 'tms/base/breadcrumbs/after_prepare', Closure::fromCallable( [ $this, 'format_archive_breadcrumbs' ] ), ); - add_filter( 'redipress/schema_fields', function ( $fields ) { + \add_filter( 'redipress/index/posts/schema_fields', function ( $fields ) { foreach ( $fields as $schema_field ) { // Bail out if artists key already exists in schema if ( $schema_field->name === 'artists' ) { @@ -94,15 +94,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 ) { if ( ! in_array( 'artists', $fields, true ) ) { $fields[] = 'artists'; }