The MU forums have moved to WordPress.org

Same custom field for each sub-blog? (5 posts)

  1. trex33
    Member
    Posted 14 years ago #

    Searched for answer on this to no avail. Is there way to to create custom field that would automatically appear in each sub-blog? I'd like to save users from having to create it themselves.

    For example, let's say I want to create custom field for "My Favorite Movies" for all of the sub-blogs.

  2. trex33
    Member
    Posted 14 years ago #

    Can anyone help me on this? I gotta think others have tried to add custom fields to their users's sub-blogs.

  3. spacetolive
    Member
    Posted 14 years ago #

    use custom field gui. it is a wp plugin but tried it on my latest version mu and it works fine. its config is done in a text file. i put it in plugins so the users can control if they want to use it or not.

    http://rhymedcode.net/custom-field-gui/custom-field-gui/

  4. chinafla
    Member
    Posted 14 years ago #

    mark it

  5. MrBrian
    Member
    Posted 14 years ago #

    Everytime a blog is created, the hook 'wpmu_new_blog' can be used. Example code:

    add_action( 'wpmu_new_blog', 'add_custom_field', 10, 2 );

    functin add_custom_field( $blog_id, $user_id ){
    add_blog_option( $blog_id, 'fav_movies', 'james bond, batman, etc.' );
    }

About this Topic