• Resolved Anonymous User 18593166

    (@anonymized-18593166)


    I used the hooks below and place it on functions.php but it doesn’t return any effect

    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 );
    } );
    • This topic was modified 4 years, 3 months ago by Anonymous User 18593166.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    The actions also have their callbacks changed in TSF v4.1.4, so the snippet above no longer works.

    Method 1, headless mode (recommended):
    I recommend adding this constant definition in wp-config.php instead:

    define( 'THE_SEO_FRAMEWORK_HEADLESS', [ 'user' => true, 'meta' => false, 'settings' => false ] );
    

    Method 2, action removal:
    If you wish to keep using functions.php, then you may want to implement this action-removal:

    add_action( 'the_seo_framework_after_admin_init', function() {
    	remove_action( 'current_screen', [ tsf(), '_init_user_edit_view' ] );
    } );

    However, the action-removal comes with adverse effects that the constant definition above mitigates, such as preventing lookups to unadjustable metadata.

    • This reply was modified 4 years, 2 months ago by Sybre Waaijer. Reason: forgot the MD implementation here is janky
    Thread Starter Anonymous User 18593166

    (@anonymized-18593166)

    Hello Sybre!

    Yeah I’ve checked the docs and activated the partial headless mode. The issue is now resolved!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cannot hide Authorial Info by using hooks’ is closed to new replies.