Небольшая шпаргалка по функциям WordPress MU:
WordPress MU Function List
If I’ve been surprised by the sheer lack of documentation in WordPress and especially in WordPress MU, I’ve been equally astounded to find how many really useful functions come native to the software that so few plugins actually employ. This is particularly true of MU plugins, and I’ve seen many a plugin dance around to perform a task which it now appears could as easily been done with one function from the wpmu-functions.php file. I’ve also written a fair number of plugins that suffer from this same lack of knowledge.
So, I GREP’ed the file to get a list of functions, which I then reordered and have displayed on this page. As I learn about those functions, I will update this page with links to discussions of them within posts. They are listed here more or less as the GREP results came out. That gives you the name and the expected parameters for each function, and since the names are fairly intuitive, experienced plugin writers should have no problem referencing them within wpmu-functions.php and figuring it out for themselves.
I reordered them to give them a bit of organization, preferring to group them according to broad-strokes User, Blog, Site and Navigation functions.
–== Site Functions ==–
load_muplugin_textdomain($domain, $path = false)
wpmu_update_blogs_date()
wpmu_checkAvailableSpace($action)
get_sitestats()
get_site_option( $key, $default = false, $use_cache = true )
add_site_option( $key, $value )
update_site_option( $key, $value )
get_last_updated( $display = false )
get_most_active_blogs( $num = 10, $display = true )
get_blog_list( $start = 0, $num = 10, $display = true )
domain_exists($domain, $path, $site_id = 1)
get_current_site()
–== Blog Functions ==–
get_blogaddress_by_id( $blog_id )
get_blogaddress_by_name( $blogname )
get_blogaddress_by_domain( $domain, $path )
get_blog_details( $id, $all = true )
refresh_blog_details( $id )
get_blog_option( $blog_id, $setting, $default=’na’ )
add_blog_option( $id, $key, $value )
delete_blog_option( $id, $key )
update_blog_option( $id, $key, $value, $refresh = true )
is_archived( $id )
update_archived( $id, $archived )
update_blog_status( $id, $pref, $value, $refresh = 1 )
get_blog_status( $id, $pref )
get_blog_count( $id = 0 )
get_blog_post( $blog_id, $post_id )
insert_blog($domain, $path, $site_id)
install_blog($blog_id, $blog_title = ”)
install_blog_defaults($blog_id, $user_id)
wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta = ”)
wpmu_create_blog($domain, $path, $title, $user_id, $meta = ”, $site_id = 1)
wpmu_validate_blog_signup($blog_id, $blog_title, $user = ”)
wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = ”)
create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 )
get_blog_permalink( $blog_id, $post_id )
–== User Functions ==–
get_admin_users_for_domain( $sitedomain = ”, $path = ” )
get_user_details( $username )
get_current_user_id()
is_site_admin( $user_login = false )
get_blogs_of_user( $id, $all = false )
get_active_blog_for_user( $user_id )
is_user_member_of_blog( $user_id, $blog_id = 0 )
add_user_to_blog( $blog_id, $user_id, $role )
remove_user_from_blog($user_id, $blog_id = ”)
is_blog_user( $blog_id = 0 )
get_user_id_from_string( $string )
wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = ”)
wpmu_welcome_user_notification($user_id, $password, $meta = ”)
wpmu_signup_user_notification($user, $user_email, $key, $meta = ”)
wpmu_activate_signup($key)
generate_random_password()
wpmu_create_user( $user_name, $password, $email)
validate_email( $email, $check_domain = true)
is_email_address_unsafe( $user_email )
wpmu_validate_user_signup($user_name, $user_email)
wpmu_signup_user($user, $user_email, $meta = ”)
–== Navigation/Traversing Blogs ==–
switch_to_blog( $new_blog )
restore_current_blog()
wpmu_admin_do_redirect( $url = ” )
wpmu_admin_redirect_add_updated_param( $url = ” )
wpmu_admin_redirect_url()
Смотрите также сайт
источник, там подробнее.