- absint()
- activate_plugin()
- activate_plugins()
- activate_sitewide_plugin()
- addslashes_gpc()
- add_action()
- add_blog_option()
- add_clean_index()
- add_comments_page()
- add_comment_meta()
- add_contextual_help()
- add_cssclass()
- add_custom_background()
- add_custom_image_header()
- add_dashboard_page()
- add_editor_style()
- add_existing_user_to_blog()
- maybe_add_existing_user_to_blog()
- add_feed()
- add_filter()
- add_image_size()
- add_link()
- add_links_page()
- add_magic_quotes()
- add_management_page()
- add_media_page()
- add_menu_classes()
- add_menu_page()
- add_meta()
- add_metadata()
- add_meta_box()
- add_network_option()
- add_new_user_to_blog()
- add_object_page()
- add_option()
- add_options_page()
- add_option_update_handler()
- add_option_whitelist()
- add_pages_page()
- add_permastruct()
- add_ping()
- add_plugins_page()
- add_posts_page()
- add_post_meta()
- add_post_type_support()
- add_query_arg()
- add_rewrite_endpoint()
- add_rewrite_rule()
- add_rewrite_tag()
- add_role()
- add_screen_option()
- add_settings_error()
- add_settings_field()
- add_settings_section()
- add_shortcode()
- add_site_option()
- add_submenu_page()
- add_term_meta()
- add_theme_page()
- add_theme_support()
- add_thickbox()
- Functions
- add_user()
- add_users_page()
- add_user_meta()
- add_user_to_blog()
- add_utility_page()
- adjacent_image_link()
- adjacent_posts_rel_link()
- adjacent_posts_rel_link_wp_head()
- adjacent_post_link()
- admin_color_scheme_picker()
- admin_created_user_email()
- admin_created_user_subject()
- admin_url()
- allowed_http_request_hosts()
- allowed_tags()
- allow_subdirectory_install()
- allow_subdomain_install()
- antispambot()
- apache_mod_loaded()
- apply_filters()
- apply_filters_deprecated()
- apply_filters_ref_array()
- array_replace_recursive()
- atom_enclosure()
- atom_site_icon()
- attachment_id3_data_meta_box()
- attachment_submitbox_metadata()
- attachment_submit_meta_box()
- attachment_url_to_postid()
- attribute_escape()
- author_can()
- auth_redirect()
- automatic_feed_links()
- avoid_blog_page_permalink_collision()
- background_color()
- background_image()
- backslashit()
- balanceTags()
- before_last_bar()
- bloginfo()
- bloginfo_rss()
- body_class()
- bool_from_yn()
- build_query()
- bulk_edit_posts()
- cache_javascript_headers()
- cache_users()
- get_userdata()
- calendar_week_mod()
- cancel_comment_reply_link()
- can_edit_network()
- capital_P_dangit()
- category_description()
- category_exists()
- cat_is_ancestor_of()
- checked()
- check_admin_referer()
- check_ajax_referer()
- check_and_publish_future_post()
- check_column()
- check_comment()
- check_comment_flood_db()
- check_import_new_users()
- check_password_reset_key()
- check_theme_switched()
- check_upload_mimes()
- check_upload_size()
- choose_primary_blog()
- clean_attachment_cache()
- clean_blog_cache()
- clean_bookmark_cache()
- clean_category_cache()
- clean_comment_cache()
- clean_network_cache()
- clean_object_term_cache()
- clean_page_cache()
- clean_post_cache()
- clean_pre()
- wpautop()
- clean_site_details_cache()
- clean_term_cache()
- clean_url()
- clean_user_cache()
- clear_global_post_cache()
- codepress_footer_js()
- codepress_get_lang()
- comments_link()
- comments_link_feed()
- comments_number()
- comments_open()
- comments_popup_link()
- comments_popup_script()
- comments_rss()
- comments_rss_link()
- comments_template()
- comment_author()
- comment_author_email()
- comment_author_email_link()
- comment_author_IP()
- comment_author_link()
- comment_author_rss()
- comment_author_url()
- comment_author_url_link()
- comment_class()
- comment_date()
- comment_excerpt()
- comment_exists()
- comment_footer_die()
- comment_form()
- comment_form_title()
- comment_guid()
- comment_ID()
- comment_id_fields()
- comment_link()
- comment_reply_link()
- comment_text()
- comment_text_rss()
- comment_time()
- comment_type()
- compression_test()
- confirm_another_blog_signup()
- confirm_blog_signup()
- confirm_delete_users()
- confirm_user_signup()
- content_url()
- convert_chars()
- convert_invalid_entities()
- convert_smilies()
- convert_to_screen()
- copy_dir()
- core_update_footer()
- core_upgrade_preamble()
- count_many_users_posts()
- count_users()
- count_user_posts()
- create_empty_blog()
- create_initial_post_types()
- create_initial_rest_routes()
- create_initial_taxonomies()
- create_user()
- wp_create_user()
- current_action()
- current_filter()
- current_theme_info()
- current_theme_supports()
- current_time()
- current_user_can()
- current_user_can_for_blog()
- customize_themes_print_templates()
- dashboard_browser_nag_class()
- date_i18n()
- dbDelta()
- deactivate_plugins()
- deactivate_sitewide_plugin()
- dead_db()
- debug_fclose()
- debug_fopen()
- debug_fwrite()
- default_password_nag()
- default_password_nag_edit_user()
- default_password_nag_handler()
- default_topic_count_scale()
- default_topic_count_text()
- delete_all_user_settings()
- delete_blog_option()
- delete_comment_meta()
- delete_get_calendar_cache()
- delete_meta()
- delete_metadata()
- delete_metadata_by_mid()
- delete_network_option()
- delete_option()
- delete_plugins()
- delete_post_meta()
- delete_post_meta_by_key()
- delete_post_thumbnail()
- delete_site_option()
- delete_site_transient()
- delete_term_meta()
- delete_theme()
- delete_transient()
- delete_usermeta()
- delete_users_add_js()
- delete_user_meta()
- delete_user_option()
- delete_user_setting()
- deslash()
- did_action()
- disabled()
- discover_pingback_server_uri()
- dismissed_updates()
- dismiss_core_update()
- display_header()
- display_header_text()
- display_plugins_table()
- display_setup_form()
- display_space_usage()
- display_theme()
- display_themes()
- documentation_link()
- doing_action()
- doing_filter()
- dolly_css()
- domain_exists()
- download_url()
- do_accordion_sections()
- do_action()
- do_action_deprecated()
- do_action_ref_array()
- do_activate_header()
- do_all_pings()
- do_core_upgrade()
- do_dismiss_core_update()
- do_enclose()
- do_feed()
- do_feed_atom()
- do_feed_rdf()
- do_feed_rss()
- do_feed_rss2()
- do_meta_boxes()
- do_robots()
- do_settings_fields()
- do_settings_sections()
- do_shortcode()
- do_shortcodes_in_html_tags()
- do_shortcode_tag()
- do_signup_header()
- do_trackbacks()
- do_undismiss_core_update()
- dropdown_categories()
- dropdown_cats()
- dropdown_link_categories()
- drop_index()
- dynamic_sidebar()
- edit_bookmark_link()
- edit_comment()
- edit_comment_link()
- edit_form_image_editor()
- edit_link()
- edit_post()
- edit_post_link()
- edit_tag_link()
- edit_term_link()
- edit_user()
- email_exists()
- endElement()
- enqueue_comment_hotkeys_js()
- enqueue_embed_scripts()
- ent2ncr()
- esc_attr()
- esc_attr_e()
- esc_attr_x()
- esc_attr__()
- esc_html()
- esc_html_e()
- esc_html_x()
- esc_html__()
- esc_js()
- esc_sql()
- esc_textarea()
- esc_url()
- esc_url_raw()
- export_add_js()
- export_date_options()
- export_wp()
- extract_from_markers()
- favorite_actions()
- feed_content_type()
- feed_links()
- feed_links_extra()
- fetch_feed()
- fetch_rss()
- file_is_displayable_image()
- file_is_valid_image()
- filter_default_option()
- filter_SSL()
- find_core_auto_update()
- find_core_update()
- find_posts_div()
- fix_import_form_size()
- fix_phpmailer_messageid()
- floated_admin_avatar()
- flush_rewrite_rules()
- force_balance_tags()
- force_ssl_admin()
- force_ssl_content()
- force_ssl_login()
- format_code_lang()
- format_for_editor()
- format_to_edit()
- format_to_post()
- form_option()
- funky_javascript_callback()
- funky_javascript_fix()
- gallery_shortcode()
- gd_edit_image_support()
- generate_random_password()
- generic_ping()
- get_404_template()
- get_active_blog_for_user()
- get_adjacent_post()
- get_adjacent_post_link()
- get_adjacent_post_rel_link()
- get_admin_page_parent()
- get_admin_page_title()
- get_admin_url()
- get_admin_users_for_domain()
- get_alloptions()
- get_alloptions_110()
- get_allowed_http_origins()
- get_allowed_mime_types()
- get_allowed_themes()
- get_all_category_ids()
- get_all_page_ids()
- get_all_post_type_supports()
- get_all_user_settings()
- get_ancestors()
- get_approved_comments()
- get_archives()
- get_archives_link()
- get_archive_template()
- get_attached_file()
- get_attached_media()
- get_attachment_fields_to_edit()
- get_attachment_icon()
- get_attachment_icon_src()
- get_attachment_innerHTML()
- get_attachment_link()
- get_attachment_taxonomies()
- get_attachment_template()
- get_author_feed_link()
- get_author_link()
- get_author_name()
- get_author_posts_url()
- get_author_rss_link()
- get_author_template()
- get_author_user_ids()
- get_autotoggle()
- get_available_languages()
- get_available_post_mime_types()
- get_available_post_statuses()
- get_avatar()
- get_avatar_data()
- get_avatar_url()
- get_background_color()
- get_background_image()
- get_blogaddress_by_domain()
- get_blogaddress_by_id()
- get_blogaddress_by_name()
- get_bloginfo()
- get_bloginfo_rss()
- get_blogs_of_user()
- get_blog_count()
- get_blog_details()
- get_blog_id_from_url()
- get_blog_list()
- get_blog_option()
- get_blog_permalink()
- get_blog_post()
- get_blog_status()
- get_body_class()
- get_bookmark()
- get_bookmarks()
- get_bookmark_field()
- get_boundary_post()
- get_boundary_post_rel_link()
- get_broken_themes()
- get_calendar()
- get_cancel_comment_reply_link()
- get_categories()
- get_category()
- get_category_by_path()
- get_category_by_slug()
- get_category_children()
- get_category_feed_link()
- get_category_link()
- get_category_parents()
- get_category_rss_link()
- get_category_template()
- get_category_to_edit()
- get_catname()
- get_cat_ID()
- get_cat_name()
- get_children()
- get_clean_basedomain()
- get_cli_args()
- get_column_headers()
- get_comment()
- get_commentdata()
- get_comments()
- get_comments_link()
- get_comments_number()
- get_comments_number_text()
- get_comments_pagenum_link()
- get_comments_popup_template()
- get_comment_author()
- get_comment_author_email()
- get_comment_author_email_link()
- get_comment_author_IP()
- get_comment_author_link()
- get_comment_author_rss()
- get_comment_author_url()
- get_comment_author_url_link()
- get_comment_class()
- get_comment_count()
- get_comment_date()
- get_comment_excerpt()
- get_comment_guid()
- get_comment_ID()
- get_comment_id_fields()
- get_comment_link()
- get_comment_meta()
- get_comment_pages_count()
- get_comment_reply_link()
- get_comment_statuses()
- get_comment_text()
- get_comment_time()
- get_comment_to_edit()
- WP_Comment
- get_comment_type()
- get_compat_media_markup()
- get_core_checksums()
- get_core_updates()
- get_currentuserinfo()
- get_current_blog_id()
- get_current_network_id()
- get_current_screen()
- get_current_site()
- get_current_site_name()
- get_current_theme()
- get_current_user_id()
- get_custom_header()
- get_custom_header_markup()
- get_custom_logo()
- get_dashboard_blog()
- get_dashboard_url()
- get_date_from_gmt()
- get_date_template()
- get_day_link()
- get_default_comment_status()
- get_default_feed()
- get_default_link_to_edit()
- get_default_page_to_edit()
- get_default_post_to_edit()
- get_delete_post_link()
- get_dirsize()
- get_dropins()
- get_editable_authors()
- get_editable_roles()
- get_editable_user_ids()
- get_editor_stylesheets()
- get_edit_bookmark_link()
- get_edit_comment_link()
- get_edit_post_link()
- get_edit_profile_url()
- get_edit_tag_link()
- get_edit_term_link()
- get_edit_user_link()
- get_embed_template()
- get_enclosed()
- get_extended()
- get_feed_link()
- get_file()
- get_filesystem_method()
- get_file_data()
- get_file_description()
- get_footer()
- get_front_page_template()
- get_gmt_from_date()
- get_header()
- get_header_image()
- get_header_image_tag()
- get_header_textcolor()
- get_header_video_settings()
- get_header_video_url()
- get_hidden_columns()
- get_hidden_meta_boxes()
- get_home_path()
- get_home_template()
- get_home_url()
- get_html_split_regex()
- get_http_origin()
- get_id_from_blogname()
- get_images_from_uri()
- get_image_send_to_editor()
- get_image_tag()
- get_importers()
- get_index_rel_link()
- get_index_template()
- get_inline_data()
- get_intermediate_image_sizes()
- get_language_attributes()
- get_lastcommentmodified()
- get_lastpostdate()
- get_lastpostmodified()
- get_last_updated()
- get_link()
- get_linkcatname()
- get_linkobjects()
- get_linkobjectsbyname()
- get_linkrating()
- get_links()
- get_linksbyname()
- get_linksbyname_withrating()
- get_links_list()
- get_links_withrating()
- get_link_to_edit()
- get_locale()
- get_locale_stylesheet_uri()
- get_main_network_id()
- get_media_embedded_in_content()
- get_media_item()
- get_media_items()
- get_metadata()
- get_metadata_by_mid()
- get_meta_keys()
- get_meta_sql()
- get_month_link()
- get_most_active_blogs()
- get_most_recent_post_of_user()
- get_mu_plugins()
- get_nav_menu_locations()
- get_network()
- get_networks()
- get_network_by_path()
- get_network_option()
- get_next_comments_link()
- get_next_post()
- get_next_posts_link()
- get_next_posts_page_link()
- get_next_post_link()
- get_nonauthor_user_ids()
- get_num_queries()
- get_objects_in_term()
- get_object_taxonomies()
- get_object_term_cache()
- get_oembed_endpoint_url()
- get_oembed_response_data()
- get_oembed_response_data_rich()
- get_option()
- get_others_drafts()
- get_others_pending()
- get_others_unpublished_posts()
- get_page()
- get_paged_template()
- get_pagenum_link()
- get_pages()
- get_page_by_path()
- get_page_by_title()
- get_page_children()
- get_page_hierarchy()
- get_page_link()
- get_page_of_comment()
- get_page_statuses()
- get_page_template()
- get_page_templates()
- get_page_template_slug()
- get_page_uri()
- get_parent_post_rel_link()
- get_parent_theme_file_path()
- get_parent_theme_file_uri()
- get_password_reset_key()
- get_pending_comments_num()
- get_permalink()
- get_plugins()
- get_plugin_data()
- get_plugin_files()
- get_plugin_page_hook()
- get_plugin_page_hookname()
- get_plugin_updates()
- get_post()
- get_postdata()
- get_posts()
- get_posts_by_author_sql()
- get_posts_nav_link()
- get_post_ancestors()
- get_post_class()
- get_post_comments_feed_link()
- get_post_custom()
- get_post_custom_keys()
- get_post_custom_values()
- get_post_embed_html()
- get_post_embed_url()
- get_post_field()
- get_post_format()
- get_post_format_link()
- get_post_format_slugs()
- get_post_format_string()
- get_post_format_strings()
- get_post_galleries()
- get_post_galleries_images()
- get_post_gallery()
- get_post_gallery_images()
- get_post_meta()
- get_post_meta_by_id()
- get_post_mime_type()
- get_post_mime_types()
- get_post_modified_time()
- get_post_permalink()
- get_post_reply_link()
- get_post_stati()
- get_post_status()
- get_post_statuses()
- get_post_status_object()
- get_post_taxonomies()
- get_post_thumbnail_id()
- get_post_time()
- get_post_to_edit()
- get_post_type()
- get_post_types()
- get_post_types_by_support()
- get_post_type_archive_feed_link()
- get_post_type_archive_link()
- get_post_type_archive_template()
- get_post_type_capabilities()
- get_post_type_labels()
- get_post_type_object()
- get_preferred_from_update_core()
- get_preview_post_link()
- get_previous_comments_link()
- get_previous_post()
- get_previous_posts_link()
- get_previous_posts_page_link()
- get_previous_post_link()
- get_private_posts_cap_sql()
- get_profile()
- get_pung()
- get_queried_object()
- get_queried_object_id()
- get_query_template()
- get_query_var()
- WP_Query
- get_random_header_image()
- get_raw_theme_root()
- get_real_file_to_edit()
- get_registered_metadata()
- get_registered_meta_keys()
- get_registered_nav_menus()
- get_registered_settings()
- get_rest_url()
- get_role()
- get_rss()
- get_sample_permalink()
- get_sample_permalink_html()
- get_screen_icon()
- get_search_comments_feed_link()
- get_search_feed_link()
- get_search_form()
- get_search_link()
- get_search_query()
- get_search_template()
- get_settings()
- get_settings_errors()
- get_shortcode_atts_regex()
- get_shortcode_regex()
- get_shortcut_link()
- get_sidebar()
- get_single_template()
- get_singular_template()
- get_site()
- get_sites()
- get_sitestats()
- get_site_allowed_themes()
- get_site_by_path()
- get_site_icon_url()
- get_site_option()
- get_site_transient()
- get_site_url()
- get_space_allowed()
- get_space_used()
- get_status_header_desc()
- get_stylesheet()
- get_stylesheet_directory()
- get_stylesheet_directory_uri()
- get_stylesheet_uri()
- get_subdirectory_reserved_names()
- get_submit_button()
- get_super_admins()
- get_tag()
- get_tags()
- get_tags_to_edit()
- get_tag_feed_link()
- get_tag_link()
- get_tag_regex()
- get_tag_template()
- get_taxonomies()
- get_taxonomies_for_attachments()
- get_taxonomy()
- get_taxonomy_labels()
- get_taxonomy_template()
- get_tax_sql()
- get_template()
- get_template_directory()
- get_template_directory_uri()
- get_template_part()
- get_temp_dir()
- get_term()
- get_terms()
- get_terms_to_edit()
- get_term_by()
- get_term_children()
- get_term_feed_link()
- get_term_field()
- get_term_link()
- get_term_meta()
- get_term_parents_list()
- get_term_to_edit()
- get_theme()
- get_themes()
- get_theme_data()
- get_theme_feature_list()
- get_theme_file_path()
- get_theme_file_uri()
- get_theme_mod()
- get_theme_mods()
- get_theme_root()
- get_theme_roots()
- get_theme_root_uri()
- get_theme_starter_content()
- get_theme_support()
- get_theme_updates()
- get_theme_update_available()
- get_the_archive_description()
- get_the_archive_title()
- get_the_attachment_link()
- get_the_author()
- get_the_author_aim()
- get_the_author_description()
- get_the_author_email()
- get_the_author_firstname()
- get_the_author_icq()
- get_the_author_ID()
- get_the_author_lastname()
- get_the_author_link()
- get_the_author_login()
- get_the_author_meta()
- get_the_author_msn()
- get_the_author_nickname()
- get_the_author_posts()
- get_the_author_posts_link()
- get_the_author_url()
- get_the_author_yim()
- get_the_category()
- get_the_category_by_ID()
- get_the_category_list()
- get_the_category_rss()
- get_the_comments_navigation()
- get_the_comments_pagination()
- get_the_content()
- get_the_content_feed()
- get_the_date()
- get_the_excerpt()
- get_the_generator()
- get_the_guid()
- get_the_ID()
- get_the_modified_author()
- get_the_modified_date()
- get_the_modified_time()
- get_the_password_form()
- get_the_permalink()
- get_the_posts_navigation()
- get_the_posts_pagination()
- get_the_post_navigation()
- get_the_post_thumbnail()
- get_the_post_thumbnail_caption()
- get_the_post_thumbnail_url()
- get_the_tags()
- get_the_tag_list()
- get_the_taxonomies()
- get_the_terms()
- get_the_term_list()
- get_the_time()
- get_the_title()
- get_the_title_rss()
- get_to_ping()
- get_trackback_url()
- get_transient()
- get_translations_for_domain()
- get_udims()
- get_uploaded_header_images()
- get_upload_iframe_src()
- get_upload_space_available()
- get_url_in_content()
- get_userdatabylogin()
- get_usermeta()
- get_usernumposts()
- get_users()
- get_users_drafts()
- get_users_of_blog()
- get_user_by()
- get_user_by_email()
- get_user_count()
- get_user_details()
- get_user_id_from_string()
- get_user_locale()
- get_user_meta()
- get_user_metavalues()
- get_user_option()
- get_user_setting()
- get_user_to_edit()
- get_weekstartend()
- get_wp_title_rss()
- get_year_link()
- global_terms()
- global_terms_enabled()
- got_mod_rewrite()
- got_url_rewrite()
- graceful_fail()
- grant_super_admin()
- gzip_compression()
- hash_equals()
- hash_hmac()
- has_action()
- has_category()
- has_custom_header()
- has_custom_logo()
- has_excerpt()
- has_filter()
- has_header_image()
- has_header_video()
- has_image_size()
- has_meta()
- has_nav_menu()
- has_post_format()
- has_post_thumbnail()
- has_shortcode()
- has_site_icon()
- has_tag()
- has_term()
- have_comments()
- have_posts()
- header_image()
- header_textcolor()
- heartbeat_autosave()
- hello_dolly()
- hello_dolly_get_lyric()
- home_url()
- htmlentities2()
- html_type_rss()
- human_time_diff()
- iframe_footer()
- iframe_header()
- iis7_add_rewrite_rule()
- iis7_delete_rewrite_rule()
- iis7_rewrite_rule_exists()
- iis7_save_url_rewrite_rules()
- iis7_supports_permalinks()
- image_add_caption()
- image_align_input_fields()
- image_attachment_fields_to_edit()
- image_attachment_fields_to_save()
- media_upload_form_handler()
- image_constrain_size_for_editor()
- image_downsize()
- image_edit_apply_changes()
- image_get_intermediate_size()
- image_hwstring()
- image_link_input_fields()
- image_make_intermediate_size()
- image_media_send_to_editor()
- image_resize()
- image_resize_dimensions()
- WP_Image_Editor
- image_size_input_fields()
- img_caption_shortcode()
- includes_url()
- index_rel_link()
- init()
- insert_blog()
- insert_with_markers()
- install_blog()
- install_blog_defaults()
- install_dashboard()
- install_global_terms()
- install_network()
- install_plugins_favorites_form()
- install_plugins_upload()
- install_plugin_information()
- install_plugin_install_status()
- install_popular_tags()
- install_search_form()
- install_themes_dashboard()
- install_themes_feature_list()
- install_themes_upload()
- install_theme_information()
- install_theme_search_form()
- in_category()
- in_the_loop()
- iso8601_timezone_to_offset()
- iso8601_to_datetime()
- is_404()
- is_active_sidebar()
- is_active_widget()
- is_admin()
- is_admin_bar_showing()
- is_allowed_http_origin()
- is_archive()
- is_archived()
- is_attachment()
- is_author()
- is_blog_admin()
- is_blog_installed()
- is_blog_user()
- is_category()
- is_child_theme()
- is_client_error()
- is_comments_popup()
- is_comment_feed()
- is_customize_preview()
- is_date()
- is_day()
- is_dynamic_sidebar()
- is_email()
- is_email_address_unsafe()
- is_embed()
- is_error()
- is_feed()
- is_front_page()
- is_header_video_active()
- is_home()
- is_info()
- is_lighttpd_before_150()
- is_locale_switched()
- switch_to_locale()
- is_local_attachment()
- is_main_blog()
- is_main_network()
- is_main_query()
- is_main_site()
- is_month()
- is_multisite()
- is_multi_author()
- is_nav_menu()
- is_nav_menu_item()
- is_network_admin()
- is_network_only_plugin()
- is_new_day()
- is_object_in_taxonomy()
- is_object_in_term()
- is_page()
- is_paged()
- is_page_template()
- is_plugin_active()
- is_plugin_active_for_network()
- is_plugin_inactive()
- is_plugin_page()
- is_post_type_archive()
- is_post_type_hierarchical()
- is_post_type_viewable()
- is_preview()
- is_protected_meta()
- is_random_header_image()
- is_redirect()
- is_registered_sidebar()
- is_robots()
- is_rtl()
- is_search()
- is_serialized()
- is_serialized_string()
- is_server_error()
- is_single()
- is_singular()
- is_site_admin()
- is_ssl()
- is_sticky()
- is_subdomain_install()
- is_success()
- is_super_admin()
- is_tag()
- is_tax()
- is_taxonomy()
- is_taxonomy_hierarchical()
- is_term()
- is_textdomain_loaded()
- is_time()
- is_trackback()
- is_uninstallable_plugin()
- is_upload_space_available()
- is_user_admin()
- is_user_logged_in()
- is_user_member_of_blog()
- is_user_option_local()
- is_user_spammy()
- is_wpmu_sitewide_plugin()
- is_wp_error()
- is_year()
- json_decode()
- json_encode()
- json_last_error_msg()
- js_escape()
- kses_init()
- kses_init_filters()
- kses_remove_filters()
- language_attributes()
- like_escape()
- links_add_base_url()
- links_add_target()
- links_popup_script()
- link_advanced_meta_box()
- link_categories_meta_box()
- link_pages()
- link_submit_meta_box()
- link_target_meta_box()
- link_xfn_meta_box()
- list_authors()
- list_cats()
- list_core_update()
- list_files()
- list_meta()
- list_plugin_updates()
- list_theme_updates()
- list_translation_updates()
- load_child_theme_textdomain()
- load_default_textdomain()
- load_image_to_edit()
- load_muplugin_textdomain()
- load_plugin_textdomain()
- load_template()
- load_textdomain()
- load_theme_textdomain()
- locale_stylesheet()
- locate_template()
- login_footer()
- login_header()
- logIO()
- maintenance_nag()
- make_clickable()
- make_db_current()
- make_db_current_silent()
- make_site_theme()
- make_site_theme_from_default()
- make_site_theme_from_oldschool()
- make_url_footnote()
- map_deep()
- map_meta_cap()
- maybe_add_column()
- maybe_convert_table_to_utf8mb4()
- maybe_create_table()
- maybe_disable_automattic_widgets()
- maybe_disable_link_manager()
- maybe_drop_column()
- maybe_hash_hex_color()
- maybe_redirect_404()
- maybe_serialize()
- maybe_unserialize()
- mbstring_binary_safe_encoding()
- mb_strlen()
- mb_substr()
- media_buttons()
- media_handle_sideload()
- media_handle_upload()
- media_post_single_attachment_fields_to_edit()
- media_send_to_editor()
- media_sideload_image()
- media_single_attachment_fields_to_edit()
- media_upload_audio()
- media_upload_file()
- media_upload_flash_bypass()
- media_upload_form()
- media_upload_gallery()
- media_upload_gallery_form()
- media_upload_header()
- media_upload_html_bypass()
- media_upload_image()
- media_upload_library()
- media_upload_library_form()
- media_upload_max_image_resize()
- media_upload_tabs()
- media_upload_text_after()
- media_upload_type_form()
- media_upload_type_url_form()
- media_upload_video()
- menu_page_url()
- metadata_exists()
- meta_box_prefs()
- meta_form()
- ms_allowed_http_request_hosts()
- ms_cookie_constants()
- ms_deprecated_blogs_file()
- ms_file_constants()
- ms_is_switched()
- switch_to_blog()
- ms_load_current_site_and_network()
- ms_not_installed()
- ms_site_check()
- ms_subdomain_constants()
- ms_upload_constants()
- multisite_over_quota_message()
- mu_dropdown_languages()
- mu_options()
- mysql2date()
- mysql_to_rfc3339()
- network_admin_url()
- network_domain_check()
- network_edit_site_nav()
- network_home_url()
- network_settings_add_js()
- network_site_url()
- network_step1()
- network_step2()
- newblog_notify_siteadmin()
- newuser_notify_siteadmin()
- new_user_email_admin_notice()
- next_comments_link()
- next_image_link()
- next_post()
- next_posts()
- next_posts_link()
- next_post_link()
- next_post_rel_link()
- next_widget_id_number()
- nocache_headers()
- noindex()
- normalize_whitespace()
- number_format_i18n()
- options_discussion_add_js()
- options_general_add_js()
- options_permalink_add_js()
- options_reading_add_js()
- options_reading_blog_charset()
- option_update_filter()
- page_attributes_meta_box()
- page_template_dropdown()
- paginate_comments_links()
- paginate_links()
- parent_dropdown()
- parent_post_rel_link()
- parse_w3cdtf()
- path_is_absolute()
- path_join()
- permalink_anchor()
- permalink_link()
- permalink_single_rss()
- pingback()
- pingback_ping_源代码_uri()
- pings_open()
- plugins_api()
- plugins_url()
- plugin_basename()
- plugin_dir_path()
- plugin_dir_url()
- plugin_sandbox_scrape()
- populate_network()
- populate_options()
- populate_roles()
- populate_roles_160()
- populate_roles_210()
- populate_roles_230()
- populate_roles_250()
- populate_roles_260()
- populate_roles_270()
- populate_roles_280()
- populate_roles_300()
- popuplinks()
- postbox_classes()
- posts_nav_link()
- post_author_meta_box()
- post_categories_meta_box()
- post_class()
- post_comments_feed_link()
- post_comment_meta_box()
- post_comment_meta_box_thead()
- post_comment_status_meta_box()
- post_custom()
- post_custom_meta_box()
- post_excerpt_meta_box()
- post_exists()
- post_format_meta_box()
- post_form_autocomplete_off()
- post_password_required()
- post_permalink()
- post_preview()
- post_reply_link()
- post_revisions_meta_box()
- post_slug_meta_box()
- post_submit_meta_box()
- post_tags_meta_box()
- post_thumbnail_meta_box()
- post_trackback_meta_box()
- post_type_archive_title()
- post_type_exists()
- post_type_supports()
- prepend_attachment()
- prep_atom_text_construct()
- press_it()
- press_this_media_buttons()
- preview_theme()
- preview_theme_ob_filter()
- preview_theme_ob_filter_callback()
- previous_comments_link()
- previous_image_link()
- previous_post()
- previous_posts()
- previous_posts_link()
- previous_post_link()
- prev_post_rel_link()
- pre_schema_upgrade()
- print_admin_styles()
- print_column_headers()
- print_embed_comments_button()
- print_embed_scripts()
- print_embed_sharing_button()
- print_embed_sharing_dialog()
- print_embed_styles()
- print_emoji_detection_script()
- print_emoji_styles()
- print_footer_scripts()
- print_head_scripts()
- print_late_styles()
- privacy_ping_filter()
- query_posts()
- RandomCompat_intval()
- RandomCompat_strlen()
- RandomCompat_substr()
- random_bytes()
- random_int()
- rawurlencode_deep()
- recurse_dirsize()
- redirect_canonical()
- redirect_guess_404_permalink()
- redirect_post()
- redirect_this_site()
- refresh_blog_details()
- refresh_user_details()
- registered_meta_key_exists()
- register_activation_hook()
- register_admin_color_schemes()
- register_column_headers()
- register_deactivation_hook()
- register_default_headers()
- register_importer()
- register_initial_settings()
- register_meta()
- register_nav_menu()
- register_nav_menus()
- register_new_user()
- register_post_status()
- register_post_type()
- register_rest_field()
- register_rest_route()
- register_setting()
- register_sidebar()
- register_sidebars()
- register_sidebar_widget()
- register_taxonomy()
- register_taxonomy_for_object_type()
- register_theme_directory()
- register_uninstall_hook()
- register_widget()
- register_widget_control()
- rel_canonical()
- remove_accents()
- remove_action()
- remove_all_actions()
- remove_all_filters()
- remove_all_shortcodes()
- remove_custom_background()
- remove_custom_image_header()
- remove_editor_styles()
- remove_filter()
- remove_image_size()
- remove_menu_page()
- remove_meta_box()
- remove_option_update_handler()
- remove_option_whitelist()
- remove_permastruct()
- remove_post_type_support()
- remove_query_arg()
- remove_rewrite_tag()
- remove_role()
- remove_shortcode()
- remove_submenu_page()
- remove_theme_mod()
- remove_theme_mods()
- remove_theme_support()
- remove_user_from_blog()
- request_filesystem_credentials()
- require_if_theme_supports()
- require_wp_db()
- wpdb
- reset_mbstring_encoding()
- reset_password()
- restore_current_blog()
- restore_current_locale()
- restore_previous_locale()
- rest_api_default_filters()
- rest_api_init()
- rest_api_loaded()
- rest_api_register_rewrites()
- rest_authorization_required_code()
- rest_cookie_check_errors()
- rest_cookie_collect_status()
- rest_do_request()
- rest_ensure_request()
- rest_ensure_response()
- rest_get_avatar_sizes()
- rest_get_avatar_urls()
- rest_get_date_with_gmt()
- rest_get_server()
- rest_get_url_prefix()
- rest_handle_deprecated_argument()
- _deprecated_argument()
- rest_handle_deprecated_function()
- _deprecated_function()
- rest_handle_options_request()
- rest_is_boolean()
- rest_is_ip_address()
- rest_output_link_header()
- rest_output_link_wp_head()
- rest_output_rsd()
- rest_parse_date()
- rest_parse_request_arg()
- rest_sanitize_boolean()
- rest_sanitize_request_arg()
- rest_sanitize_value_from_schema()
- rest_send_allow_header()
- rest_send_cors_headers()
- rest_url()
- rest_validate_request_arg()
- rest_validate_value_from_schema()
- retrieve_password()
- retrieve_widgets()
- revoke_super_admin()
- rewind_posts()
- rich_edit_exists()
- rsd_link()
- rss2_site_icon()
- rss_enclosure()
- safecss_filter_attr()
- sanitize_bookmark()
- sanitize_bookmark_field()
- sanitize_category()
- sanitize_category_field()
- sanitize_comment_cookies()
- sanitize_email()
- sanitize_file_name()
- sanitize_hex_color()
- sanitize_hex_color_no_hash()
- sanitize_html_class()
- sanitize_key()
- sanitize_meta()
- sanitize_mime_type()
- sanitize_option()
- sanitize_post()
- sanitize_post_field()
- sanitize_sql_orderby()
- sanitize_term()
- sanitize_term_field()
- sanitize_textarea_field()
- sanitize_text_field()
- sanitize_title()
- sanitize_title_for_query()
- sanitize_title_with_dashes()
- sanitize_trackback_urls()
- sanitize_url()
- sanitize_user()
- sanitize_user_field()
- sanitize_user_object()
- saveDomDocument()
- save_mod_rewrite_rules()
- screen_icon()
- screen_layout()
- screen_meta()
- screen_options()
- script_concat_settings()
- search_theme_directories()
- seems_utf8()
- selected()
- self_admin_url()
- self_link()
- send_confirmation_on_profile_email()
- send_frame_options_header()
- send_nosniff_header()
- send_origin_headers()
- separate_comments()
- settings_errors()
- settings_fields()
- setup_postdata()
- setup_userdata()
- set_current_screen()
- set_current_user()
- set_post_format()
- set_post_thumbnail()
- set_post_thumbnail_size()
- set_post_type()
- set_query_var()
- set_screen_options()
- set_site_transient()
- set_theme_mod()
- set_transient()
- set_url_scheme()
- set_user_setting()
- shortcode_atts()
- shortcode_exists()
- shortcode_parse_atts()
- shortcode_unautop()
- show_admin_bar()
- show_blog_form()
- show_message()
- show_user_form()
- shutdown_action_hook()
- signup_another_blog()
- signup_blog()
- signup_get_available_languages()
- signup_nonce_check()
- signup_nonce_fields()
- signup_user()
- single_cat_title()
- single_month_title()
- single_post_title()
- single_tag_title()
- single_term_title()
- site_admin_notice()
- site_icon_url()
- site_url()
- size_format()
- smilies_init()
- sort_menu()
- spawn_cron()
- spl_autoload_functions()
- spl_autoload_register()
- spl_autoload_unregister()
- startElement()
- start_post_rel_link()
- start_wp()
- status_header()
- sticky_class()
- stick_post()
- stream_preview_image()
- stripslashes_deep()
- stripslashes_from_strings_only()
- strip_fragment_from_url()
- strip_shortcodes()
- strip_shortcode_tag()
- submit_button()
- switch_theme()
- sync_category_tag_slugs()
- tag_description()
- tag_escape()
- tag_exists()
- taxonomy_exists()
- term_description()
- term_exists()
- term_is_ancestor_of()
- themes_api()
- theme_update_available()
- the_archive_description()
- the_archive_title()
- the_attachment_link()
- the_attachment_links()
- the_author()
- the_author_aim()
- the_author_description()
- the_author_email()
- the_author_firstname()
- the_author_icq()
- the_author_ID()
- the_author_lastname()
- the_author_link()
- the_author_login()
- the_author_meta()
- the_author_msn()
- the_author_nickname()
- the_author_posts()
- the_author_posts_link()
- the_author_url()
- the_author_yim()
- the_category()
- the_category_head()
- the_category_ID()
- the_category_rss()
- the_comment()
- the_comments_navigation()
- the_comments_pagination()
- the_content()
- the_content_feed()
- the_content_rss()
- the_custom_header_markup()
- the_custom_logo()
- the_date()
- the_date_xml()
- the_editor()
- the_embed_site_title()
- the_excerpt()
- the_excerpt_embed()
- the_excerpt_rss()
- the_feed_link()
- the_generator()
- the_guid()
- the_header_image_tag()
- the_header_video_url()
- the_ID()
- the_media_upload_tabs()
- the_meta()
- the_modified_author()
- the_modified_date()
- the_modified_time()
- the_permalink()
- the_permalink_rss()
- the_post()
- the_posts_navigation()
- the_posts_pagination()
- the_post_navigation()
- the_post_password()
- the_post_thumbnail()
- the_post_thumbnail_caption()
- the_post_thumbnail_url()
- the_search_query()
- the_shortlink()
- the_tags()
- the_taxonomies()
- the_terms()
- the_time()
- the_title()
- the_title_attribute()
- the_title_rss()
- the_weekday()
- the_weekday_date()
- the_widget()
- timer_start()
- timer_stop()
- tinymce_include()
- touch_time()
- trackback()
- trackback_rdf()
- trackback_response()
- trackback_url()
- trackback_url_list()
- trailingslashit()
- translate()
- translate_level_to_role()
- translate_nooped_plural()
- _n_noop()
- _nx_noop()
- translate_smiley()
- translate_user_role()
- translate_with_context()
- translate_with_gettext_context()
- translations_api()
- twentyeleven_admin_enqueue_scripts()
- twentyeleven_admin_header_image()
- twentyeleven_admin_header_style()
- twentyeleven_auto_excerpt_more()
- twentyeleven_body_classes()
- twentyeleven_color_schemes()
- twentyeleven_comment()
- twentyeleven_content_nav()
- twentyeleven_continue_reading_link()
- twentyeleven_customize_preview_js()
- twentyeleven_customize_register()
- twentyeleven_custom_excerpt_more()
- twentyeleven_enqueue_color_scheme()
- twentyeleven_excerpt_length()
- twentyeleven_footer_sidebar_class()
- twentyeleven_get_default_link_color()
- twentyeleven_get_default_theme_options()
- twentyeleven_get_first_url()
- twentyeleven_get_gallery_images()
- twentyeleven_get_theme_options()
- twentyeleven_header_style()
- twentyeleven_layouts()
- twentyeleven_layout_classes()
- twentyeleven_option_page_capability()
- twentyeleven_page_menu_args()
- wp_nav_menu()
- wp_page_menu()
- twentyeleven_posted_on()
- twentyeleven_print_link_color_style()
- twentyeleven_settings_field_color_scheme()
- twentyeleven_settings_field_layout()
- twentyeleven_settings_field_link_color()
- twentyeleven_setup()
- twentyeleven_theme_options_add_page()
- twentyeleven_theme_options_help()
- twentyeleven_theme_options_init()
- twentyeleven_theme_options_render_page()
- twentyeleven_theme_options_validate()
- twentyeleven_url_grabber()
- twentyeleven_widgets_init()
- twentyfourteen_admin_fonts()
- twentyfourteen_admin_header_image()
- twentyfourteen_admin_header_style()
- twentyfourteen_body_classes()
- twentyfourteen_categorized_blog()
- twentyfourteen_category_transient_flusher()
- twentyfourteen_content_width()
- twentyfourteen_contextual_help()
- twentyfourteen_customize()
- twentyfourteen_customize_preview_js()
- twentyfourteen_customize_register()
- twentyfourteen_custom_header_setup()
- twentyfourteen_font_url()
- twentyfourteen_get_featured_posts()
- twentyfourteen_has_featured_posts()
- twentyfourteen_header_style()
- twentyfourteen_list_authors()
- twentyfourteen_paging_nav()
- twentyfourteen_posted_on()
- twentyfourteen_post_classes()
- twentyfourteen_post_nav()
- twentyfourteen_post_thumbnail()
- twentyfourteen_preview()
- twentyfourteen_sanitize_layout()
- twentyfourteen_scripts()
- twentyfourteen_setup()
- twentyfourteen_switch_theme()
- twentyfourteen_the_attached_image()
- twentyfourteen_upgrade_notice()
- twentyfourteen_widgets_init()
- twentyfourteen_wp_title()
- twentyten_admin_header_style()
- twentyten_auto_excerpt_more()
- twentyten_comment()
- twentyten_continue_reading_link()
- twentyten_custom_excerpt_more()
- twentyten_excerpt_length()
- twentyten_get_gallery_images()
- twentyten_page_menu_args()
- twentyten_posted_in()
- twentyten_posted_on()
- twentyten_remove_gallery_css()
- twentyten_remove_recent_comments_style()
- twentyten_setup()
- twentyten_widgets_init()
- twentythirteen_admin_header_image()
- twentythirteen_admin_header_style()
- twentythirteen_body_class()
- twentythirteen_content_width()
- twentythirteen_customize()
- twentythirteen_customize_preview_js()
- twentythirteen_customize_register()
- twentythirteen_custom_header_fonts()
- twentythirteen_custom_header_setup()
- twentythirteen_entry_date()
- twentythirteen_entry_meta()
- twentythirteen_fonts_url()
- twentythirteen_get_link_url()
- twentythirteen_header_style()
- twentythirteen_paging_nav()
- twentythirteen_post_nav()
- twentythirteen_preview()
- twentythirteen_scripts_styles()
- twentythirteen_setup()
- twentythirteen_switch_theme()
- twentythirteen_the_attached_image()
- twentythirteen_upgrade_notice()
- twentythirteen_widgets_init()
- twentythirteen_wp_title()
- twentytwelve_admin_header_image()
- twentytwelve_admin_header_style()
- twentytwelve_body_class()
- twentytwelve_comment()
- twentytwelve_content_nav()
- twentytwelve_content_width()
- twentytwelve_customize_preview_js()
- twentytwelve_customize_register()
- twentytwelve_custom_header_fonts()
- twentytwelve_custom_header_setup()
- twentytwelve_entry_meta()
- twentytwelve_get_font_url()
- twentytwelve_header_style()
- twentytwelve_mce_css()
- twentytwelve_page_menu_args()
- twentytwelve_scripts_styles()
- twentytwelve_setup()
- twentytwelve_widgets_init()
- twentytwelve_wp_title()
- type_url_form_audio()
- type_url_form_file()
- type_url_form_image()
- type_url_form_video()
- undismiss_core_update()
- unescape_invalid_shortcodes()
- uninstall_plugin()
- unload_textdomain()
- unregister_default_headers()
- unregister_meta_key()
- unregister_nav_menu()
- unregister_post_type()
- unregister_setting()
- unregister_sidebar()
- unregister_sidebar_widget()
- wp_unregister_sidebar_widget()
- unregister_taxonomy()
- unregister_taxonomy_for_object_type()
- unregister_widget()
- unregister_widget_control()
- wp_unregister_widget_control()
- unstick_post()
- untrailingslashit()
- unzip_file()
- update_archived()
- update_attached_file()
- update_blog_details()
- update_blog_option()
- update_blog_public()
- update_blog_status()
- update_category_cache()
- update_comment_cache()
- update_comment_meta()
- update_core()
- update_gallery_tab()
- update_home_siteurl()
- update_meta()
- update_metadata()
- update_metadata_by_mid()
- update_meta_cache()
- update_nag()
- update_network_cache()
- update_network_option()
- update_object_term_cache()
- update_option()
- update_option_new_admin_email()
- update_page_cache()
- update_post_cache()
- update_postmeta_cache()
- update_posts_count()
- update_post_caches()
- update_post_meta()
- update_post_thumbnail_cache()
- update_recently_edited()
- update_right_now_message()
- update_site_cache()
- update_site_option()
- update_termmeta_cache()
- update_term_cache()
- update_term_meta()
- update_usermeta()
- update_user_caches()
- update_user_meta()
- update_user_option()
- update_user_status()
- upgrade_100()
- upgrade_101()
- upgrade_110()
- upgrade_130()
- upgrade_160()
- upgrade_210()
- upgrade_230()
- upgrade_230_old_tables()
- upgrade_230_options_table()
- upgrade_250()
- upgrade_252()
- upgrade_260()
- upgrade_270()
- upgrade_280()
- upgrade_290()
- upgrade_300()
- upgrade_330()
- upgrade_340()
- upgrade_350()
- upgrade_370()
- upgrade_372()
- upgrade_380()
- upgrade_400()
- upgrade_420()
- upgrade_421()
- upgrade_422()
- upgrade_423()
- upgrade_430()
- upgrade_430_fix_comments()
- upgrade_431()
- upgrade_440()
- upgrade_all()
- upgrade_network()
- upgrade_old_slugs()
- upload_is_file_too_big()
- upload_is_user_over_quota()
- upload_size_limit_filter()
- upload_space_setting()
- urldecode_deep()
- urlencode_deep()
- url_is_accessable_via_ssl()
- url_shorten()
- url_to_postid()
- username_exists()
- users_can_register_signup_filter()
- user_admin_url()
- user_can()
- user_can_access_admin_page()
- user_can_create_draft()
- user_can_create_post()
- user_can_delete_post()
- user_can_delete_post_comments()
- user_can_edit_post()
- user_can_edit_post_comments()
- user_can_edit_post_date()
- user_can_edit_user()
- user_can_richedit()
- user_can_set_post_date()
- user_pass_ok()
- user_trailingslashit()
- use_codepress()
- use_ssl_preference()
- utf8_uri_encode()
- validate_active_plugins()
- validate_another_blog_signup()
- validate_blog_form()
- validate_blog_signup()
- validate_current_theme()
- validate_email()
- validate_file()
- validate_file_to_edit()
- validate_plugin()
- validate_username()
- validate_user_form()
- validate_user_signup()
- valid_unicode()
- verify_file_md5()
- walk_category_dropdown_tree()
- walk_category_tree()
- walk_nav_menu_tree()
- walk_page_dropdown_tree()
- walk_page_tree()
- weblog_ping()
- welcome_user_msg_filter()
- win_is_writable()
- wlwmanifest_link()
- wp()
- wpmu_activate_signup()
- wpmu_activate_stylesheet()
- wpmu_admin_do_redirect()
- wpmu_admin_redirect_add_updated_param()
- wpmu_checkAvailableSpace()
- wpmu_create_blog()
- wpmu_create_user()
- wpmu_current_site()
- wpmu_delete_blog()
- wpmu_delete_user()
- wpmu_get_blog_allowedthemes()
- wpmu_log_new_registrations()
- wpmu_menu()
- wpmu_signup_blog()
- wpmu_signup_blog_notification()
- wpmu_signup_stylesheet()
- wpmu_signup_user()
- wpmu_signup_user_notification()
- wpmu_update_blogs_date()
- wpmu_validate_blog_signup()
- wpmu_validate_user_signup()
- wpmu_welcome_notification()
- wpmu_welcome_user_notification()
- wptexturize()
- wptexturize_primes()
- wpview_media_sandbox_styles()
- wp_add_dashboard_widget()
- wp_add_id3_tag_data()
- wp_add_inline_script()
- wp_add_inline_style()
- wp_add_object_terms()
- wp_add_post_tags()
- wp_add_trashed_suffix_to_post_name_for_post()
- wp_add_trashed_suffix_to_post_name_for_trashed_posts()
- wp_admin_bar_add_secondary_groups()
- wp_admin_bar_appearance_menu()
- wp_admin_bar_comments_menu()
- wp_admin_bar_customize_menu()
- wp_admin_bar_dashboard_view_site_menu()
- wp_admin_bar_edit_menu()
- wp_admin_bar_header()
- wp_admin_bar_my_account_item()
- wp_admin_bar_my_account_menu()
- wp_admin_bar_my_sites_menu()
- wp_admin_bar_new_content_menu()
- wp_admin_bar_render()
- wp_admin_bar_search_menu()
- wp_admin_bar_shortlink_menu()
- wp_admin_bar_sidebar_toggle()
- wp_admin_bar_site_menu()
- wp_admin_bar_updates_menu()
- wp_admin_bar_wp_menu()
- wp_admin_canonical_url()
- wp_admin_css()
- wp_admin_css_color()
- wp_admin_css_uri()
- wp_ajax_add_link_category()
- wp_ajax_add_menu_item()
- wp_ajax_add_meta()
- wp_ajax_add_tag()
- wp_ajax_add_user()
- wp_ajax_ajax_tag_search()
- wp_ajax_autocomplete_user()
- wp_ajax_closed_postboxes()
- wp_ajax_crop_image()
- wp_ajax_dashboard_widgets()
- wp_ajax_date_format()
- wp_ajax_delete_comment()
- wp_ajax_delete_inactive_widgets()
- wp_ajax_delete_link()
- wp_ajax_delete_meta()
- wp_ajax_delete_page()
- wp_ajax_delete_plugin()
- wp_ajax_delete_post()
- wp_ajax_delete_tag()
- wp_ajax_delete_theme()
- wp_ajax_destroy_sessions()
- wp_ajax_dim_comment()
- wp_ajax_dismiss_wp_pointer()
- wp_ajax_edit_comment()
- wp_ajax_fetch_list()
- wp_ajax_find_posts()
- wp_ajax_generate_password()
- wp_ajax_get_attachment()
- wp_ajax_get_comments()
- wp_ajax_get_community_events()
- wp_ajax_get_permalink()
- wp_ajax_get_post_thumbnail_html()
- wp_ajax_get_revision_diffs()
- wp_ajax_get_tagcloud()
- wp_ajax_heartbeat()
- wp_ajax_hidden_columns()
- wp_ajax_image_editor()
- wp_ajax_imgedit_preview()
- wp_ajax_inline_save()
- wp_ajax_inline_save_tax()
- wp_ajax_install_plugin()
- wp_ajax_install_theme()
- wp_ajax_logged_in()
- wp_ajax_menu_get_metabox()
- wp_ajax_menu_locations_save()
- wp_ajax_menu_quick_search()
- wp_ajax_meta_box_order()
- wp_ajax_nopriv_heartbeat()
- wp_ajax_oembed_cache()
- wp_ajax_parse_embed()
- wp_ajax_parse_media_shortcode()
- wp_ajax_press_this_add_category()
- wp_ajax_press_this_save_post()
- wp_ajax_query_attachments()
- wp_ajax_query_themes()
- wp_ajax_replyto_comment()
- wp_ajax_sample_permalink()
- wp_ajax_save_attachment()
- wp_ajax_save_attachment_compat()
- wp_ajax_save_attachment_order()
- wp_ajax_save_user_color_scheme()
- wp_ajax_save_widget()
- wp_ajax_save_wporg_username()
- wp_ajax_search_install_plugins()
- wp_ajax_search_plugins()
- wp_ajax_send_attachment_to_editor()
- wp_ajax_send_link_to_editor()
- wp_ajax_set_attachment_thumbnail()
- wp_ajax_set_post_thumbnail()
- wp_ajax_time_format()
- wp_ajax_trash_post()
- wp_ajax_untrash_post()
- wp_ajax_update_plugin()
- wp_ajax_update_theme()
- wp_ajax_update_welcome_panel()
- wp_ajax_update_widget()
- wp_ajax_upload_attachment()
- wp_ajax_widgets_order()
- wp_ajax_wp_compression_test()
- wp_ajax_wp_fullscreen_save_post()
- wp_ajax_wp_link_ajax()
- wp_ajax_wp_remove_post_lock()
- wp_allowed_protocols()
- wp_allow_comment()
- wp_array_slice_assoc()
- wp_attachment_is()
- wp_attachment_is_image()
- wp_audio_shortcode()
- wp_authenticate()
- wp_authenticate_cookie()
- wp_authenticate_email_password()
- wp_authenticate_spam_check()
- wp_authenticate_username_password()
- wp_auth_check()
- wp_auth_check_html()
- wp_auth_check_load()
- wp_autosave()
- wp_basename()
- wp_blacklist_check()
- wp_cache_add()
- wp_cache_add_global_groups()
- wp_cache_add_non_persistent_groups()
- wp_cache_close()
- wp_cache_decr()
- wp_cache_delete()
- wp_cache_flush()
- wp_cache_get()
- wp_cache_get_last_changed()
- wp_cache_incr()
- wp_cache_init()
- wp_cache_replace()
- wp_cache_reset()
- wp_cache_set()
- wp_cache_switch_to_blog()
- wp_calculate_image_sizes()
- wp_calculate_image_srcset()
- wp_can_install_language_pack()
- wp_caption_input_textarea()
- wp_category_checklist()
- wp_checkdate()
- wp_check_browser_version()
- wp_check_comment_data_max_lengths()
- wp_check_comment_flood()
- wp_check_filetype()
- wp_check_filetype_and_ext()
- wp_check_for_changed_slugs()
- wp_check_invalid_utf8()
- wp_check_jsonp_callback()
- wp_check_locked_posts()
- wp_check_mysql_version()
- wp_check_password()
- wp_check_php_mysql_versions()
- wp_check_post_hierarchy_for_loops()
- wp_check_post_lock()
- wp_check_term_hierarchy_for_loops()
- wp_clean_plugins_cache()
- wp_clean_themes_cache()
- WP_Theme
- wp_clean_update_cache()
- wp_clearcookie()
- wp_clear_auth_cookie()
- wp_clear_scheduled_hook()
- wp_clone()
- wp_color_scheme_settings()
- wp_comment_form_unfiltered_html_nonce()
- wp_comment_reply()
- wp_comment_trashnotice()
- wp_constrain_dimensions()
- wp_convert_bytes_to_hr()
- wp_convert_hr_to_bytes()
- wp_convert_widget_settings()
- wp_cookie_constants()
- wp_count_attachments()
- wp_count_comments()
- wp_count_posts()
- wp_count_terms()
- wp_create_categories()
- wp_create_category()
- wp_create_nav_menu()
- wp_create_nonce()
- wp_create_post_autosave()
- wp_create_tag()
- wp_create_term()
- wp_create_thumbnail()
- wp_credits()
- wp_cron()
- wp_crop_image()
- wp_customize_support_script()
- wp_customize_url()
- wp_custom_css_cb()
- wp_dashboard()
- wp_dashboard_browser_nag()
- wp_dashboard_cached_rss_widget()
- wp_dashboard_empty()
- wp_dashboard_events_news()
- wp_dashboard_incoming_links()
- wp_dashboard_incoming_links_control()
- wp_dashboard_incoming_links_output()
- wp_dashboard_plugins()
- wp_dashboard_plugins_output()
- wp_dashboard_primary()
- wp_dashboard_primary_control()
- wp_dashboard_primary_output()
- wp_dashboard_quick_press()
- wp_dashboard_quick_press_output()
- wp_dashboard_quota()
- wp_dashboard_recent_comments()
- wp_dashboard_recent_comments_control()
- wp_dashboard_recent_drafts()
- wp_dashboard_recent_posts()
- wp_dashboard_right_now()
- wp_dashboard_rss_control()
- wp_dashboard_rss_output()
- wp_dashboard_secondary()
- wp_dashboard_secondary_control()
- wp_dashboard_secondary_output()
- wp_dashboard_setup()
- wp_dashboard_site_activity()
- wp_dashboard_trigger_widget_control()
- wp_debug_backtrace_summary()
- wp_debug_mode()
- wp_default_editor()
- wp_default_scripts()
- wp_default_styles()
- wp_defer_comment_counting()
- wp_defer_term_counting()
- wp_delete_attachment()
- wp_delete_auto_drafts()
- wp_delete_category()
- wp_delete_comment()
- wp_delete_file()
- wp_delete_link()
- wp_delete_nav_menu()
- wp_delete_object_term_relationships()
- wp_delete_post()
- wp_delete_post_revision()
- wp_delete_term()
- wp_delete_user()
- wp_dependencies_unique_hosts()
- wp_dequeue_script()
- wp_dequeue_style()
- wp_deregister_script()
- wp_deregister_style()
- wp_destroy_all_sessions()
- wp_destroy_current_session()
- wp_destroy_other_sessions()
- wp_die()
- wp_doc_link_parse()
- wp_doing_ajax()
- wp_doing_cron()
- wp_download_language_pack()
- wp_dropdown_categories()
- wp_dropdown_cats()
- wp_dropdown_languages()
- wp_dropdown_pages()
- wp_dropdown_roles()
- wp_dropdown_users()
- wp_editor()
- wp_edit_attachments_query()
- wp_edit_attachments_query_vars()
- wp_edit_posts_query()
- wp_embed_defaults()
- wp_embed_excerpt_attachment()
- wp_embed_excerpt_more()
- wp_embed_handler_audio()
- wp_embed_handler_googlevideo()
- wp_embed_handler_video()
- wp_embed_handler_youtube()
- wp_embed_register_handler()
- wp_embed_unregister_handler()
- wp_encode_emoji()
- wp_enqueue_editor()
- wp_enqueue_media()
- wp_enqueue_script()
- wp_enqueue_scripts()
- wp_enqueue_style()
- wp_exif_date2ts()
- wp_exif_frac2dec()
- wp_expand_dimensions()
- wp_explain_nonce()
- wp_ext2type()
- wp_extract_urls()
- wp_favicon_request()
- WP_Filesystem()
- wp_filter_comment()
- wp_filter_kses()
- wp_filter_nohtml_kses()
- wp_filter_object_list()
- wp_filter_oembed_result()
- wp_filter_post_kses()
- wp_filter_pre_oembed_result()
- wp_find_hierarchy_loop()
- wp_find_hierarchy_loop_tortoise_hare()
- wp_fix_server_vars()
- wp_footer()
- wp_functionality_constants()
- wp_generate_attachment_metadata()
- wp_generate_auth_cookie()
- wp_generate_password()
- wp_generate_tag_cloud()
- wp_generate_uuid4()
- wp_generator()
- wp_get_active_and_valid_plugins()
- wp_get_active_network_plugins()
- wp_get_additional_image_sizes()
- wp_get_all_sessions()
- wp_get_archives()
- wp_get_associated_nav_menu_items()
- wp_get_attachment_caption()
- wp_get_attachment_id3_keys()
- wp_get_attachment_image()
- wp_get_attachment_image_sizes()
- wp_get_attachment_image_src()
- wp_get_attachment_image_srcset()
- wp_get_attachment_image_url()
- wp_get_attachment_link()
- wp_get_attachment_metadata()
- wp_get_attachment_thumb_file()
- wp_get_attachment_thumb_url()
- wp_get_attachment_url()
- wp_get_audio_extensions()
- wp_get_available_translations()
- wp_get_canonical_url()
- wp_get_comment_fields_max_lengths()
- wp_get_comment_status()
- wp_get_cookie_login()
- wp_get_current_commenter()
- wp_get_current_user()
- wp_get_custom_css()
- wp_get_custom_css_post()
- wp_get_db_schema()
- wp_get_document_title()
- wp_get_ext_types()
- wp_get_http()
- wp_get_http_headers()
- wp_get_image_editor()
- wp_get_image_mime()
- wp_get_installed_translations()
- wp_get_links()
- wp_get_linksbyname()
- wp_get_link_cats()
- wp_get_mime_types()
- wp_get_mu_plugins()
- wp_get_nav_menus()
- wp_get_nav_menu_items()
- wp_get_nav_menu_object()
- wp_get_nav_menu_to_edit()
- wp_get_network()
- wp_get_nocache_headers()
- wp_get_object_terms()
- wp_get_original_referer()
- wp_get_password_hint()
- wp_get_pomo_file_data()
- wp_get_popular_importers()
- wp_get_post_autosave()
- wp_get_post_categories()
- wp_get_post_cats()
- wp_get_post_parent_id()
- wp_get_post_revision()
- wp_get_post_revisions()
- wp_get_post_tags()
- wp_get_post_terms()
- wp_get_raw_referer()
- wp_get_recent_posts()
- wp_get_referer()
- wp_get_revision_ui_diff()
- wp_get_schedule()
- wp_get_schedules()
- wp_get_server_protocol()
- wp_get_session_token()
- wp_get_shortlink()
- wp_get_sidebars_widgets()
- wp_get_single_post()
- wp_get_sites()
- wp_get_split_term()
- wp_get_split_terms()
- wp_get_term_taxonomy_parent_id()
- wp_get_theme()
- wp_get_themes()
- wp_get_translation_updates()
- wp_get_update_data()
- wp_get_upload_dir()
- wp_get_users_with_no_role()
- wp_get_user_contact_methods()
- wp_get_video_extensions()
- wp_get_widget_defaults()
- wp_guess_url()
- wp_handle_comment_submission()
- wp_handle_sideload()
- _wp_handle_upload()
- wp_handle_upload()
- wp_handle_upload_error()
- wp_hash()
- wp_hash_password()
- wp_head()
- wp_heartbeat_settings()
- wp_heartbeat_set_suspension()
- wp_htmledit_pre()
- wp_html_excerpt()
- wp_html_split()
- wp_http_supports()
- wp_http_validate_url()
- wp_iframe()
- wp_imagecreatetruecolor()
- wp_image_add_srcset_and_sizes()
- wp_image_editor()
- wp_image_editor_supports()
- wp_image_matches_ratio()
- wp_import_cleanup()
- wp_import_handle_upload()
- wp_import_upload_form()
- wp_initial_constants()
- wp_initial_nav_menu_meta_boxes()
- wp_insert_attachment()
- wp_insert_category()
- wp_insert_comment()
- wp_insert_link()
- wp_insert_post()
- wp_insert_term()
- wp_insert_user()
- wp_install()
- wp_installing()
- wp_install_defaults()
- wp_install_language_form()
- wp_install_maybe_enable_pretty_permalinks()
- wp_iso_descrambler()
- wp_is_file_mod_allowed()
- wp_is_ini_value_changeable()
- wp_is_large_network()
- wp_is_mobile()
- wp_is_numeric_array()
- wp_is_post_autosave()
- wp_is_post_revision()
- wp_is_stream()
- wp_is_writable()
- wp_json_encode()
- wp_just_in_time_script_localization()
- wp_kses()
- wp_kses_allowed_html()
- wp_kses_array_lc()
- wp_kses_attr()
- wp_kses_attr_check()
- wp_kses_attr_parse()
- wp_kses_bad_protocol()
- wp_kses_bad_protocol_once()
- wp_kses_bad_protocol_once2()
- wp_kses_check_attr_val()
- wp_kses_data()
- wp_kses_decode_entities()
- wp_kses_hair()
- wp_kses_hair_parse()
- wp_kses_hook()
- wp_kses_html_error()
- wp_kses_js_entities()
- wp_kses_named_entities()
- wp_kses_normalize_entities()
- wp_kses_normalize_entities2()
- wp_kses_normalize_entities3()
- wp_kses_no_null()
- wp_kses_one_attr()
- wp_kses_post()
- wp_kses_post_deep()
- wp_kses_split()
- wp_kses_split2()
- wp_kses_stripslashes()
- wp_kses_version()
- wp_link_category_checklist()
- wp_link_manager_disabled_message()
- wp_link_pages()
- wp_list_authors()
- wp_list_bookmarks()
- wp_list_categories()
- wp_list_cats()
- wp_list_comments()
- wp_list_filter()
- wp_list_pages()
- wp_list_pluck()
- wp_list_post_revisions()
- wp_list_sort()
- wp_list_widgets()
- wp_list_widget_controls()
- wp_list_widget_controls_dynamic_sidebar()
- wp_load_alloptions()
- wp_load_core_site_options()
- wp_load_image()
- wp_load_translations_early()
- wp_localize_community_events()
- wp_localize_jquery_ui_datepicker()
- wp_localize_script()
- wp_login()
- wp_loginout()
- wp_login_form()
- wp_login_url()
- wp_login_viewport_meta()
- wp_logout()
- wp_logout_url()
- wp_lostpassword_url()
- wp_magic_quotes()
- wp_mail()
- wp_maintenance()
- wp_make_content_images_responsive()
- wp_make_link_relative()
- wp_match_mime_types()
- wp_max_upload_size()
- wp_maybe_auto_update()
- wp_maybe_decline_date()
- wp_maybe_generate_attachment_metadata()
- wp_maybe_load_embeds()
- wp_maybe_load_widgets()
- wp_maybe_update_network_site_counts()
- wp_maybe_update_network_user_counts()
- wp_mediaelement_fallback()
- wp_media_attach_action()
- wp_media_insert_url_form()
- wp_media_upload_handler()
- wp_meta()
- wp_metadata_lazyloader()
- wp_mime_type_icon()
- wp_mkdir_p()
- wp_nav_menu_disabled_check()
- wp_nav_menu_item_link_meta_box()
- wp_nav_menu_item_post_type_meta_box()
- wp_nav_menu_item_taxonomy_meta_box()
- wp_nav_menu_locations_meta_box()
- wp_nav_menu_manage_columns()
- wp_nav_menu_max_depth()
- wp_nav_menu_post_type_meta_boxes()
- wp_nav_menu_setup()
- wp_nav_menu_taxonomy_meta_boxes()
- wp_nav_menu_update_menu_items()
- wp_network_dashboard_right_now()
- wp_new_blog_notification()
- wp_new_comment()
- wp_new_comment_notify_moderator()
- wp_new_comment_notify_postauthor()
- wp_new_user_notification()
- wp_next_scheduled()
- wp_nonce_ays()
- wp_nonce_field()
- wp_nonce_tick()
- wp_nonce_url()
- wp_normalize_path()
- wp_notify_moderator()
- wp_notify_postauthor()
- wp_not_installed()
- wp_no_robots()
- wp_ob_end_flush_all()
- wp_oembed_add_discovery_links()
- wp_oembed_add_host_js()
- wp_oembed_add_provider()
- wp_oembed_ensure_format()
- wp_oembed_get()
- wp_oembed_register_route()
- wp_oembed_remove_provider()
- wp_old_slug_redirect()
- wp_original_referer_field()
- wp_page_reload_on_back_button_js()
- wp_parse_args()
- wp_parse_auth_cookie()
- wp_parse_id_list()
- wp_parse_slug_list()
- wp_parse_str()
- wp_parse_url()
- wp_password_change_notification()
- wp_playlist_scripts()
- wp_playlist_shortcode()
- wp_plugin_directory_constants()
- wp_plugin_update_row()
- wp_plugin_update_rows()
- wp_plupload_default_settings()
- wp_popular_terms_checklist()
- wp_post_mime_type_where()
- wp_post_preview_js()
- wp_post_revision_title()
- wp_post_revision_title_expanded()
- wp_preload_dialogs()
- wp_prepare_attachment_for_js()
- wp_prepare_revisions_for_js()
- wp_prepare_themes_for_js()
- wp_pre_kses_less_than()
- wp_pre_kses_less_than_callback()
- wp_print_admin_notice_templates()
- wp_print_community_events_markup()
- wp_print_community_events_templates()
- wp_print_editor_js()
- wp_print_footer_scripts()
- wp_print_head_scripts()
- wp_print_media_templates()
- wp_print_request_filesystem_credentials_modal()
- wp_print_revision_templates()
- wp_print_scripts()
- wp_print_styles()
- wp_print_update_row_templates()
- wp_protect_special_option()
- wp_prototype_before_jquery()
- wp_publish_post()
- wp_queue_comments_for_comment_meta_lazyload()
- wp_queue_posts_for_term_meta_lazyload()
- wp_quicktags()
- wp_raise_memory_limit()
- wp_rand()
- wp_read_audio_metadata()
- wp_read_image_metadata()
- wp_read_video_metadata()
- wp_redirect()
- wp_redirect_admin_locations()
- wp_referer_field()
- wp_refresh_post_lock()
- wp_refresh_post_nonces()
- wp_register()
- wp_register_plugin_realpath()
- wp_register_script()
- wp_register_sidebar_widget()
- wp_register_style()
- wp_register_widget_control()
- wp_registration_url()
- wp_rel_nofollow()
- wp_rel_nofollow_callback()
- wp_remote_fopen()
- wp_remote_get()
- wp_remote_head()
- wp_remote_post()
- wp_remote_request()
- wp_remote_retrieve_body()
- wp_remote_retrieve_cookie()
- wp_remote_retrieve_cookies()
- wp_remote_retrieve_cookie_value()
- wp_remote_retrieve_header()
- wp_remote_retrieve_headers()
- wp_remote_retrieve_response_code()
- wp_remote_retrieve_response_message()
- wp_removable_query_args()
- wp_remove_object_terms()
- wp_replace_in_html_tags()
- wp_reschedule_event()
- wp_reset_postdata()
- wp_reset_query()
- wp_reset_vars()
- wp_resolve_numeric_slug_conflicts()
- wp_re源代码_hints()
- wp_restore_image()
- wp_restore_post_revision()
- wp_revisions_enabled()
- wp_revisions_to_keep()
- wp_revoke_user()
- wp_richedit_pre()
- wp_roles()
- WP_Roles
- wp_rss()
- wp_safe_redirect()
- wp_safe_remote_get()
- wp_safe_remote_head()
- wp_safe_remote_post()
- wp_safe_remote_request()
- wp_salt()
- wp_sanitize_redirect()
- wp_save_image()
- wp_save_image_file()
- wp_save_nav_menu_items()
- wp_save_post_revision()
- wp_scheduled_delete()
- wp_schedule_event()
- wp_schedule_single_event()
- wp_schedule_update_checks()
- wp_schedule_update_network_counts()
- wp_scripts()
- wp_script_add_data()
- wp_script_is()
- wp_send_json()
- wp_send_json_error()
- wp_send_json_success()
- wp_send_new_user_notifications()
- wp_setcookie()
- wp_setup_nav_menu_item()
- wp_set_all_user_settings()
- wp_set_auth_cookie()
- wp_set_comment_cookies()
- wp_set_comment_status()
- wp_set_current_user()
- wp_set_internal_encoding()
- wp_set_lang_dir()
- wp_set_link_cats()
- wp_set_object_terms()
- wp_set_password()
- wp_set_post_categories()
- wp_set_post_cats()
- wp_set_post_lock()
- wp_set_post_tags()
- wp_set_post_terms()
- wp_set_sidebars_widgets()
- wp_set_wpdb_vars()
- wp_shake_js()
- wp_shortlink_header()
- wp_shortlink_wp_head()
- wp_should_upgrade_global_tables()
- wp_shrink_dimensions()
- wp_sidebar_description()
- wp_signon()
- wp_site_icon()
- wp_slash()
- wp_spaces_regexp()
- wp_spam_comment()
- wp_specialchars()
- wp_specialchars_decode()
- wp_sprintf()
- wp_sprintf_l()
- wp_ssl_constants()
- wp_start_object_cache()
- wp_star_rating()
- wp_staticize_emoji()
- wp_staticize_emoji_for_email()
- wp_stream_image()
- wp_strip_all_tags()
- wp_styles()
- wp_style_add_data()
- wp_style_is()
- wp_style_loader_src()
- wp_suspend_cache_addition()
- wp_suspend_cache_invalidation()
- wp_tag_cloud()
- wp_templating_constants()
- wp_tempnam()
- wp_terms_checklist()
- wp_term_is_shared()
- wp_text_diff()
- wp_theme_update_row()
- wp_theme_update_rows()
- wp_throttle_comment_flood()
- wp_timezone_choice()
- wp_timezone_override_offset()
- wp_timezone_supported()
- wp_tiny_mce()
- wp_title()
- wp_title_rss()
- wp_transition_comment_status()
- wp_transition_post_status()
- wp_trash_comment()
- wp_trash_post()
- wp_trash_post_comments()
- wp_trim_excerpt()
- wp_trim_words()
- wp_underscore_audio_template()
- wp_underscore_playlist_templates()
- wp_underscore_video_template()
- wp_unique_filename()
- wp_unique_post_slug()
- wp_unique_term_slug()
- wp_unregister_GLOBALS()
- wp_unschedule_event()
- wp_unslash()
- wp_unspam_comment()
- wp_untrash_comment()
- wp_untrash_post()
- wp_untrash_post_comments()
- wp_update_attachment_metadata()
- wp_update_category()
- wp_update_comment()
- wp_update_comment_count()
- wp_update_comment_count_now()
- wp_update_core()
- wp_update_custom_css_post()
- wp_update_link()
- wp_update_nav_menu_item()
- wp_update_nav_menu_object()
- wp_update_network_counts()
- wp_update_network_site_counts()
- wp_update_network_user_counts()
- wp_update_plugin()
- wp_update_plugins()
- wp_update_post()
- wp_update_term()
- wp_update_term_count()
- wp_update_term_count_now()
- wp_update_theme()
- wp_update_themes()
- wp_update_user()
- wp_upgrade()
- wp_upload_bits()
- wp_upload_dir()
- wp_user_settings()
- wp_using_ext_object_cache()
- wp_validate_auth_cookie()
- wp_validate_boolean()
- wp_validate_logged_in_cookie()
- wp_validate_redirect()
- wp_verify_nonce()
- wp_version_check()
- wp_video_shortcode()
- wp_welcome_panel()
- wp_widgets_access_body_class()
- wp_widgets_add_menu()
- wp_widgets_init()
- wp_widget_control()
- wp_widget_description()
- wp_widget_rss_form()
- wp_widget_rss_output()
- wp_widget_rss_process()
- wp_write_post()
- write_post()
- wxr_authors_list()
- wxr_category_description()
- wxr_cat_name()
- wxr_cdata()
- wxr_filter_postmeta()
- wxr_nav_menu_terms()
- wxr_post_taxonomy()
- wxr_site_url()
- wxr_tag_description()
- wxr_tag_name()
- wxr_term_description()
- wxr_term_meta()
- wxr_term_name()
- xfn_check()
- xmlrpc_getpostcategory()
- xmlrpc_getposttitle()
- xmlrpc_pingback_error()
- xmlrpc_removepostdata()
- zeroise()
- _()
- _access_denied_splash()
- _add_post_type_submenus()
- _add_themes_utility_last()
- _admin_bar_bump_cb()
- _admin_notice_post_locked()
- _admin_search_query()
- _ajax_wp_die_handler()
- _autop_newline_preservation_helper()
- _c()
- _canonical_charset()
- _cleanup_header_comment()
- _cleanup_image_add_caption()
- _clear_modified_cache_on_transition_comment_status()
- _close_comments_for_old_post()
- _close_comments_for_old_posts()
- _config_wp_home()
- _config_wp_siteurl()
- _convert_urlencoded_to_entities()
- _copy_image_file()
- _count_posts_cache_key()
- _crop_image_re源代码()
- _custom_background_cb()
- _custom_header_background_just_in_time()
- _custom_logo_header_styles()
- _deep_replace()
- _default_wp_die_handler()
- _delete_attachment_theme_mod()
- _delete_option_fresh_site()
- _deprecated_constructor()
- _deprecated_file()
- _deprecated_hook()
- _device_can_upload()
- _doing_it_wrong()
- _draft_or_post_title()
- _e()
- _ex()
- _fetch_remote_file()
- _filter_query_attachment_filenames()
- _fix_attachment_links()
- _flip_image_re源代码()
- _future_post_hook()
- _get_additional_user_keys()
- _get_admin_bar_pref()
- _get_component_from_parsed_url_array()
- _get_cron_array()
- _get_cron_lock()
- _get_custom_object_labels()
- _get_dropins()
- _get_last_post_time()
- _get_list_table()
- WP_List_Table
- _get_meta_table()
- _get_non_cached_ids()
- _get_page_link()
- _get_path_to_translation()
- _get_path_to_translation_from_lang_dir()
- _get_plugin_data_markup_translate()
- _get_post_ancestors()
- _get_random_header_data()
- _get_template_edit_filename()
- _get_term_children()
- _get_term_hierarchy()
- _get_widget_id_base()
- _hash_hmac()
- _http_build_query()
- _image_get_preview_ratio()
- _insert_into_post_button()
- _ipad_meta()
- _is_valid_nav_menu_item()
- _json_decode_object_helper()
- _links_add_base()
- _links_add_target()
- _list_meta_row()
- _load_image_to_edit_path()
- _load_textdomain_just_in_time()
- _local_storage_notice()
- _make_cat_compat()
- _make_email_clickable_cb()
- _make_url_clickable_cb()
- _make_web_ftp_clickable_cb()
- _maybe_update_core()
- _maybe_update_plugins()
- _maybe_update_themes()
- _mb_strlen()
- _mb_substr()
- _mce_set_direction()
- _media_button()
- _media_states()
- _n()
- _navigation_markup()
- _nav_menu_item_id_use_once()
- _nc()
- _nx()
- _oembed_create_xml()
- _oembed_filter_feed_content()
- _oembed_rest_pre_serve_request()
- _pad_term_counts()
- _page_traverse_name()
- _post_format_get_term()
- _post_format_get_terms()
- _post_format_link()
- _post_format_request()
- _post_format_wp_get_object_terms()
- _post_states()
- _post_type_meta_capabilities()
- _preview_theme_stylesheet_filter()
- _preview_theme_template_filter()
- _prime_comment_caches()
- _prime_network_caches()
- _prime_post_caches()
- _prime_site_caches()
- _prime_term_caches()
- _publish_post_hook()
- _redirect_to_about_wordpress()
- _register_widget_form_callback()
- _register_widget_update_callback()
- _relocate_children()
- _remove_qs_args_if_not_in_url()
- _remove_theme_support()
- _reset_front_page_settings_for_post()
- _response_to_rss()
- _rotate_image_re源代码()
- _sanitize_text_fields()
- _save_post_hook()
- _scalar_wp_die_handler()
- _search_terms_tidy()
- _set_cron_array()
- _set_preview()
- _show_post_preview()
- _sort_name_callback()
- _sort_nav_menu_items()
- _sort_uname_callback()
- _split_str_by_whitespace()
- _thickbox_path_admin_subfolder()
- _transition_post_status()
- _truncate_post_slug()
- _unzip_file_pclzip()
- _unzip_file_ziparchive()
- _update_blog_date_on_post_delete()
- _update_blog_date_on_post_publish()
- _update_generic_term_count()
- _update_posts_count_on_delete()
- _update_posts_count_on_transition_post_status()
- _update_post_term_count()
- _update_term_count_on_transition_post_status()
- _upgrade_422_remove_genericons()
- _upgrade_cron_array()
- _usort_by_first_member()
- _usort_terms_by_ID()
- _usort_terms_by_name()
- _walk_bookmarks()
- _wptexturize_pushpop_element()
- _wp_add_global_attributes()
- _wp_admin_bar_init()
- _wp_admin_html_begin()
- _wp_ajax_add_hierarchical_term()
- _wp_ajax_delete_comment_response()
- _wp_ajax_menu_quick_search()
- _wp_auto_add_pages_to_menu()
- _wp_batch_split_terms()
- _wp_call_all_hook()
- _wp_credits_add_profile_link()
- _wp_credits_build_object_link()
- _wp_customize_changeset_filter_insert_post_data()
- _wp_customize_include()
- WP_Customize_Manager
- _wp_customize_loader_settings()
- _wp_customize_publish_changeset()
- _wp_dashboard_control_callback()
- _wp_dashboard_recent_comments_row()
- _wp_delete_customize_changeset_dependent_auto_drafts()
- _wp_delete_orphaned_draft_menu_items()
- _wp_delete_post_menu_item()
- _wp_delete_tax_menu_item()
- _wp_filter_build_unique_id()
- _wp_filter_taxonomy_base()
- _wp_footer_scripts()
- _wp_get_attachment_relative_path()
- _wp_get_current_user()
- _wp_get_image_size_from_meta()
- _wp_get_post_revision_version()
- _wp_get_user_contactmethods()
- _wp_http_get_object()
- WP_Http
- _wp_image_editor_choose()
- _wp_iso_convert()
- _wp_keep_alive_customize_changeset_dependent_auto_drafts()
- _wp_kses_decode_entities_chr()
- _wp_kses_decode_entities_chr_hexdec()
- _wp_kses_split_callback()
- _wp_link_page()
- _wp_menu_item_classes_by_context()
- _wp_menu_output()
- _wp_nav_menu_meta_box_object()
- _wp_object_count_sort_cb()
- _wp_object_name_sort_cb()
- _wp_oembed_get_object()
- WP_oEmbed
- _wp_post_revision_data()
- _wp_post_revision_fields()
- _wp_post_thumbnail_class_filter()
- _wp_post_thumbnail_class_filter_add()
- _wp_post_thumbnail_class_filter_remove()
- _wp_post_thumbnail_html()
- _wp_preview_post_thumbnail_filter()
- _wp_preview_terms_filter()
- _wp_put_post_revision()
- _wp_register_meta_args_whitelist()
- _wp_relative_upload_path()
- _wp_sidebars_changed()
- _wp_specialchars()
- _wp_timezone_choice_usort_callback()
- _wp_translate_php_url_constant_to_key()
- _wp_translate_postdata()
- _wp_upgrade_revisions_of_post()
- _wp_upload_dir()
- _x()
- _xmlrpc_wp_die_handler()
- __()
- __autoload()
- __checked_selected_helper()
- __clear_multi_author_cache()
- __get_option()
- __ngettext()
- __ngettext_noop()
- __return_empty_array()
- __return_empty_string()
- __return_false()
- __return_null()
- __return_true()
- __return_zero()
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
wpdb
wpdb
WordPress Database Access Abstraction Object
description
It is possible to replace this class with your own by setting the $wpdb global variable in wp-content/db.php file to your class. The wpdb class will still be included, so you can extend it or simply use your own.
源代码
File: wp-includes/wp-db.php
class wpdb {
/**
* Whether to show SQL/DB errors.
*
* Default behavior is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY
* evaluated to true.
*
* @since 0.71
* @access private
* @var bool
*/
var $show_errors = false;
/**
* Whether to suppress errors during the DB bootstrapping.
*
* @access private
* @since 2.5.0
* @var bool
*/
var $suppress_errors = false;
/**
* The last error during query.
*
* @since 2.5.0
* @var string
*/
public $last_error = '';
/**
* Amount of queries made
*
* @since 1.2.0
* @access public
* @var int
*/
public $num_queries = 0;
/**
* Count of rows returned by previous query
*
* @since 0.71
* @access public
* @var int
*/
public $num_rows = 0;
/**
* Count of affected rows by previous query
*
* @since 0.71
* @access private
* @var int
*/
var $rows_affected = 0;
/**
* The ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
*
* @since 0.71
* @access public
* @var int
*/
public $insert_id = 0;
/**
* Last query made
*
* @since 0.71
* @access private
* @var array
*/
var $last_query;
/**
* Results of the last query made
*
* @since 0.71
* @access private
* @var array|null
*/
var $last_result;
/**
* MySQL result, which is either a re源代码 or boolean.
*
* @since 0.71
* @access protected
* @var mixed
*/
protected $result;
/**
* Cached column info, for sanity checking data before inserting
*
* @since 4.2.0
* @access protected
* @var array
*/
protected $col_meta = array();
/**
* Calculated character sets on tables
*
* @since 4.2.0
* @access protected
* @var array
*/
protected $table_charset = array();
/**
* Whether text fields in the current query need to be sanity checked.
*
* @since 4.2.0
* @access protected
* @var bool
*/
protected $check_current_query = true;
/**
* Flag to ensure we don't run into recursion problems when checking the collation.
*
* @since 4.2.0
* @access private
* @see wpdb::check_safe_collation()
* @var bool
*/
private $checking_collation = false;
/**
* Saved info on the table column
*
* @since 0.71
* @access protected
* @var array
*/
protected $col_info;
/**
* Saved queries that were executed
*
* @since 1.5.0
* @access private
* @var array
*/
var $queries;
/**
* The number of times to retry reconnecting before dying.
*
* @since 3.9.0
* @access protected
* @see wpdb::check_connection()
* @var int
*/
protected $reconnect_retries = 5;
/**
* WordPress table prefix
*
* You can set this to have multiple WordPress installations
* in a single database. The second reason is for possible
* security precautions.
*
* @since 2.5.0
* @access public
* @var string
*/
public $prefix = '';
/**
* WordPress base table prefix.
*
* @since 3.0.0
* @access public
* @var string
*/
public $base_prefix;
/**
* Whether the database queries are ready to start executing.
*
* @since 2.3.2
* @access private
* @var bool
*/
var $ready = false;
/**
* Blog ID.
*
* @since 3.0.0
* @access public
* @var int
*/
public $blogid = 0;
/**
* Site ID.
*
* @since 3.0.0
* @access public
* @var int
*/
public $siteid = 0;
/**
* List of WordPress per-blog tables
*
* @since 2.5.0
* @access private
* @see wpdb::tables()
* @var array
*/
var $tables = array( 'posts', 'comments', 'links', 'options', 'postmeta',
'terms', 'term_taxonomy', 'term_relationships', 'termmeta', 'commentmeta' );
/**
* List of deprecated WordPress tables
*
* categories, post2cat, and link2cat were deprecated in 2.3.0, db version 5539
*
* @since 2.9.0
* @access private
* @see wpdb::tables()
* @var array
*/
var $old_tables = array( 'categories', 'post2cat', 'link2cat' );
/**
* List of WordPress global tables
*
* @since 3.0.0
* @access private
* @see wpdb::tables()
* @var array
*/
var $global_tables = array( 'users', 'usermeta' );
/**
* List of Multisite global tables
*
* @since 3.0.0
* @access private
* @see wpdb::tables()
* @var array
*/
var $ms_global_tables = array( 'blogs', 'signups', 'site', 'sitemeta',
'sitecategories', 'registration_log', 'blog_versions' );
/**
* WordPress Comments table
*
* @since 1.5.0
* @access public
* @var string
*/
public $comments;
/**
* WordPress Comment Metadata table
*
* @since 2.9.0
* @access public
* @var string
*/
public $commentmeta;
/**
* WordPress Links table
*
* @since 1.5.0
* @access public
* @var string
*/
public $links;
/**
* WordPress Options table
*
* @since 1.5.0
* @access public
* @var string
*/
public $options;
/**
* WordPress Post Metadata table
*
* @since 1.5.0
* @access public
* @var string
*/
public $postmeta;
/**
* WordPress Posts table
*
* @since 1.5.0
* @access public
* @var string
*/
public $posts;
/**
* WordPress Terms table
*
* @since 2.3.0
* @access public
* @var string
*/
public $terms;
/**
* WordPress Term Relationships table
*
* @since 2.3.0
* @access public
* @var string
*/
public $term_relationships;
/**
* WordPress Term Taxonomy table
*
* @since 2.3.0
* @access public
* @var string
*/
public $term_taxonomy;
/**
* WordPress Term Meta table.
*
* @since 4.4.0
* @access public
* @var string
*/
public $termmeta;
//
// Global and Multisite tables
//
/**
* WordPress User Metadata table
*
* @since 2.3.0
* @access public
* @var string
*/
public $usermeta;
/**
* WordPress Users table
*
* @since 1.5.0
* @access public
* @var string
*/
public $users;
/**
* Multisite Blogs table
*
* @since 3.0.0
* @access public
* @var string
*/
public $blogs;
/**
* Multisite Blog Versions table
*
* @since 3.0.0
* @access public
* @var string
*/
public $blog_versions;
/**
* Multisite Registration Log table
*
* @since 3.0.0
* @access public
* @var string
*/
public $registration_log;
/**
* Multisite Signups table
*
* @since 3.0.0
* @access public
* @var string
*/
public $signups;
/**
* Multisite Sites table
*
* @since 3.0.0
* @access public
* @var string
*/
public $site;
/**
* Multisite Sitewide Terms table
*
* @since 3.0.0
* @access public
* @var string
*/
public $sitecategories;
/**
* Multisite Site Metadata table
*
* @since 3.0.0
* @access public
* @var string
*/
public $sitemeta;
/**
* Format specifiers for DB columns. Columns not listed here default to %s. Initialized during WP load.
*
* Keys are column names, values are format types: 'ID' => '%d'
*
* @since 2.8.0
* @see wpdb::prepare()
* @see wpdb::insert()
* @see wpdb::update()
* @see wpdb::delete()
* @see wp_set_wpdb_vars()
* @access public
* @var array
*/
public $field_types = array();
/**
* Database table columns charset
*
* @since 2.2.0
* @access public
* @var string
*/
public $charset;
/**
* Database table columns collate
*
* @since 2.2.0
* @access public
* @var string
*/
public $collate;
/**
* Database Username
*
* @since 2.9.0
* @access protected
* @var string
*/
protected $dbuser;
/**
* Database Password
*
* @since 3.1.0
* @access protected
* @var string
*/
protected $dbpassword;
/**
* Database Name
*
* @since 3.1.0
* @access protected
* @var string
*/
protected $dbname;
/**
* Database Host
*
* @since 3.1.0
* @access protected
* @var string
*/
protected $dbhost;
/**
* Database Handle
*
* @since 0.71
* @access protected
* @var string
*/
protected $dbh;
/**
* A textual description of the last query/get_row/get_var call
*
* @since 3.0.0
* @access public
* @var string
*/
public $func_call;
/**
* Whether MySQL is used as the database engine.
*
* Set in WPDB::db_connect() to true, by default. This is used when checking
* against the required MySQL version for WordPress. Normally, a replacement
* database drop-in (db.php) will skip these checks, but setting this to true
* will force the checks to occur.
*
* @since 3.3.0
* @access public
* @var bool
*/
public $is_mysql = null;
/**
* A list of incompatible SQL modes.
*
* @since 3.9.0
* @access protected
* @var array
*/
protected $incompatible_modes = array( 'NO_ZERO_DATE', 'ONLY_FULL_GROUP_BY',
'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'TRADITIONAL' );
/**
* Whether to use mysqli over mysql.
*
* @since 3.9.0
* @access private
* @var bool
*/
private $use_mysqli = false;
/**
* Whether we've managed to successfully connect at some point
*
* @since 3.9.0
* @access private
* @var bool
*/
private $has_connected = false;
/**
* Connects to the database server and selects a database
*
* PHP5 style constructor for compatibility with PHP5. Does
* the actual setting up of the class properties and connection
* to the database.
*
* @link https://core.trac.wordpress.org/ticket/3354
* @since 2.0.8
*
* @global string $wp_version
*
* @param string $dbuser MySQL database user
* @param string $dbpassword MySQL database password
* @param string $dbname MySQL database name
* @param string $dbhost MySQL database host
*/
public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
register_shutdown_function( array( $this, '__destruct' ) );
if ( WP_DEBUG && WP_DEBUG_DISPLAY )
$this->show_errors();
/* Use ext/mysqli if it exists and:
* - WP_USE_EXT_MYSQL is defined as false, or
* - We are a development version of WordPress, or
* - We are running PHP 5.5 or greater, or
* - ext/mysql is not loaded.
*/
if ( function_exists( 'mysqli_connect' ) ) {
if ( defined( 'WP_USE_EXT_MYSQL' ) ) {
$this->use_mysqli = ! WP_USE_EXT_MYSQL;
} elseif ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
$this->use_mysqli = true;
} elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
$this->use_mysqli = true;
}
}
$this->dbuser = $dbuser;
$this->dbpassword = $dbpassword;
$this->dbname = $dbname;
$this->dbhost = $dbhost;
// wp-config.php creation will manually connect when ready.
if ( defined( 'WP_SETUP_CONFIG' ) ) {
return;
}
$this->db_connect();
}
/**
* PHP5 style destructor and will run when database object is destroyed.
*
* @see wpdb::__construct()
* @since 2.0.8
* @return true
*/
public function __destruct() {
return true;
}
/**
* Makes private properties readable for backward compatibility.
*
* @since 3.5.0
*
* @param string $name The private member to get, and optionally process
* @return mixed The private member
*/
public function __get( $name ) {
if ( 'col_info' === $name )
$this->load_col_info();
return $this->$name;
}
/**
* Makes private properties settable for backward compatibility.
*
* @since 3.5.0
*
* @param string $name The private member to set
* @param mixed $value The value to set
*/
public function __set( $name, $value ) {
$protected_members = array(
'col_meta',
'table_charset',
'check_current_query',
);
if ( in_array( $name, $protected_members, true ) ) {
return;
}
$this->$name = $value;
}
/**
* Makes private properties check-able for backward compatibility.
*
* @since 3.5.0
*
* @param string $name The private member to check
*
* @return bool If the member is set or not
*/
public function __isset( $name ) {
return isset( $this->$name );
}
/**
* Makes private properties un-settable for backward compatibility.
*
* @since 3.5.0
*
* @param string $name The private member to unset
*/
public function __unset( $name ) {
unset( $this->$name );
}
/**
* Set $this->charset and $this->collate
*
* @since 3.1.0
*/
public function init_charset() {
$charset = '';
$collate = '';
if ( function_exists('is_multisite') && is_multisite() ) {
$charset = 'utf8';
if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) {
$collate = DB_COLLATE;
} else {
$collate = 'utf8_general_ci';
}
} elseif ( defined( 'DB_COLLATE' ) ) {
$collate = DB_COLLATE;
}
if ( defined( 'DB_CHARSET' ) ) {
$charset = DB_CHARSET;
}
$charset_collate = $this->determine_charset( $charset, $collate );
$this->charset = $charset_collate['charset'];
$this->collate = $charset_collate['collate'];
}
/**
* Determines the best charset and collation to use given a charset and collation.
*
* For example, when able, utf8mb4 should be used instead of utf8.
*
* @since 4.6.0
* @access public
*
* @param string $charset The character set to check.
* @param string $collate The collation to check.
* @return array The most appropriate character set and collation to use.
*/
public function determine_charset( $charset, $collate ) {
if ( ( $this->use_mysqli && ! ( $this->dbh instanceof mysqli ) ) || empty( $this->dbh ) ) {
return compact( 'charset', 'collate' );
}
if ( 'utf8' === $charset && $this->has_cap( 'utf8mb4' ) ) {
$charset = 'utf8mb4';
}
if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {
$charset = 'utf8';
$collate = str_replace( 'utf8mb4_', 'utf8_', $collate );
}
if ( 'utf8mb4' === $charset ) {
// _general_ is outdated, so we can upgrade it to _unicode_, instead.
if ( ! $collate || 'utf8_general_ci' === $collate ) {
$collate = 'utf8mb4_unicode_ci';
} else {
$collate = str_replace( 'utf8_', 'utf8mb4_', $collate );
}
}
// _unicode_520_ is a better collation, we should use that when it's available.
if ( $this->has_cap( 'utf8mb4_520' ) && 'utf8mb4_unicode_ci' === $collate ) {
$collate = 'utf8mb4_unicode_520_ci';
}
return compact( 'charset', 'collate' );
}
/**
* Sets the connection's character set.
*
* @since 3.1.0
*
* @param re源代码 $dbh The re源代码 given by mysql_connect
* @param string $charset Optional. The character set. Default null.
* @param string $collate Optional. The collation. Default null.
*/
public function set_charset( $dbh, $charset = null, $collate = null ) {
if ( ! isset( $charset ) )
$charset = $this->charset;
if ( ! isset( $collate ) )
$collate = $this->collate;
if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) {
$set_charset_succeeded = true;
if ( $this->use_mysqli ) {
if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
$set_charset_succeeded = mysqli_set_charset( $dbh, $charset );
}
if ( $set_charset_succeeded ) {
$query = $this->prepare( 'SET NAMES %s', $charset );
if ( ! empty( $collate ) )
$query .= $this->prepare( ' COLLATE %s', $collate );
mysqli_query( $dbh, $query );
}
} else {
if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
$set_charset_succeeded = mysql_set_charset( $charset, $dbh );
}
if ( $set_charset_succeeded ) {
$query = $this->prepare( 'SET NAMES %s', $charset );
if ( ! empty( $collate ) )
$query .= $this->prepare( ' COLLATE %s', $collate );
mysql_query( $query, $dbh );
}
}
}
}
/**
* Change the current SQL mode, and ensure its WordPress compatibility.
*
* If no modes are passed, it will ensure the current MySQL server
* modes are compatible.
*
* @since 3.9.0
*
* @param array $modes Optional. A list of SQL modes to set.
*/
public function set_sql_mode( $modes = array() ) {
if ( empty( $modes ) ) {
if ( $this->use_mysqli ) {
$res = mysqli_query( $this->dbh, 'SELECT @@SESSION.sql_mode' );
} else {
$res = mysql_query( 'SELECT @@SESSION.sql_mode', $this->dbh );
}
if ( empty( $res ) ) {
return;
}
if ( $this->use_mysqli ) {
$modes_array = mysqli_fetch_array( $res );
if ( empty( $modes_array[0] ) ) {
return;
}
$modes_str = $modes_array[0];
} else {
$modes_str = mysql_result( $res, 0 );
}
if ( empty( $modes_str ) ) {
return;
}
$modes = explode( ',', $modes_str );
}
$modes = array_change_key_case( $modes, CASE_UPPER );
/**
* Filters the list of incompatible SQL modes to exclude.
*
* @since 3.9.0
*
* @param array $incompatible_modes An array of incompatible modes.
*/
$incompatible_modes = (array) apply_filters( 'incompatible_sql_modes', $this->incompatible_modes );
foreach ( $modes as $i => $mode ) {
if ( in_array( $mode, $incompatible_modes ) ) {
unset( $modes[ $i ] );
}
}
$modes_str = implode( ',', $modes );
if ( $this->use_mysqli ) {
mysqli_query( $this->dbh, "SET SESSION sql_mode='$modes_str'" );
} else {
mysql_query( "SET SESSION sql_mode='$modes_str'", $this->dbh );
}
}
/**
* Sets the table prefix for the WordPress tables.
*
* @since 2.5.0
*
* @param string $prefix Alphanumeric name for the new prefix.
* @param bool $set_table_names Optional. Whether the table names, e.g. wpdb::$posts, should be updated or not.
* @return string|WP_Error Old prefix or WP_Error on error
*/
public function set_prefix( $prefix, $set_table_names = true ) {
if ( preg_match( '|[^a-z0-9_]|i', $prefix ) )
return new WP_Error('invalid_db_prefix', 'Invalid database prefix' );
$old_prefix = is_multisite() ? '' : $prefix;
if ( isset( $this->base_prefix ) )
$old_prefix = $this->base_prefix;
$this->base_prefix = $prefix;
if ( $set_table_names ) {
foreach ( $this->tables( 'global' ) as $table => $prefixed_table )
$this->$table = $prefixed_table;
if ( is_multisite() && empty( $this->blogid ) )
return $old_prefix;
$this->prefix = $this->get_blog_prefix();
foreach ( $this->tables( 'blog' ) as $table => $prefixed_table )
$this->$table = $prefixed_table;
foreach ( $this->tables( 'old' ) as $table => $prefixed_table )
$this->$table = $prefixed_table;
}
return $old_prefix;
}
/**
* Sets blog id.
*
* @since 3.0.0
* @access public
*
* @param int $blog_id
* @param int $site_id Optional.
* @return int previous blog id
*/
public function set_blog_id( $blog_id, $site_id = 0 ) {
if ( ! empty( $site_id ) )
$this->siteid = $site_id;
$old_blog_id = $this->blogid;
$this->blogid = $blog_id;
$this->prefix = $this->get_blog_prefix();
foreach ( $this->tables( 'blog' ) as $table => $prefixed_table )
$this->$table = $prefixed_table;
foreach ( $this->tables( 'old' ) as $table => $prefixed_table )
$this->$table = $prefixed_table;
return $old_blog_id;
}
/**
* Gets blog prefix.
*
* @since 3.0.0
* @param int $blog_id Optional.
* @return string Blog prefix.
*/
public function get_blog_prefix( $blog_id = null ) {
if ( is_multisite() ) {
if ( null === $blog_id )
$blog_id = $this->blogid;
$blog_id = (int) $blog_id;
if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) )
return $this->base_prefix;
else
return $this->base_prefix . $blog_id . '_';
} else {
return $this->base_prefix;
}
}
/**
* Returns an array of WordPress tables.
*
* Also allows for the CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE to
* override the WordPress users and usermeta tables that would otherwise
* be determined by the prefix.
*
* The scope argument can take one of the following:
*
* 'all' - returns 'all' and 'global' tables. No old tables are returned.
* 'blog' - returns the blog-level tables for the queried blog.
* 'global' - returns the global tables for the installation, returning multisite tables only if running multisite.
* 'ms_global' - returns the multisite global tables, regardless if current installation is multisite.
* 'old' - returns tables which are deprecated.
*
* @since 3.0.0
* @uses wpdb::$tables
* @uses wpdb::$old_tables
* @uses wpdb::$global_tables
* @uses wpdb::$ms_global_tables
*
* @param string $scope Optional. Can be all, global, ms_global, blog, or old tables. Defaults to all.
* @param bool $prefix Optional. Whether to include table prefixes. Default true. If blog
* prefix is requested, then the custom users and usermeta tables will be mapped.
* @param int $blog_id Optional. The blog_id to prefix. Defaults to wpdb::$blogid. Used only when prefix is requested.
* @return array Table names. When a prefix is requested, the key is the unprefixed table name.
*/
public function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) {
switch ( $scope ) {
case 'all' :
$tables = array_merge( $this->global_tables, $this->tables );
if ( is_multisite() )
$tables = array_merge( $tables, $this->ms_global_tables );
break;
case 'blog' :
$tables = $this->tables;
break;
case 'global' :
$tables = $this->global_tables;
if ( is_multisite() )
$tables = array_merge( $tables, $this->ms_global_tables );
break;
case 'ms_global' :
$tables = $this->ms_global_tables;
break;
case 'old' :
$tables = $this->old_tables;
break;
default :
return array();
}
if ( $prefix ) {
if ( ! $blog_id )
$blog_id = $this->blogid;
$blog_prefix = $this->get_blog_prefix( $blog_id );
$base_prefix = $this->base_prefix;
$global_tables = array_merge( $this->global_tables, $this->ms_global_tables );
foreach ( $tables as $k => $table ) {
if ( in_array( $table, $global_tables ) )
$tables[ $table ] = $base_prefix . $table;
else
$tables[ $table ] = $blog_prefix . $table;
unset( $tables[ $k ] );
}
if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) )
$tables['users'] = CUSTOM_USER_TABLE;
if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) )
$tables['usermeta'] = CUSTOM_USER_META_TABLE;
}
return $tables;
}
/**
* Selects a database using the current database connection.
*
* The database name will be changed based on the current database
* connection. On failure, the execution will bail and display an DB error.
*
* @since 0.71
*
* @param string $db MySQL database name
* @param re源代码|null $dbh Optional link identifier.
*/
public function select( $db, $dbh = null ) {
if ( is_null($dbh) )
$dbh = $this->dbh;
if ( $this->use_mysqli ) {
$success = mysqli_select_db( $dbh, $db );
} else {
$success = mysql_select_db( $db, $dbh );
}
if ( ! $success ) {
$this->ready = false;
if ( ! did_action( 'template_redirect' ) ) {
wp_load_translations_early();
$message = '<h1>' . __( 'Can’t select database' ) . "</h1>\n";
$message .= '<p>' . sprintf(
/* translators: %s: database name */
__( 'We were able to connect to the database server (which means your username and password is okay) but not able to select the %s database.' ),
'<code>' . htmlspecialchars( $db, ENT_QUOTES ) . '</code>'
) . "</p>\n";
$message .= "<ul>\n";
$message .= '<li>' . __( 'Are you sure it exists?' ) . "</li>\n";
$message .= '<li>' . sprintf(
/* translators: 1: database user, 2: database name */
__( 'Does the user %1$s have permission to use the %2$s database?' ),
'<code>' . htmlspecialchars( $this->dbuser, ENT_QUOTES ) . '</code>',
'<code>' . htmlspecialchars( $db, ENT_QUOTES ) . '</code>'
) . "</li>\n";
$message .= '<li>' . sprintf(
/* translators: %s: database name */
__( 'On some systems the name of your database is prefixed with your username, so it would be like <code>username_%1$s</code>. Could that be the problem?' ),
htmlspecialchars( $db, ENT_QUOTES )
). "</li>\n";
$message .= "</ul>\n";
$message .= '<p>' . sprintf(
/* translators: %s: support forums URL */
__( 'If you don’t know how to set up a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="%s">WordPress Support Forums</a>.' ),
__( 'https://wordpress.org/support/' )
) . "</p>\n";
$this->bail( $message, 'db_select_fail' );
}
}
}
/**
* Do not use, deprecated.
*
* Use esc_sql() or wpdb::prepare() instead.
*
* @since 2.8.0
* @deprecated 3.6.0 Use wpdb::prepare()
* @see wpdb::prepare
* @see esc_sql()
* @access private
*
* @param string $string
* @return string
*/
function _weak_escape( $string ) {
if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
_deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' );
return addslashes( $string );
}
/**
* Real escape, using mysqli_real_escape_string() or mysql_real_escape_string()
*
* @see mysqli_real_escape_string()
* @see mysql_real_escape_string()
* @since 2.8.0
* @access private
*
* @param string $string to escape
* @return string escaped
*/
function _real_escape( $string ) {
if ( $this->dbh ) {
if ( $this->use_mysqli ) {
return mysqli_real_escape_string( $this->dbh, $string );
} else {
return mysql_real_escape_string( $string, $this->dbh );
}
}
$class = get_class( $this );
if ( function_exists( '__' ) ) {
/* translators: %s: database access abstraction class, usually wpdb or a class extending wpdb */
_doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' );
} else {
_doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), '3.6.0' );
}
return addslashes( $string );
}
/**
* Escape data. Works on arrays.
*
* @uses wpdb::_real_escape()
* @since 2.8.0
* @access public
*
* @param string|array $data
* @return string|array escaped
*/
public function _escape( $data ) {
if ( is_array( $data ) ) {
foreach ( $data as $k => $v ) {
if ( is_array( $v ) ) {
$data[$k] = $this->_escape( $v );
} else {
$data[$k] = $this->_real_escape( $v );
}
}
} else {
$data = $this->_real_escape( $data );
}
return $data;
}
/**
* Do not use, deprecated.
*
* Use esc_sql() or wpdb::prepare() instead.
*
* @since 0.71
* @deprecated 3.6.0 Use wpdb::prepare()
* @see wpdb::prepare()
* @see esc_sql()
*
* @param mixed $data
* @return mixed
*/
public function escape( $data ) {
if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
_deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' );
if ( is_array( $data ) ) {
foreach ( $data as $k => $v ) {
if ( is_array( $v ) )
$data[$k] = $this->escape( $v, 'recursive' );
else
$data[$k] = $this->_weak_escape( $v, 'internal' );
}
} else {
$data = $this->_weak_escape( $data, 'internal' );
}
return $data;
}
/**
* Escapes content by reference for insertion into the database, for security
*
* @uses wpdb::_real_escape()
*
* @since 2.3.0
*
* @param string $string to escape
*/
public function escape_by_ref( &$string ) {
if ( ! is_float( $string ) )
$string = $this->_real_escape( $string );
}
/**
* Prepares a SQL query for safe execution. Uses sprintf()-like syntax.
*
* The following directives can be used in the query format string:
* %d (integer)
* %f (float)
* %s (string)
* %% (literal percentage sign - no argument needed)
*
* All of %d, %f, and %s are to be left unquoted in the query string and they need an argument passed for them.
* Literals (%) as parts of the query must be properly written as %%.
*
* This function only supports a small subset of the sprintf syntax; it only supports %d (integer), %f (float), and %s (string).
* Does not support sign, padding, alignment, width or precision specifiers.
* Does not support argument numbering/swapping.
*
* May be called like {@link https://secure.php.net/sprintf sprintf()} or like {@link https://secure.php.net/vsprintf vsprintf()}.
*
* Both %d and %s should be left unquoted in the query string.
*
* $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 );
* $wpdb->prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
*
* @link https://secure.php.net/sprintf description of syntax.
* @since 2.3.0
*
* @param string $query Query statement with sprintf()-like placeholders
* @param array|mixed $args The array of variables to substitute into the query's placeholders if being called like
* {@link https://secure.php.net/vsprintf vsprintf()}, or the first variable to substitute into the query's placeholders if
* being called like {@link https://secure.php.net/sprintf sprintf()}.
* @param mixed $args,... further variables to substitute into the query's placeholders if being called like
* {@link https://secure.php.net/sprintf sprintf()}.
* @return string|void Sanitized query string, if there is a query to prepare.
*/
public function prepare( $query, $args ) {
if ( is_null( $query ) )
return;
// This is not meant to be foolproof -- but it will catch obviously incorrect usage.
if ( strpos( $query, '%' ) === false ) {
_doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s must have a placeholder.' ), 'wpdb::prepare()' ), '3.9.0' );
}
$args = func_get_args();
array_shift( $args );
// If args were passed as an array (as in vsprintf), move them up
if ( isset( $args[0] ) && is_array($args[0]) )
$args = $args[0];
$query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
$query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
$query = preg_replace( '|(?<!%)%f|' , '%F', $query ); // Force floats to be locale unaware
$query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
array_walk( $args, array( $this, 'escape_by_ref' ) );
return @vsprintf( $query, $args );
}
/**
* First half of escaping for LIKE special characters % and _ before preparing for MySQL.
*
* Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security.
*
* Example Prepared Statement:
*
* $wild = '%';
* $find = 'only 43% of planets';
* $like = $wild . $wpdb->esc_like( $find ) . $wild;
* $sql = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_content LIKE '%s'", $like );
*
* Example Escape Chain:
*
* $sql = esc_sql( $wpdb->esc_like( $input ) );
*
* @since 4.0.0
* @access public
*
* @param string $text The raw text to be escaped. The input typed by the user should have no
* extra or deleted slashes.
* @return string Text in the form of a LIKE phrase. The output is not SQL safe. Call $wpdb::prepare()
* or real_escape next.
*/
public function esc_like( $text ) {
return addcslashes( $text, '_%\\' );
}
/**
* Print SQL/DB error.
*
* @since 0.71
* @global array $EZSQL_ERROR Stores error information of query and error string
*
* @param string $str The error to display
* @return false|void False if the showing of errors is disabled.
*/
public function print_error( $str = '' ) {
global $EZSQL_ERROR;
if ( !$str ) {
if ( $this->use_mysqli ) {
$str = mysqli_error( $this->dbh );
} else {
$str = mysql_error( $this->dbh );
}
}
$EZSQL_ERROR[] = array( 'query' => $this->last_query, 'error_str' => $str );
if ( $this->suppress_errors )
return false;
wp_load_translations_early();
if ( $caller = $this->get_caller() ) {
/* translators: 1: Database error message, 2: SQL query, 3: Name of the calling function */
$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s made by %3$s' ), $str, $this->last_query, $caller );
} else {
/* translators: 1: Database error message, 2: SQL query */
$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s' ), $str, $this->last_query );
}
error_log( $error_str );
// Are we showing errors?
if ( ! $this->show_errors )
return false;
// If there is an error then take note of it
if ( is_multisite() ) {
$msg = sprintf(
"%s [%s]\n%s\n",
__( 'WordPress database error:' ),
$str,
$this->last_query
);
if ( defined( 'ERRORLOGFILE' ) ) {
error_log( $msg, 3, ERRORLOGFILE );
}
if ( defined( 'DIEONDBERROR' ) ) {
wp_die( $msg );
}
} else {
$str = htmlspecialchars( $str, ENT_QUOTES );
$query = htmlspecialchars( $this->last_query, ENT_QUOTES );
printf(
'<div id="error"><p class="wpdberror"><strong>%s</strong> [%s]<br /><code>%s</code></p></div>',
__( 'WordPress database error:' ),
$str,
$query
);
}
}
/**
* Enables showing of database errors.
*
* This function should be used only to enable showing of errors.
* wpdb::hide_errors() should be used instead for hiding of errors. However,
* this function can be used to enable and disable showing of database
* errors.
*
* @since 0.71
* @see wpdb::hide_errors()
*
* @param bool $show Whether to show or hide errors
* @return bool Old value for showing errors.
*/
public function show_errors( $show = true ) {
$errors = $this->show_errors;
$this->show_errors = $show;
return $errors;
}
/**
* Disables showing of database errors.
*
* By default database errors are not shown.
*
* @since 0.71
* @see wpdb::show_errors()
*
* @return bool Whether showing of errors was active
*/
public function hide_errors() {
$show = $this->show_errors;
$this->show_errors = false;
return $show;
}
/**
* Whether to suppress database errors.
*
* By default database errors are suppressed, with a simple
* call to this function they can be enabled.
*
* @since 2.5.0
* @see wpdb::hide_errors()
* @param bool $suppress Optional. New value. Defaults to true.
* @return bool Old value
*/
public function suppress_errors( $suppress = true ) {
$errors = $this->suppress_errors;
$this->suppress_errors = (bool) $suppress;
return $errors;
}
/**
* Kill cached query results.
*
* @since 0.71
*/
public function flush() {
$this->last_result = array();
$this->col_info = null;
$this->last_query = null;
$this->rows_affected = $this->num_rows = 0;
$this->last_error = '';
if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
mysqli_free_result( $this->result );
$this->result = null;
// Sanity check before using the handle
if ( empty( $this->dbh ) || !( $this->dbh instanceof mysqli ) ) {
return;
}
// Clear out any results from a multi-query
while ( mysqli_more_results( $this->dbh ) ) {
mysqli_next_result( $this->dbh );
}
} elseif ( is_re源代码( $this->result ) ) {
mysql_free_result( $this->result );
}
}
/**
* Connect to and select database.
*
* If $allow_bail is false, the lack of database connection will need
* to be handled manually.
*
* @since 3.0.0
* @since 3.9.0 $allow_bail parameter added.
*
* @param bool $allow_bail Optional. Allows the function to bail. Default true.
* @return bool True with a successful connection, false on failure.
*/
public function db_connect( $allow_bail = true ) {
$this->is_mysql = true;
/*
* Deprecated in 3.9+ when using MySQLi. No equivalent
* $new_link parameter exists for mysqli_* functions.
*/
$new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true;
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
if ( $this->use_mysqli ) {
$this->dbh = mysqli_init();
// mysqli_real_connect doesn't support the host param including a port or socket
// like mysql_connect does. This duplicates how mysql_connect detects a port and/or socket file.
$port = null;
$socket = null;
$host = $this->dbhost;
$port_or_socket = strstr( $host, ':' );
if ( ! empty( $port_or_socket ) ) {
$host = substr( $host, 0, strpos( $host, ':' ) );
$port_or_socket = substr( $port_or_socket, 1 );
if ( 0 !== strpos( $port_or_socket, '/' ) ) {
$port = intval( $port_or_socket );
$maybe_socket = strstr( $port_or_socket, ':' );
if ( ! empty( $maybe_socket ) ) {
$socket = substr( $maybe_socket, 1 );
}
} else {
$socket = $port_or_socket;
}
}
if ( WP_DEBUG ) {
mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
} else {
@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
}
if ( $this->dbh->connect_errno ) {
$this->dbh = null;
/* It's possible ext/mysqli is misconfigured. Fall back to ext/mysql if:
* - We haven't previously connected, and
* - WP_USE_EXT_MYSQL isn't set to false, and
* - ext/mysql is loaded.
*/
$attempt_fallback = true;
if ( $this->has_connected ) {
$attempt_fallback = false;
} elseif ( defined( 'WP_USE_EXT_MYSQL' ) && ! WP_USE_EXT_MYSQL ) {
$attempt_fallback = false;
} elseif ( ! function_exists( 'mysql_connect' ) ) {
$attempt_fallback = false;
}
if ( $attempt_fallback ) {
$this->use_mysqli = false;
return $this->db_connect( $allow_bail );
}
}
} else {
if ( WP_DEBUG ) {
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
} else {
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
}
}
if ( ! $this->dbh && $allow_bail ) {
wp_load_translations_early();
// Load custom DB error template, if present.
if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
require_once( WP_CONTENT_DIR . '/db-error.php' );
die();
}
$message = '<h1>' . __( 'Error establishing a database connection' ) . "</h1>\n";
$message .= '<p>' . sprintf(
/* translators: 1: wp-config.php. 2: database host */
__( 'This either means that the username and password information in your %1$s file is incorrect or we can’t contact the database server at %2$s. This could mean your host’s database server is down.' ),
'<code>wp-config.php</code>',
'<code>' . htmlspecialchars( $this->dbhost, ENT_QUOTES ) . '</code>'
) . "</p>\n";
$message .= "<ul>\n";
$message .= '<li>' . __( 'Are you sure you have the correct username and password?' ) . "</li>\n";
$message .= '<li>' . __( 'Are you sure that you have typed the correct hostname?' ) . "</li>\n";
$message .= '<li>' . __( 'Are you sure that the database server is running?' ) . "</li>\n";
$message .= "</ul>\n";
$message .= '<p>' . sprintf(
/* translators: %s: support forums URL */
__( 'If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href="%s">WordPress Support Forums</a>.' ),
__( 'https://wordpress.org/support/' )
) . "</p>\n";
$this->bail( $message, 'db_connect_fail' );
return false;
} elseif ( $this->dbh ) {
if ( ! $this->has_connected ) {
$this->init_charset();
}
$this->has_connected = true;
$this->set_charset( $this->dbh );
$this->ready = true;
$this->set_sql_mode();
$this->select( $this->dbname, $this->dbh );
return true;
}
return false;
}
/**
* Checks that the connection to the database is still up. If not, try to reconnect.
*
* If this function is unable to reconnect, it will forcibly die, or if after the
* the {@see 'template_redirect'} hook has been fired, return false instead.
*
* If $allow_bail is false, the lack of database connection will need
* to be handled manually.
*
* @since 3.9.0
*
* @param bool $allow_bail Optional. Allows the function to bail. Default true.
* @return bool|void True if the connection is up.
*/
public function check_connection( $allow_bail = true ) {
if ( $this->use_mysqli ) {
if ( ! empty( $this->dbh ) && mysqli_ping( $this->dbh ) ) {
return true;
}
} else {
if ( ! empty( $this->dbh ) && mysql_ping( $this->dbh ) ) {
return true;
}
}
$error_reporting = false;
// Disable warnings, as we don't want to see a multitude of "unable to connect" messages
if ( WP_DEBUG ) {
$error_reporting = error_reporting();
error_reporting( $error_reporting & ~E_WARNING );
}
for ( $tries = 1; $tries <= $this->reconnect_retries; $tries++ ) {
// On the last try, re-enable warnings. We want to see a single instance of the
// "unable to connect" message on the bail() screen, if it appears.
if ( $this->reconnect_retries === $tries && WP_DEBUG ) {
error_reporting( $error_reporting );
}
if ( $this->db_connect( false ) ) {
if ( $error_reporting ) {
error_reporting( $error_reporting );
}
return true;
}
sleep( 1 );
}
// If template_redirect has already happened, it's too late for wp_die()/dead_db().
// Let's just return and hope for the best.
if ( did_action( 'template_redirect' ) ) {
return false;
}
if ( ! $allow_bail ) {
return false;
}
wp_load_translations_early();
$message = '<h1>' . __( 'Error reconnecting to the database' ) . "</h1>\n";
$message .= '<p>' . sprintf(
/* translators: %s: database host */
__( 'This means that we lost contact with the database server at %s. This could mean your host’s database server is down.' ),
'<code>' . htmlspecialchars( $this->dbhost, ENT_QUOTES ) . '</code>'
) . "</p>\n";
$message .= "<ul>\n";
$message .= '<li>' . __( 'Are you sure that the database server is running?' ) . "</li>\n";
$message .= '<li>' . __( 'Are you sure that the database server is not under particularly heavy load?' ) . "</li>\n";
$message .= "</ul>\n";
$message .= '<p>' . sprintf(
/* translators: %s: support forums URL */
__( 'If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href="%s">WordPress Support Forums</a>.' ),
__( 'https://wordpress.org/support/' )
) . "</p>\n";
// We weren't able to reconnect, so we better bail.
$this->bail( $message, 'db_connect_fail' );
// Call dead_db() if bail didn't die, because this database is no more. It has ceased to be (at least temporarily).
dead_db();
}
/**
* Perform a MySQL database query, using current database connection.
*
* More information can be found on the codex page.
*
* @since 0.71
*
* @param string $query Database query
* @return int|false Number of rows affected/selected or false on error
*/
public function query( $query ) {
if ( ! $this->ready ) {
$this->check_current_query = true;
return false;
}
/**
* Filters the database query.
*
* Some queries are made before the plugins have been loaded,
* and thus cannot be filtered with this method.
*
* @since 2.1.0
*
* @param string $query Database query.
*/
$query = apply_filters( 'query', $query );
$this->flush();
// Log how the function was called
$this->func_call = "\$db->query(\"$query\")";
// If we're writing to the database, make sure the query will write safely.
if ( $this->check_current_query && ! $this->check_ascii( $query ) ) {
$stripped_query = $this->strip_invalid_text_from_query( $query );
// strip_invalid_text_from_query() can perform queries, so we need
// to flush again, just to make sure everything is clear.
$this->flush();
if ( $stripped_query !== $query ) {
$this->insert_id = 0;
return false;
}
}
$this->check_current_query = true;
// Keep track of the last query for debug.
$this->last_query = $query;
$this->_do_query( $query );
// MySQL server has gone away, try to reconnect.
$mysql_errno = 0;
if ( ! empty( $this->dbh ) ) {
if ( $this->use_mysqli ) {
if ( $this->dbh instanceof mysqli ) {
$mysql_errno = mysqli_errno( $this->dbh );
} else {
// $dbh is defined, but isn't a real connection.
// Something has gone horribly wrong, let's try a reconnect.
$mysql_errno = 2006;
}
} else {
if ( is_re源代码( $this->dbh ) ) {
$mysql_errno = mysql_errno( $this->dbh );
} else {
$mysql_errno = 2006;
}
}
}
if ( empty( $this->dbh ) || 2006 == $mysql_errno ) {
if ( $this->check_connection() ) {
$this->_do_query( $query );
} else {
$this->insert_id = 0;
return false;
}
}
// If there is an error then take note of it.
if ( $this->use_mysqli ) {
if ( $this->dbh instanceof mysqli ) {
$this->last_error = mysqli_error( $this->dbh );
} else {
$this->last_error = __( 'Unable to retrieve the error message from MySQL' );
}
} else {
if ( is_re源代码( $this->dbh ) ) {
$this->last_error = mysql_error( $this->dbh );
} else {
$this->last_error = __( 'Unable to retrieve the error message from MySQL' );
}
}
if ( $this->last_error ) {
// Clear insert_id on a subsequent failed insert.
if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) )
$this->insert_id = 0;
$this->print_error();
return false;
}
if ( preg_match( '/^\s*(create|alter|truncate|drop)\s/i', $query ) ) {
$return_val = $this->result;
} elseif ( preg_match( '/^\s*(insert|delete|update|replace)\s/i', $query ) ) {
if ( $this->use_mysqli ) {
$this->rows_affected = mysqli_affected_rows( $this->dbh );
} else {
$this->rows_affected = mysql_affected_rows( $this->dbh );
}
// Take note of the insert_id
if ( preg_match( '/^\s*(insert|replace)\s/i', $query ) ) {
if ( $this->use_mysqli ) {
$this->insert_id = mysqli_insert_id( $this->dbh );
} else {
$this->insert_id = mysql_insert_id( $this->dbh );
}
}
// Return number of rows affected
$return_val = $this->rows_affected;
} else {
$num_rows = 0;
if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
while ( $row = mysqli_fetch_object( $this->result ) ) {
$this->last_result[$num_rows] = $row;
$num_rows++;
}
} elseif ( is_re源代码( $this->result ) ) {
while ( $row = mysql_fetch_object( $this->result ) ) {
$this->last_result[$num_rows] = $row;
$num_rows++;
}
}
// Log number of rows the query returned
// and return number of rows selected
$this->num_rows = $num_rows;
$return_val = $num_rows;
}
return $return_val;
}
/**
* Internal function to perform the mysql_query() call.
*
* @since 3.9.0
*
* @access private
* @see wpdb::query()
*
* @param string $query The query to run.
*/
private function _do_query( $query ) {
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
$this->timer_start();
}
if ( ! empty( $this->dbh ) && $this->use_mysqli ) {
$this->result = mysqli_query( $this->dbh, $query );
} elseif ( ! empty( $this->dbh ) ) {
$this->result = mysql_query( $query, $this->dbh );
}
$this->num_queries++;
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
}
}
/**
* Insert a row into a table.
*
* wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
* wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
*
* @since 2.5.0
* @see wpdb::prepare()
* @see wpdb::$field_types
* @see wp_set_wpdb_vars()
*
* @param string $table Table name
* @param array $data Data to insert (in column => value pairs).
* Both $data columns and $data values should be "raw" (neither should be SQL escaped).
* Sending a null value will cause the column to be set to NULL - the corresponding format is ignored in this case.
* @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.
* If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
* @return int|false The number of rows inserted, or false on error.
*/
public function insert( $table, $data, $format = null ) {
return $this->_insert_replace_helper( $table, $data, $format, 'INSERT' );
}
/**
* Replace a row into a table.
*
* wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
* wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
*
* @since 3.0.0
* @see wpdb::prepare()
* @see wpdb::$field_types
* @see wp_set_wpdb_vars()
*
* @param string $table Table name
* @param array $data Data to insert (in column => value pairs).
* Both $data columns and $data values should be "raw" (neither should be SQL escaped).
* Sending a null value will cause the column to be set to NULL - the corresponding format is ignored in this case.
* @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.
* If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
* @return int|false The number of rows affected, or false on error.
*/
public function replace( $table, $data, $format = null ) {
return $this->_insert_replace_helper( $table, $data, $format, 'REPLACE' );
}
/**
* Helper function for insert and replace.
*
* Runs an insert or replace query based on $type argument.
*
* @access private
* @since 3.0.0
* @see wpdb::prepare()
* @see wpdb::$field_types
* @see wp_set_wpdb_vars()
*
* @param string $table Table name
* @param array $data Data to insert (in column => value pairs).
* Both $data columns and $data values should be "raw" (neither should be SQL escaped).
* Sending a null value will cause the column to be set to NULL - the corresponding format is ignored in this case.
* @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.
* If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
* @param string $type Optional. What type of operation is this? INSERT or REPLACE. Defaults to INSERT.
* @return int|false The number of rows affected, or false on error.
*/
function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) {
$this->insert_id = 0;
if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) ) {
return false;
}
$data = $this->process_fields( $table, $data, $format );
if ( false === $data ) {
return false;
}
$formats = $values = array();
foreach ( $data as $value ) {
if ( is_null( $value['value'] ) ) {
$formats[] = 'NULL';
continue;
}
$formats[] = $value['format'];
$values[] = $value['value'];
}
$fields = '`' . implode( '`, `', array_keys( $data ) ) . '`';
$formats = implode( ', ', $formats );
$sql = "$type INTO `$table` ($fields) VALUES ($formats)";
$this->check_current_query = false;
return $this->query( $this->prepare( $sql, $values ) );
}
/**
* Update a row in the table
*
* wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) )
* wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )
*
* @since 2.5.0
* @see wpdb::prepare()
* @see wpdb::$field_types
* @see wp_set_wpdb_vars()
*
* @param string $table Table name
* @param array $data Data to update (in column => value pairs).
* Both $data columns and $data values should be "raw" (neither should be SQL escaped).
* Sending a null value will cause the column to be set to NULL - the corresponding
* format is ignored in this case.
* @param array $where A named array of WHERE clauses (in column => value pairs).
* Multiple clauses will be joined with ANDs.
* Both $where columns and $where values should be "raw".
* Sending a null value will create an IS NULL comparison - the corresponding format will be ignored in this case.
* @param array|string $format Optional. An array of formats to be mapped to each of the values in $data.
* If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
* @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where.
* If string, that format will be used for all of the items in $where.
* A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $where will be treated as strings.
* @return int|false The number of rows updated, or false on error.
*/
public function update( $table, $data, $where, $format = null, $where_format = null ) {
if ( ! is_array( $data ) || ! is_array( $where ) ) {
return false;
}
$data = $this->process_fields( $table, $data, $format );
if ( false === $data ) {
return false;
}
$where = $this->process_fields( $table, $where, $where_format );
if ( false === $where ) {
return false;
}
$fields = $conditions = $values = array();
foreach ( $data as $field => $value ) {
if ( is_null( $value['value'] ) ) {
$fields[] = "`$field` = NULL";
continue;
}
$fields[] = "`$field` = " . $value['format'];
$values[] = $value['value'];
}
foreach ( $where as $field => $value ) {
if ( is_null( $value['value'] ) ) {
$conditions[] = "`$field` IS NULL";
continue;
}
$conditions[] = "`$field` = " . $value['format'];
$values[] = $value['value'];
}
$fields = implode( ', ', $fields );
$conditions = implode( ' AND ', $conditions );
$sql = "UPDATE `$table` SET $fields WHERE $conditions";
$this->check_current_query = false;
return $this->query( $this->prepare( $sql, $values ) );
}
/**
* Delete a row in the table
*
* wpdb::delete( 'table', array( 'ID' => 1 ) )
* wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )
*
* @since 3.4.0
* @see wpdb::prepare()
* @see wpdb::$field_types
* @see wp_set_wpdb_vars()
*
* @param string $table Table name
* @param array $where A named array of WHERE clauses (in column => value pairs).
* Multiple clauses will be joined with ANDs.
* Both $where columns and $where values should be "raw".
* Sending a null value will create an IS NULL comparison - the corresponding format will be ignored in this case.
* @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where.
* If string, that format will be used for all of the items in $where.
* A format is one of '%d', '%f', '%s' (integer, float, string).
* If omitted, all values in $where will be treated as strings unless otherwise specified in wpdb::$field_types.
* @return int|false The number of rows updated, or false on error.
*/
public function delete( $table, $where, $where_format = null ) {
if ( ! is_array( $where ) ) {
return false;
}
$where = $this->process_fields( $table, $where, $where_format );
if ( false === $where ) {
return false;
}
$conditions = $values = array();
foreach ( $where as $field => $value ) {
if ( is_null( $value['value'] ) ) {
$conditions[] = "`$field` IS NULL";
continue;
}
$conditions[] = "`$field` = " . $value['format'];
$values[] = $value['value'];
}
$conditions = implode( ' AND ', $conditions );
$sql = "DELETE FROM `$table` WHERE $conditions";
$this->check_current_query = false;
return $this->query( $this->prepare( $sql, $values ) );
}
/**
* Processes arrays of field/value pairs and field formats.
*
* This is a helper method for wpdb's CRUD methods, which take field/value
* pairs for inserts, updates, and where clauses. This method first pairs
* each value with a format. Then it determines the charset of that field,
* using that to determine if any invalid text would be stripped. If text is
* stripped, then field processing is rejected and the query fails.
*
* @since 4.2.0
* @access protected
*
* @param string $table Table name.
* @param array $data Field/value pair.
* @param mixed $format Format for each field.
* @return array|false Returns an array of fields that contain paired values
* and formats. Returns false for invalid values.
*/
protected function process_fields( $table, $data, $format ) {
$data = $this->process_field_formats( $data, $format );
if ( false === $data ) {
return false;
}
$data = $this->process_field_charsets( $data, $table );
if ( false === $data ) {
return false;
}
$data = $this->process_field_lengths( $data, $table );
if ( false === $data ) {
return false;
}
$converted_data = $this->strip_invalid_text( $data );
if ( $data !== $converted_data ) {
return false;
}
return $data;
}
/**
* Prepares arrays of value/format pairs as passed to wpdb CRUD methods.
*
* @since 4.2.0
* @access protected
*
* @param array $data Array of fields to values.
* @param mixed $format Formats to be mapped to the values in $data.
* @return array Array, keyed by field names with values being an array
* of 'value' and 'format' keys.
*/
protected function process_field_formats( $data, $format ) {
$formats = $original_formats = (array) $format;
foreach ( $data as $field => $value ) {
$value = array(
'value' => $value,
'format' => '%s',
);
if ( ! empty( $format ) ) {
$value['format'] = array_shift( $formats );
if ( ! $value['format'] ) {
$value['format'] = reset( $original_formats );
}
} elseif ( isset( $this->field_types[ $field ] ) ) {
$value['format'] = $this->field_types[ $field ];
}
$data[ $field ] = $value;
}
return $data;
}
/**
* Adds field charsets to field/value/format arrays generated by
* the wpdb::process_field_formats() method.
*
* @since 4.2.0
* @access protected
*
* @param array $data As it comes from the wpdb::process_field_formats() method.
* @param string $table Table name.
* @return array|false The same array as $data with additional 'charset' keys.
*/
protected function process_field_charsets( $data, $table ) {
foreach ( $data as $field => $value ) {
if ( '%d' === $value['format'] || '%f' === $value['format'] ) {
/*
* We can skip this field if we know it isn't a string.
* This checks %d/%f versus ! %s because its sprintf() could take more.
*/
$value['charset'] = false;
} else {
$value['charset'] = $this->get_col_charset( $table, $field );
if ( is_wp_error( $value['charset'] ) ) {
return false;
}
}
$data[ $field ] = $value;
}
return $data;
}
/**
* For string fields, record the maximum string length that field can safely save.
*
* @since 4.2.1
* @access protected
*
* @param array $data As it comes from the wpdb::process_field_charsets() method.
* @param string $table Table name.
* @return array|false The same array as $data with additional 'length' keys, or false if
* any of the values were too long for their corresponding field.
*/
protected function process_field_lengths( $data, $table ) {
foreach ( $data as $field => $value ) {
if ( '%d' === $value['format'] || '%f' === $value['format'] ) {
/*
* We can skip this field if we know it isn't a string.
* This checks %d/%f versus ! %s because its sprintf() could take more.
*/
$value['length'] = false;
} else {
$value['length'] = $this->get_col_length( $table, $field );
if ( is_wp_error( $value['length'] ) ) {
return false;
}
}
$data[ $field ] = $value;
}
return $data;
}
/**
* Retrieve one variable from the database.
*
* Executes a SQL query and returns the value from the SQL result.
* If the SQL result contains more than one column and/or more than one row, this function returns the value in the column and row specified.
* If $query is null, this function returns the value in the specified column and row from the previous SQL result.
*
* @since 0.71
*
* @param string|null $query Optional. SQL query. Defaults to null, use the result from the previous query.
* @param int $x Optional. Column of value to return. Indexed from 0.
* @param int $y Optional. Row of value to return. Indexed from 0.
* @return string|null Database query result (as string), or null on failure
*/
public function get_var( $query = null, $x = 0, $y = 0 ) {
$this->func_call = "\$db->get_var(\"$query\", $x, $y)";
if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
$this->check_current_query = false;
}
if ( $query ) {
$this->query( $query );
}
// Extract var out of cached results based x,y vals
if ( !empty( $this->last_result[$y] ) ) {
$values = array_values( get_object_vars( $this->last_result[$y] ) );
}
// If there is a value return it else return null
return ( isset( $values[$x] ) && $values[$x] !== '' ) ? $values[$x] : null;
}
/**
* Retrieve one row from the database.
*
* Executes a SQL query and returns the row from the SQL result.
*
* @since 0.71
*
* @param string|null $query SQL query.
* @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
* an stdClass object, an associative array, or a numeric array, respectively. Default OBJECT.
* @param int $y Optional. Row to return. Indexed from 0.
* @return array|object|null|void Database query result in format specified by $output or null on failure
*/
public function get_row( $query = null, $output = OBJECT, $y = 0 ) {
$this->func_call = "\$db->get_row(\"$query\",$output,$y)";
if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
$this->check_current_query = false;
}
if ( $query ) {
$this->query( $query );
} else {
return null;
}
if ( !isset( $this->last_result[$y] ) )
return null;
if ( $output == OBJECT ) {
return $this->last_result[$y] ? $this->last_result[$y] : null;
} elseif ( $output == ARRAY_A ) {
return $this->last_result[$y] ? get_object_vars( $this->last_result[$y] ) : null;
} elseif ( $output == ARRAY_N ) {
return $this->last_result[$y] ? array_values( get_object_vars( $this->last_result[$y] ) ) : null;
} elseif ( strtoupper( $output ) === OBJECT ) {
// Back compat for OBJECT being previously case insensitive.
return $this->last_result[$y] ? $this->last_result[$y] : null;
} else {
$this->print_error( " \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N" );
}
}
/**
* Retrieve one column from the database.
*
* Executes a SQL query and returns the column from the SQL result.
* If the SQL result contains more than one column, this function returns the column specified.
* If $query is null, this function returns the specified column from the previous SQL result.
*
* @since 0.71
*
* @param string|null $query Optional. SQL query. Defaults to previous query.
* @param int $x Optional. Column to return. Indexed from 0.
* @return array Database query result. Array indexed from 0 by SQL result row number.
*/
public function get_col( $query = null , $x = 0 ) {
if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
$this->check_current_query = false;
}
if ( $query ) {
$this->query( $query );
}
$new_array = array();
// Extract the column values
for ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) {
$new_array[$i] = $this->get_var( null, $x, $i );
}
return $new_array;
}
/**
* Retrieve an entire SQL result set from the database (i.e., many rows)
*
* Executes a SQL query and returns the entire SQL result.
*
* @since 0.71
*
* @param string $query SQL query.
* @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants.
* With one of the first three, return an array of rows indexed from 0 by SQL result row number.
* Each row is an associative array (column => value, ...), a numerically indexed array (0 => value, ...), or an object. ( ->column = value ), respectively.
* With OBJECT_K, return an associative array of row objects keyed by the value of each row's first column's value.
* Duplicate keys are discarded.
* @return array|object|null Database query results
*/
public function get_results( $query = null, $output = OBJECT ) {
$this->func_call = "\$db->get_results(\"$query\", $output)";
if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
$this->check_current_query = false;
}
if ( $query ) {
$this->query( $query );
} else {
return null;
}
$new_array = array();
if ( $output == OBJECT ) {
// Return an integer-keyed array of row objects
return $this->last_result;
} elseif ( $output == OBJECT_K ) {
// Return an array of row objects with keys from column 1
// (Duplicates are discarded)
foreach ( $this->last_result as $row ) {
$var_by_ref = get_object_vars( $row );
$key = array_shift( $var_by_ref );
if ( ! isset( $new_array[ $key ] ) )
$new_array[ $key ] = $row;
}
return $new_array;
} elseif ( $output == ARRAY_A || $output == ARRAY_N ) {
// Return an integer-keyed array of...
if ( $this->last_result ) {
foreach ( (array) $this->last_result as $row ) {
if ( $output == ARRAY_N ) {
// ...integer-keyed row arrays
$new_array[] = array_values( get_object_vars( $row ) );
} else {
// ...column name-keyed row arrays
$new_array[] = get_object_vars( $row );
}
}
}
return $new_array;
} elseif ( strtoupper( $output ) === OBJECT ) {
// Back compat for OBJECT being previously case insensitive.
return $this->last_result;
}
return null;
}
/**
* Retrieves the character set for the given table.
*
* @since 4.2.0
* @access protected
*
* @param string $table Table name.
* @return string|WP_Error Table character set, WP_Error object if it couldn't be found.
*/
protected function get_table_charset( $table ) {
$tablekey = strtolower( $table );
/**
* Filters the table charset value before the DB is checked.
*
* Passing a non-null value to the filter will effectively short-circuit
* checking the DB for the charset, returning that value instead.
*
* @since 4.2.0
*
* @param string $charset The character set to use. Default null.
* @param string $table The name of the table being checked.
*/
$charset = apply_filters( 'pre_get_table_charset', null, $table );
if ( null !== $charset ) {
return $charset;
}
if ( isset( $this->table_charset[ $tablekey ] ) ) {
return $this->table_charset[ $tablekey ];
}
$charsets = $columns = array();
$table_parts = explode( '.', $table );
$table = '`' . implode( '`.`', $table_parts ) . '`';
$results = $this->get_results( "SHOW FULL COLUMNS FROM $table" );
if ( ! $results ) {
return new WP_Error( 'wpdb_get_table_charset_failure' );
}
foreach ( $results as $column ) {
$columns[ strtolower( $column->Field ) ] = $column;
}
$this->col_meta[ $tablekey ] = $columns;
foreach ( $columns as $column ) {
if ( ! empty( $column->Collation ) ) {
list( $charset ) = explode( '_', $column->Collation );
// If the current connection can't support utf8mb4 characters, let's only send 3-byte utf8 characters.
if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {
$charset = 'utf8';
}
$charsets[ strtolower( $charset ) ] = true;
}
list( $type ) = explode( '(', $column->Type );
// A binary/blob means the whole query gets treated like this.
if ( in_array( strtoupper( $type ), array( 'BINARY', 'VARBINARY', 'TINYBLOB', 'MEDIUMBLOB', 'BLOB', 'LONGBLOB' ) ) ) {
$this->table_charset[ $tablekey ] = 'binary';
return 'binary';
}
}
// utf8mb3 is an alias for utf8.
if ( isset( $charsets['utf8mb3'] ) ) {
$charsets['utf8'] = true;
unset( $charsets['utf8mb3'] );
}
// Check if we have more than one charset in play.
$count = count( $charsets );
if ( 1 === $count ) {
$charset = key( $charsets );
} elseif ( 0 === $count ) {
// No charsets, assume this table can store whatever.
$charset = false;
} else {
// More than one charset. Remove latin1 if present and recalculate.
unset( $charsets['latin1'] );
$count = count( $charsets );
if ( 1 === $count ) {
// Only one charset (besides latin1).
$charset = key( $charsets );
} elseif ( 2 === $count && isset( $charsets['utf8'], $charsets['utf8mb4'] ) ) {
// Two charsets, but they're utf8 and utf8mb4, use utf8.
$charset = 'utf8';
} else {
// Two mixed character sets. ascii.
$charset = 'ascii';
}
}
$this->table_charset[ $tablekey ] = $charset;
return $charset;
}
/**
* Retrieves the character set for the given column.
*
* @since 4.2.0
* @access public
*
* @param string $table Table name.
* @param string $column Column name.
* @return string|false|WP_Error Column character set as a string. False if the column has no
* character set. WP_Error object if there was an error.
*/
public function get_col_charset( $table, $column ) {
$tablekey = strtolower( $table );
$columnkey = strtolower( $column );
/**
* Filters the column charset value before the DB is checked.
*
* Passing a non-null value to the filter will short-circuit
* checking the DB for the charset, returning that value instead.
*
* @since 4.2.0
*
* @param string $charset The character set to use. Default null.
* @param string $table The name of the table being checked.
* @param string $column The name of the column being checked.
*/
$charset = apply_filters( 'pre_get_col_charset', null, $table, $column );
if ( null !== $charset ) {
return $charset;
}
// Skip this entirely if this isn't a MySQL database.
if ( empty( $this->is_mysql ) ) {
return false;
}
if ( empty( $this->table_charset[ $tablekey ] ) ) {
// This primes column information for us.
$table_charset = $this->get_table_charset( $table );
if ( is_wp_error( $table_charset ) ) {
return $table_charset;
}
}
// If still no column information, return the table charset.
if ( empty( $this->col_meta[ $tablekey ] ) ) {
return $this->table_charset[ $tablekey ];
}
// If this column doesn't exist, return the table charset.
if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) {
return $this->table_charset[ $tablekey ];
}
// Return false when it's not a string column.
if ( empty( $this->col_meta[ $tablekey ][ $columnkey ]->Collation ) ) {
return false;
}
list( $charset ) = explode( '_', $this->col_meta[ $tablekey ][ $columnkey ]->Collation );
return $charset;
}
/**
* Retrieve the maximum string length allowed in a given column.
* The length may either be specified as a byte length or a character length.
*
* @since 4.2.1
* @access public
*
* @param string $table Table name.
* @param string $column Column name.
* @return array|false|WP_Error array( 'length' => (int), 'type' => 'byte' | 'char' )
* false if the column has no length (for example, numeric column)
* WP_Error object if there was an error.
*/
public function get_col_length( $table, $column ) {
$tablekey = strtolower( $table );
$columnkey = strtolower( $column );
// Skip this entirely if this isn't a MySQL database.
if ( empty( $this->is_mysql ) ) {
return false;
}
if ( empty( $this->col_meta[ $tablekey ] ) ) {
// This primes column information for us.
$table_charset = $this->get_table_charset( $table );
if ( is_wp_error( $table_charset ) ) {
return $table_charset;
}
}
if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) {
return false;
}
$typeinfo = explode( '(', $this->col_meta[ $tablekey ][ $columnkey ]->Type );
$type = strtolower( $typeinfo[0] );
if ( ! empty( $typeinfo[1] ) ) {
$length = trim( $typeinfo[1], ')' );
} else {
$length = false;
}
switch( $type ) {
case 'char':
case 'varchar':
return array(
'type' => 'char',
'length' => (int) $length,
);
case 'binary':
case 'varbinary':
return array(
'type' => 'byte',
'length' => (int) $length,
);
case 'tinyblob':
case 'tinytext':
return array(
'type' => 'byte',
'length' => 255, // 2^8 - 1
);
case 'blob':
case 'text':
return array(
'type' => 'byte',
'length' => 65535, // 2^16 - 1
);
case 'mediumblob':
case 'mediumtext':
return array(
'type' => 'byte',
'length' => 16777215, // 2^24 - 1
);
case 'longblob':
case 'longtext':
return array(
'type' => 'byte',
'length' => 4294967295, // 2^32 - 1
);
default:
return false;
}
}
/**
* Check if a string is ASCII.
*
* The negative regex is faster for non-ASCII strings, as it allows
* the search to finish as soon as it encounters a non-ASCII character.
*
* @since 4.2.0
* @access protected
*
* @param string $string String to check.
* @return bool True if ASCII, false if not.
*/
protected function check_ascii( $string ) {
if ( function_exists( 'mb_check_encoding' ) ) {
if ( mb_check_encoding( $string, 'ASCII' ) ) {
return true;
}
} elseif ( ! preg_match( '/[^\x00-\x7F]/', $string ) ) {
return true;
}
return false;
}
/**
* Check if the query is accessing a collation considered safe on the current version of MySQL.
*
* @since 4.2.0
* @access protected
*
* @param string $query The query to check.
* @return bool True if the collation is safe, false if it isn't.
*/
protected function check_safe_collation( $query ) {
if ( $this->checking_collation ) {
return true;
}
// We don't need to check the collation for queries that don't read data.
$query = ltrim( $query, "\r\n\t (" );
if ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN|CREATE)\s/i', $query ) ) {
return true;
}
// All-ASCII queries don't need extra checking.
if ( $this->check_ascii( $query ) ) {
return true;
}
$table = $this->get_table_from_query( $query );
if ( ! $table ) {
return false;
}
$this->checking_collation = true;
$collation = $this->get_table_charset( $table );
$this->checking_collation = false;
// Tables with no collation, or latin1 only, don't need extra checking.
if ( false === $collation || 'latin1' === $collation ) {
return true;
}
$table = strtolower( $table );
if ( empty( $this->col_meta[ $table ] ) ) {
return false;
}
// If any of the columns don't have one of these collations, it needs more sanity checking.
foreach ( $this->col_meta[ $table ] as $col ) {
if ( empty( $col->Collation ) ) {
continue;
}
if ( ! in_array( $col->Collation, array( 'utf8_general_ci', 'utf8_bin', 'utf8mb4_general_ci', 'utf8mb4_bin' ), true ) ) {
return false;
}
}
return true;
}
/**
* Strips any invalid characters based on value/charset pairs.
*
* @since 4.2.0
* @access protected
*
* @param array $data Array of value arrays. Each value array has the keys
* 'value' and 'charset'. An optional 'ascii' key can be
* set to false to avoid redundant ASCII checks.
* @return array|WP_Error The $data parameter, with invalid characters removed from
* each value. This works as a passthrough: any additional keys
* such as 'field' are retained in each value array. If we cannot
* remove invalid characters, a WP_Error object is returned.
*/
protected function strip_invalid_text( $data ) {
$db_check_string = false;
foreach ( $data as &$value ) {
$charset = $value['charset'];
if ( is_array( $value['length'] ) ) {
$length = $value['length']['length'];
$truncate_by_byte_length = 'byte' === $value['length']['type'];
} else {
$length = false;
// Since we have no length, we'll never truncate.
// Initialize the variable to false. true would take us
// through an unnecessary (for this case) codepath below.
$truncate_by_byte_length = false;
}
// There's no charset to work with.
if ( false === $charset ) {
continue;
}
// Column isn't a string.
if ( ! is_string( $value['value'] ) ) {
continue;
}
$needs_validation = true;
if (
// latin1 can store any byte sequence
'latin1' === $charset
||
// ASCII is always OK.
( ! isset( $value['ascii'] ) && $this->check_ascii( $value['value'] ) )
) {
$truncate_by_byte_length = true;
$needs_validation = false;
}
if ( $truncate_by_byte_length ) {
mbstring_binary_safe_encoding();
if ( false !== $length && strlen( $value['value'] ) > $length ) {
$value['value'] = substr( $value['value'], 0, $length );
}
reset_mbstring_encoding();
if ( ! $needs_validation ) {
continue;
}
}
// utf8 can be handled by regex, which is a bunch faster than a DB lookup.
if ( ( 'utf8' === $charset || 'utf8mb3' === $charset || 'utf8mb4' === $charset ) && function_exists( 'mb_strlen' ) ) {
$regex = '/
(
(?: [\x00-\x7F]
更新日志
Version | description |
---|---|
0.71 | Introduced. |
Methods
- __construct Connects to the database server and selects a database
- __destruct PHP5 style destructor and will run when database object is destroyed.
- __get Makes private properties readable for backward compatibility.
- __isset Makes private properties check-able for backward compatibility.
- __set Makes private properties settable for backward compatibility.
- __unset Makes private properties un-settable for backward compatibility.
- _do_query Internal function to perform the mysql_query() call.
- _escape Escape data. Works on arrays.
- _insert_replace_helper Helper function for insert and replace.
- _real_escape Real escape, using mysqli_real_escape_string() or mysql_real_escape_string()
- _weak_escape Do not use, deprecated. deprecated
- bail Wraps errors in a nice header and footer and dies.
- check_ascii Check if a string is ASCII.
- check_connection Checks that the connection to the database is still up. If not, try to reconnect.
- check_database_version Whether MySQL database is at least the required minimum version.
- check_safe_collation Check if the query is accessing a collation considered safe on the current version of MySQL.
- close Closes the current database connection.
- db_connect Connect to and select database.
- db_version Retrieves the MySQL server version.
- delete Delete a row in the table
- determine_charset Determines the best charset and collation to use given a charset and collation.
- esc_like First half of escaping for LIKE special characters % and _ before preparing for MySQL.
- escape Do not use, deprecated. deprecated
- escape_by_ref Escapes content by reference for insertion into the database, for security
- flush Kill cached query results.
- get_blog_prefix Gets blog prefix.
- get_caller Retrieve the name of the function that called wpdb.
- get_charset_collate The database character collate.
- get_col Retrieve one column from the database.
- get_col_charset Retrieves the character set for the given column.
- get_col_info Retrieve column metadata from the last query.
- get_col_length Retrieve the maximum string length allowed in a given column.
- get_results Retrieve an entire SQL result set from the database (i.e., many rows)
- get_row Retrieve one row from the database.
- get_table_charset Retrieves the character set for the given table.
- get_table_from_query Find the first table name referenced in a query.
- get_var Retrieve one variable from the database.
- has_cap Determine if a database supports a particular feature.
- hide_errors Disables showing of database errors.
- init_charset Set $this->charset and $this->collate
- insert Insert a row into a table.
- load_col_info Load the column metadata from the last query.
- prepare Prepares a SQL query for safe execution. Uses sprintf()-like syntax.
- print_error Print SQL/DB error.
- process_field_charsets Adds field charsets to field/value/format arrays generated by the wpdb::process_field_formats() method.
- process_field_formats Prepares arrays of value/format pairs as passed to wpdb CRUD methods.
- process_field_lengths For string fields, record the maximum string length that field can safely save.
- process_fields Processes arrays of field/value pairs and field formats.
- query Perform a MySQL database query, using current database connection.
- replace Replace a row into a table.
- select Selects a database using the current database connection.
- set_blog_id Sets blog id.
- set_charset Sets the connection's character set.
- set_prefix Sets the table prefix for the WordPress tables.
- set_sql_mode Change the current SQL mode, and ensure its WordPress compatibility.
- show_errors Enables showing of database errors.
- strip_invalid_text Strips any invalid characters based on value/charset pairs.
- strip_invalid_text_for_column Strips any invalid characters from the string for a given table and column.
- strip_invalid_text_from_query Strips any invalid characters from the query.
- supports_collation Whether the database supports collation. deprecated
- suppress_errors Whether to suppress database errors.
- tables Returns an array of WordPress tables.
- timer_start Starts the timer, for debugging purposes.
- timer_stop Stops the debugging timer.
- update Update a row in the table
User Contributed Notes
- Skip to note content You must log in to vote on the helpfulness of this noteVote results for this note: 1You must log in to vote on the helpfulness of this note Contributed by
Priyanka Behera
Retrieve and display the sum of a Custom Field value.
// set the meta_key to the appropriate custom field meta key $meta_key = 'miles'; $allmiles = $wpdb->get_var( $wpdb->prepare( " SELECT sum(meta_value) FROM $wpdb->postmeta WHERE meta_key = %s ", $meta_key ) ); echo "<p>Total miles is {$allmiles}</p>";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论