Skip to:
Content
Pages
Categories
Search
Top
Bottom

Plugin:change_newblog_defaults

  • change_newblog_defaults will remove the default urls from the users blog and instead add a link back to the users BP profile

    Save the code below to mu-plugins/change_newblog_defaults.php

    <?php
    require_once( 'bp-core.php' );
    function change_newblog_defaults( $blog_id, $user_id )
    {
    global $current_site;
    switch_to_blog($blog_id);

    //--change default blogroll
    wp_delete_link(1); //delete WordPress.com blogroll link
    wp_delete_link(2); //delete WordPress.org blogroll link
    //add a link to the users profile page
    wp_insert_link(array('link_name' => __('My Profile', 'buddypress'), 'link_url' => bp_core_get_user_domain($user_id)));
    //uncomment the line below if you want a link back to your main site
    /*wp_insert_link(array('link_name' => $current_site->domain, 'link_url' => 'http://' . $current_site->domain . $current_site->path));*/
    //--end
    restore_current_blog();
    }
    add_action( 'wpmu_new_blog', 'change_newblog_defaults', 10, 2 );
    ?>

    edit: the code above is a modified version of http://mu.wordpress.org/forums/topic.php?id=9369#post-56231

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin:change_newblog_defaults’ is closed to new replies.
Skip to toolbar