Hello!
This should do:
add_action( 'the_seo_framework_after_admin_init', function() {
$tsf = the_seo_framework();
remove_action( 'show_user_profile', [ $tsf, '_add_user_author_fields' ], 0 );
remove_action( 'edit_user_profile', [ $tsf, '_add_user_author_fields' ], 0 );
remove_action( 'personal_options_update', [ $tsf, '_update_user_settings' ], 10 );
remove_action( 'edit_user_profile_update', [ $tsf, '_update_user_settings' ], 10 );
} );
For future reference, you can access the object via the_seo_framework() function. We don’t pass the object through actions as it heaps up in the $GLOBALS['wp_actions'] cache size. With over 190 filters and over 55 actions, that can add up quickly!
Now you know that the_seo_framework() exists, I think you’ll find your way quickly in the future!
I hope this helps 🙂 Cheers!
Awesome, thanks so much! Totally didn’t notice this function.
I recommend adding a note about this to https://theseoframework.com/docs/api/actions/ and https://theseoframework.com/docs/api/filters/
Thanks again!
Cheers 🙂
I couldn’t find a nice way to weave that into those pages, so I’ve added it on the main API page, under “PHP API”.
I should make a full page explaining how it works… we also have builder-and (soon to come) bridge objects 🤔
Kudos for writing the docs. Not many devs have the patience (or capability) for that.
We recently moved away from Yoast and this brief conversation with you has confirmed that it was a good choice. Thanks again.