Hi @jimmi_steen,
There are two filters available for adjusting term input data after they’ve been saved:
the_seo_framework_current_term_meta // adjusting CURRENT data
the_seo_framework_get_term_meta // adjusting FALLBACK data
The fallback data is only accessible on new terms, or terms that haven’t been edited since TSF was active.
Each filter has two parameters, and they both work like so:
add_filter( 'the_seo_framework_current_term_meta', function( $data, $term_id ) {
if ( 2 === $term_id ) {
// Adjust $data for $term_id 2 here.
$data['doctitle'] = 'Title...';
$data['description'] = 'Description...';
$data['noindex'] = 0;
$data['nofollow'] = 1; // nofollow is now enabled.
$data['noarchive'] = 0;
}
return $data;
}, 10, 2 );
If you wish to adjust the term meta on a “term-update action”, then you should check out WordPress function update_term_meta()
, which uses update_metadata( 'term', ...[] )
. There, you can inspect and rewrite the data via various hooks. It’s not very convenient, as they require you to loop a filter.
So, I should implement a filter which allows you to adjust the data easily on the save action.
I’ve created issue 316 for this, which should be brought with version 3.1 of TSF.
I expect 3.1 to be released in July 2018.
Cheers ??