Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata: Add filter for custom taxonomies #1995

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Metadata/class-post-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,17 @@ private function get_categories( int $post_id, string $delimiter = '/' ): array
private function get_custom_taxonomy_values( WP_Post $post_obj ): array {
// Filter out default WordPress taxonomies.
$all_taxonomies = array_diff( get_taxonomies(), array( 'post_tag', 'nav_menu', 'author', 'link_category', 'post_format' ) );

/**
* Filters the taxonomies.
*
* @since 3.11.0
*
* @param array<string> $all_taxonomies Taxonomies.
* @param WP_Post $post_obj Post object.
*/
$all_taxonomies = apply_filters( 'wp_parsely_custom_taxonomies', $all_taxonomies, $post_obj );

acicovic marked this conversation as resolved.
Show resolved Hide resolved
acicovic marked this conversation as resolved.
Show resolved Hide resolved
$all_values = array();

foreach ( $all_taxonomies as $taxonomy ) {
Expand Down
Loading