• Resolved dmje

    (@dmje)


    I’m using TML in a multisite where I’m setting defaults in functions.php when new subsites are created.

    The question I have is – is there a hook or filter I can use to automatically enable themed profiles when (I presume) wpmu_new_blog is called?

    Thanks!

    Mike

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    You would have to use TML’s option methods in order to add the Themed Profiles module:

    
    function my_custom_new_blog_callback( $blog_id ) {
        switch_to_blog( $blog_id );
        $tml = Theme_My_Login::get_object();
        $active_modules = $tml->get_option( 'active_modules', array() );
        $active_modules[] = 'themed-profiles.php';
        $tml->set_option( 'active_modules', $active_modules );
        $tml->save_options();
        restore_current_blog();
    }
    add_action( 'wpmu_new_blog', 'my_custom_new_blog_callback' );
    
    Thread Starter dmje

    (@dmje)

    @jeff – so sorry, I realise that I never replied to you – thank you so much, this was brilliantly helpful ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Enable themed profile automatically’ is closed to new replies.