Skip to content

Take custom filter miso_post_to_record #7

@simonpai

Description

@simonpai

We could have another filter that maps ($record, $post) -> $record.

For example:

function my_miso_post_to_record(array $record, WP_Post $post) {
    if (!array_key_exists('custom_attributes', $record)) {
        $record['custom_attributes'] = [];
    }
    $record['custom_attributes']['title_initial'] = substr($post->post_title, 0, 2);
    return $record;
}

add_filter('miso_post_to_record', 'my_miso_post_to_record', 10, 2);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions