- 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()
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
WP_Customize_Manager
WP_Customize_Manager
Customize Manager class.
description
Bootstraps the Customize experience on the server-side.
Sets up the theme-switching process if a theme other than the active one is being previewed and customized.
Serves as a factory for Customize Controls and Settings, and instantiates default Customize Controls and Settings.
源代码
File: wp-includes/class-wp-customize-manager.php
final class WP_Customize_Manager {
/**
* An instance of the theme being previewed.
*
* @since 3.4.0
* @access protected
* @var WP_Theme
*/
protected $theme;
/**
* The directory name of the previously active theme (within the theme_root).
*
* @since 3.4.0
* @access protected
* @var string
*/
protected $original_stylesheet;
/**
* Whether this is a Customizer pageload.
*
* @since 3.4.0
* @access protected
* @var bool
*/
protected $previewing = false;
/**
* Methods and properties dealing with managing widgets in the Customizer.
*
* @since 3.9.0
* @access public
* @var WP_Customize_Widgets
*/
public $widgets;
/**
* Methods and properties dealing with managing nav menus in the Customizer.
*
* @since 4.3.0
* @access public
* @var WP_Customize_Nav_Menus
*/
public $nav_menus;
/**
* Methods and properties dealing with selective refresh in the Customizer preview.
*
* @since 4.5.0
* @access public
* @var WP_Customize_Selective_Refresh
*/
public $selective_refresh;
/**
* Registered instances of WP_Customize_Setting.
*
* @since 3.4.0
* @access protected
* @var array
*/
protected $settings = array();
/**
* Sorted top-level instances of WP_Customize_Panel and WP_Customize_Section.
*
* @since 4.0.0
* @access protected
* @var array
*/
protected $containers = array();
/**
* Registered instances of WP_Customize_Panel.
*
* @since 4.0.0
* @access protected
* @var array
*/
protected $panels = array();
/**
* List of core components.
*
* @since 4.5.0
* @access protected
* @var array
*/
protected $components = array( 'widgets', 'nav_menus' );
/**
* Registered instances of WP_Customize_Section.
*
* @since 3.4.0
* @access protected
* @var array
*/
protected $sections = array();
/**
* Registered instances of WP_Customize_Control.
*
* @since 3.4.0
* @access protected
* @var array
*/
protected $controls = array();
/**
* Panel types that may be rendered from JS templates.
*
* @since 4.3.0
* @access protected
* @var array
*/
protected $registered_panel_types = array();
/**
* Section types that may be rendered from JS templates.
*
* @since 4.3.0
* @access protected
* @var array
*/
protected $registered_section_types = array();
/**
* Control types that may be rendered from JS templates.
*
* @since 4.1.0
* @access protected
* @var array
*/
protected $registered_control_types = array();
/**
* Initial URL being previewed.
*
* @since 4.4.0
* @access protected
* @var string
*/
protected $preview_url;
/**
* URL to link the user to when closing the Customizer.
*
* @since 4.4.0
* @access protected
* @var string
*/
protected $return_url;
/**
* Mapping of 'panel', 'section', 'control' to the ID which should be autofocused.
*
* @since 4.4.0
* @access protected
* @var array
*/
protected $autofocus = array();
/**
* Messenger channel.
*
* @since 4.7.0
* @access protected
* @var string
*/
protected $messenger_channel;
/**
* Unsanitized values for Customize Settings parsed from $_POST['customized'].
*
* @var array
*/
private $_post_values;
/**
* Changeset UUID.
*
* @since 4.7.0
* @access private
* @var string
*/
private $_changeset_uuid;
/**
* Changeset post ID.
*
* @since 4.7.0
* @access private
* @var int|false
*/
private $_changeset_post_id;
/**
* Changeset data loaded from a customize_changeset post.
*
* @since 4.7.0
* @access private
* @var array
*/
private $_changeset_data;
/**
* Constructor.
*
* @since 3.4.0
* @since 4.7.0 Added $args param.
*
* @param array $args {
* Args.
*
* @type string $changeset_uuid Changeset UUID, the post_name for the customize_changeset post containing the customized state. Defaults to new UUID.
* @type string $theme Theme to be previewed (for theme switch). Defaults to customize_theme or theme query params.
* @type string $messenger_channel Messenger channel. Defaults to customize_messenger_channel query param.
* }
*/
public function __construct( $args = array() ) {
$args = array_merge(
array_fill_keys( array( 'changeset_uuid', 'theme', 'messenger_channel' ), null ),
$args
);
// Note that the UUID format will be validated in the setup_theme() method.
if ( ! isset( $args['changeset_uuid'] ) ) {
$args['changeset_uuid'] = wp_generate_uuid4();
}
// The theme and messenger_channel should be supplied via $args, but they are also looked at in the $_REQUEST global here for back-compat.
if ( ! isset( $args['theme'] ) ) {
if ( isset( $_REQUEST['customize_theme'] ) ) {
$args['theme'] = wp_unslash( $_REQUEST['customize_theme'] );
} elseif ( isset( $_REQUEST['theme'] ) ) { // Deprecated.
$args['theme'] = wp_unslash( $_REQUEST['theme'] );
}
}
if ( ! isset( $args['messenger_channel'] ) && isset( $_REQUEST['customize_messenger_channel'] ) ) {
$args['messenger_channel'] = sanitize_key( wp_unslash( $_REQUEST['customize_messenger_channel'] ) );
}
$this->original_stylesheet = get_stylesheet();
$this->theme = wp_get_theme( $args['theme'] );
$this->messenger_channel = $args['messenger_channel'];
$this->_changeset_uuid = $args['changeset_uuid'];
require_once( ABSPATH . WPINC . '/class-wp-customize-setting.php' );
require_once( ABSPATH . WPINC . '/class-wp-customize-panel.php' );
require_once( ABSPATH . WPINC . '/class-wp-customize-section.php' );
require_once( ABSPATH . WPINC . '/class-wp-customize-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-control.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-section.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-custom-css-setting.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' );
/**
* Filters the core Customizer components to load.
*
* This allows Core components to be excluded from being instantiated by
* filtering them out of the array. Note that this filter generally runs
* during the {@see 'plugins_loaded'} action, so it cannot be added
* in a theme.
*
* @since 4.4.0
*
* @see WP_Customize_Manager::__construct()
*
* @param array $components List of core components to load.
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
$components = apply_filters( 'customize_loaded_components', $this->components, $this );
require_once( ABSPATH . WPINC . '/customize/class-wp-customize-selective-refresh.php' );
$this->selective_refresh = new WP_Customize_Selective_Refresh( $this );
if ( in_array( 'widgets', $components, true ) ) {
require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' );
$this->widgets = new WP_Customize_Widgets( $this );
}
if ( in_array( 'nav_menus', $components, true ) ) {
require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' );
$this->nav_menus = new WP_Customize_Nav_Menus( $this );
}
add_action( 'setup_theme', array( $this, 'setup_theme' ) );
add_action( 'wp_loaded', array( $this, 'wp_loaded' ) );
// Do not spawn cron (especially the alternate cron) while running the Customizer.
remove_action( 'init', 'wp_cron' );
// Do not run update checks when rendering the controls.
remove_action( 'admin_init', '_maybe_update_core' );
remove_action( 'admin_init', '_maybe_update_plugins' );
remove_action( 'admin_init', '_maybe_update_themes' );
add_action( 'wp_ajax_customize_save', array( $this, 'save' ) );
add_action( 'wp_ajax_customize_refresh_nonces', array( $this, 'refresh_nonces' ) );
add_action( 'customize_register', array( $this, 'register_controls' ) );
add_action( 'customize_register', array( $this, 'register_dynamic_settings' ), 11 ); // allow code to create settings first
add_action( 'customize_controls_init', array( $this, 'prepare_controls' ) );
add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) );
// Render Panel, Section, and Control templates.
add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_panel_templates' ), 1 );
add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_section_templates' ), 1 );
add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_control_templates' ), 1 );
// Export header video settings with the partial response.
add_filter( 'customize_render_partials_response', array( $this, 'export_header_video_settings' ), 10, 3 );
// Export the settings to JS via the _wpCustomizeSettings variable.
add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_pane_settings' ), 1000 );
}
/**
* Return true if it's an Ajax request.
*
* @since 3.4.0
* @since 4.2.0 Added `$action` param.
* @access public
*
* @param string|null $action Whether the supplied Ajax action is being run.
* @return bool True if it's an Ajax request, false otherwise.
*/
public function doing_ajax( $action = null ) {
if ( ! wp_doing_ajax() ) {
return false;
}
if ( ! $action ) {
return true;
} else {
/*
* Note: we can't just use doing_action( "wp_ajax_{$action}" ) because we need
* to check before admin-ajax.php gets to that point.
*/
return isset( $_REQUEST['action'] ) && wp_unslash( $_REQUEST['action'] ) === $action;
}
}
/**
* Custom wp_die wrapper. Returns either the standard message for UI
* or the Ajax message.
*
* @since 3.4.0
*
* @param mixed $ajax_message Ajax return
* @param mixed $message UI message
*/
protected function wp_die( $ajax_message, $message = null ) {
if ( $this->doing_ajax() ) {
wp_die( $ajax_message );
}
if ( ! $message ) {
$message = __( 'Cheatin’ uh?' );
}
if ( $this->messenger_channel ) {
ob_start();
wp_enqueue_scripts();
wp_print_scripts( array( 'customize-base' ) );
$settings = array(
'messengerArgs' => array(
'channel' => $this->messenger_channel,
'url' => wp_customize_url(),
),
'error' => $ajax_message,
);
?>
<script>
( function( api, settings ) {
var preview = new api.Messenger( settings.messengerArgs );
preview.send( 'iframe-loading-error', settings.error );
} )( wp.customize, <?php echo wp_json_encode( $settings ) ?> );
</script>
<?php
$message .= ob_get_clean();
}
wp_die( $message );
}
/**
* Return the Ajax wp_die() handler if it's a customized request.
*
* @since 3.4.0
* @deprecated 4.7.0
*
* @return callable Die handler.
*/
public function wp_die_handler() {
_deprecated_function( __METHOD__, '4.7.0' );
if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) {
return '_ajax_wp_die_handler';
}
return '_default_wp_die_handler';
}
/**
* Start preview and customize theme.
*
* Check if customize query variable exist. Init filters to filter the current theme.
*
* @since 3.4.0
*
* @global string $pagenow
*/
public function setup_theme() {
global $pagenow;
// Check permissions for customize.php access since this method is called before customize.php can run any code,
if ( 'customize.php' === $pagenow && ! current_user_can( 'customize' ) ) {
if ( ! is_user_logged_in() ) {
auth_redirect();
} else {
wp_die(
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',
403
);
}
return;
}
if ( ! preg_match( '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $this->_changeset_uuid ) ) {
$this->wp_die( -1, __( 'Invalid changeset UUID' ) );
}
/*
* Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer
* application will inject the customize_preview_nonce query parameter into all Ajax requests.
* For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out
* a user when a valid nonce isn't present.
*/
$has_post_data_nonce = (
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false )
||
check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false )
||
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false )
);
if ( ! current_user_can( 'customize' ) || ! $has_post_data_nonce ) {
unset( $_POST['customized'] );
unset( $_REQUEST['customized'] );
}
/*
* If unauthenticated then require a valid changeset UUID to load the preview.
* In this way, the UUID serves as a secret key. If the messenger channel is present,
* then send unauthenticated code to prompt re-auth.
*/
if ( ! current_user_can( 'customize' ) && ! $this->changeset_post_id() ) {
$this->wp_die( $this->messenger_channel ? 0 : -1, __( 'Non-existent changeset UUID.' ) );
}
if ( ! headers_sent() ) {
send_origin_headers();
}
// Hide the admin bar if we're embedded in the customizer iframe.
if ( $this->messenger_channel ) {
show_admin_bar( false );
}
if ( $this->is_theme_active() ) {
// Once the theme is loaded, we'll validate it.
add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
} else {
// If the requested theme is not the active theme and the user doesn't have the
// switch_themes cap, bail.
if ( ! current_user_can( 'switch_themes' ) ) {
$this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
}
// If the theme has errors while loading, bail.
if ( $this->theme()->errors() ) {
$this->wp_die( -1, $this->theme()->errors()->get_error_message() );
}
// If the theme isn't allowed per multisite settings, bail.
if ( ! $this->theme()->is_allowed() ) {
$this->wp_die( -1, __( 'The requested theme does not exist.' ) );
}
}
/*
* Import theme starter content for fresh installs when landing in the customizer.
* Import starter content at after_setup_theme:100 so that any
* add_theme_support( 'starter-content' ) calls will have been made.
*/
if ( get_option( 'fresh_site' ) && 'customize.php' === $pagenow ) {
add_action( 'after_setup_theme', array( $this, 'import_theme_starter_content' ), 100 );
}
$this->start_previewing_theme();
}
/**
* Callback to validate a theme once it is loaded
*
* @since 3.4.0
*/
public function after_setup_theme() {
$doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_POST['customized'] ) );
if ( ! $doing_ajax_or_is_customized && ! validate_current_theme() ) {
wp_redirect( 'themes.php?broken=true' );
exit;
}
}
/**
* If the theme to be previewed isn't the active theme, add filter callbacks
* to swap it out at runtime.
*
* @since 3.4.0
*/
public function start_previewing_theme() {
// Bail if we're already previewing.
if ( $this->is_preview() ) {
return;
}
$this->previewing = true;
if ( ! $this->is_theme_active() ) {
add_filter( 'template', array( $this, 'get_template' ) );
add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
// @link: https://core.trac.wordpress.org/ticket/20027
add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
add_filter( 'pre_option_template', array( $this, 'get_template' ) );
// Handle custom theme roots.
add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
}
/**
* Fires once the Customizer theme preview has started.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
do_action( 'start_previewing_theme', $this );
}
/**
* Stop previewing the selected theme.
*
* Removes filters to change the current theme.
*
* @since 3.4.0
*/
public function stop_previewing_theme() {
if ( ! $this->is_preview() ) {
return;
}
$this->previewing = false;
if ( ! $this->is_theme_active() ) {
remove_filter( 'template', array( $this, 'get_template' ) );
remove_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
remove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
// @link: https://core.trac.wordpress.org/ticket/20027
remove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
// Handle custom theme roots.
remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
}
/**
* Fires once the Customizer theme preview has stopped.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
do_action( 'stop_previewing_theme', $this );
}
/**
* Get the changeset UUID.
*
* @since 4.7.0
* @access public
*
* @return string UUID.
*/
public function changeset_uuid() {
return $this->_changeset_uuid;
}
/**
* Get the theme being customized.
*
* @since 3.4.0
*
* @return WP_Theme
*/
public function theme() {
if ( ! $this->theme ) {
$this->theme = wp_get_theme();
}
return $this->theme;
}
/**
* Get the registered settings.
*
* @since 3.4.0
*
* @return array
*/
public function settings() {
return $this->settings;
}
/**
* Get the registered controls.
*
* @since 3.4.0
*
* @return array
*/
public function controls() {
return $this->controls;
}
/**
* Get the registered containers.
*
* @since 4.0.0
*
* @return array
*/
public function containers() {
return $this->containers;
}
/**
* Get the registered sections.
*
* @since 3.4.0
*
* @return array
*/
public function sections() {
return $this->sections;
}
/**
* Get the registered panels.
*
* @since 4.0.0
* @access public
*
* @return array Panels.
*/
public function panels() {
return $this->panels;
}
/**
* Checks if the current theme is active.
*
* @since 3.4.0
*
* @return bool
*/
public function is_theme_active() {
return $this->get_stylesheet() == $this->original_stylesheet;
}
/**
* Register styles/scripts and initialize the preview of each setting
*
* @since 3.4.0
*/
public function wp_loaded() {
/**
* Fires once WordPress has loaded, allowing scripts and styles to be initialized.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
do_action( 'customize_register', $this );
/*
* Note that settings must be previewed here even outside the customizer preview
* and also in the customizer pane itself. This is to enable loading an existing
* changeset into the customizer. Previewing the settings only has to be prevented
* in the case of a customize_save action because then update_option()
* may short-circuit because it will detect that there are no changes to
* make.
*/
if ( ! $this->doing_ajax( 'customize_save' ) ) {
foreach ( $this->settings as $setting ) {
$setting->preview();
}
}
if ( $this->is_preview() && ! is_admin() ) {
$this->customize_preview_init();
}
}
/**
* Prevents Ajax requests from following redirects when previewing a theme
* by issuing a 200 response instead of a 30x.
*
* Instead, the JS will sniff out the location header.
*
* @since 3.4.0
* @deprecated 4.7.0
*
* @param int $status Status.
* @return int
*/
public function wp_redirect_status( $status ) {
_deprecated_function( __FUNCTION__, '4.7.0' );
if ( $this->is_preview() && ! is_admin() ) {
return 200;
}
return $status;
}
/**
* Find the changeset post ID for a given changeset UUID.
*
* @since 4.7.0
* @access public
*
* @param string $uuid Changeset UUID.
* @return int|null Returns post ID on success and null on failure.
*/
public function find_changeset_post_id( $uuid ) {
$cache_group = 'customize_changeset_post';
$changeset_post_id = wp_cache_get( $uuid, $cache_group );
if ( $changeset_post_id && 'customize_changeset' === get_post_type( $changeset_post_id ) ) {
return $changeset_post_id;
}
$changeset_post_query = new WP_Query( array(
'post_type' => 'customize_changeset',
'post_status' => get_post_stati(),
'name' => $uuid,
'posts_per_page' => 1,
'no_found_rows' => true,
'cache_results' => true,
'update_post_meta_cache' => false,
'update_post_term_cache' => false,
'lazy_load_term_meta' => false,
) );
if ( ! empty( $changeset_post_query->posts ) ) {
// Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed.
$changeset_post_id = $changeset_post_query->posts[0]->ID;
wp_cache_set( $this->_changeset_uuid, $changeset_post_id, $cache_group );
return $changeset_post_id;
}
return null;
}
/**
* Get the changeset post id for the loaded changeset.
*
* @since 4.7.0
* @access public
*
* @return int|null Post ID on success or null if there is no post yet saved.
*/
public function changeset_post_id() {
if ( ! isset( $this->_changeset_post_id ) ) {
$post_id = $this->find_changeset_post_id( $this->_changeset_uuid );
if ( ! $post_id ) {
$post_id = false;
}
$this->_changeset_post_id = $post_id;
}
if ( false === $this->_changeset_post_id ) {
return null;
}
return $this->_changeset_post_id;
}
/**
* Get the data stored in a changeset post.
*
* @since 4.7.0
* @access protected
*
* @param int $post_id Changeset post ID.
* @return array|WP_Error Changeset data or WP_Error on error.
*/
protected function get_changeset_post_data( $post_id ) {
if ( ! $post_id ) {
return new WP_Error( 'empty_post_id' );
}
$changeset_post = get_post( $post_id );
if ( ! $changeset_post ) {
return new WP_Error( 'missing_post' );
}
if ( 'customize_changeset' !== $changeset_post->post_type ) {
return new WP_Error( 'wrong_post_type' );
}
$changeset_data = json_decode( $changeset_post->post_content, true );
if ( function_exists( 'json_last_error' ) && json_last_error() ) {
return new WP_Error( 'json_parse_error', '', json_last_error() );
}
if ( ! is_array( $changeset_data ) ) {
return new WP_Error( 'expected_array' );
}
return $changeset_data;
}
/**
* Get changeset data.
*
* @since 4.7.0
* @access public
*
* @return array Changeset data.
*/
public function changeset_data() {
if ( isset( $this->_changeset_data ) ) {
return $this->_changeset_data;
}
$changeset_post_id = $this->changeset_post_id();
if ( ! $changeset_post_id ) {
$this->_changeset_data = array();
} else {
$data = $this->get_changeset_post_data( $changeset_post_id );
if ( ! is_wp_error( $data ) ) {
$this->_changeset_data = $data;
} else {
$this->_changeset_data = array();
}
}
return $this->_changeset_data;
}
/**
* Starter content setting IDs.
*
* @since 4.7.0
* @access private
* @var array
*/
protected $pending_starter_content_settings_ids = array();
/**
* Import theme starter content into the customized state.
*
* @since 4.7.0
* @access public
*
* @param array $starter_content Starter content. Defaults to `get_theme_starter_content()`.
*/
function import_theme_starter_content( $starter_content = array() ) {
if ( empty( $starter_content ) ) {
$starter_content = get_theme_starter_content();
}
$changeset_data = array();
if ( $this->changeset_post_id() ) {
$changeset_data = $this->get_changeset_post_data( $this->changeset_post_id() );
}
$sidebars_widgets = isset( $starter_content['widgets'] ) && ! empty( $this->widgets ) ? $starter_content['widgets'] : array();
$attachments = isset( $starter_content['attachments'] ) && ! empty( $this->nav_menus ) ? $starter_content['attachments'] : array();
$posts = isset( $starter_content['posts'] ) && ! empty( $this->nav_menus ) ? $starter_content['posts'] : array();
$options = isset( $starter_content['options'] ) ? $starter_content['options'] : array();
$nav_menus = isset( $starter_content['nav_menus'] ) && ! empty( $this->nav_menus ) ? $starter_content['nav_menus'] : array();
$theme_mods = isset( $starter_content['theme_mods'] ) ? $starter_content['theme_mods'] : array();
// Widgets.
$max_widget_numbers = array();
foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
$sidebar_widget_ids = array();
foreach ( $widgets as $widget ) {
list( $id_base, $instance ) = $widget;
if ( ! isset( $max_widget_numbers[ $id_base ] ) ) {
// When $settings is an array-like object, get an intrinsic array for use with array_keys().
$settings = get_option( "widget_{$id_base}", array() );
if ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) {
$settings = $settings->getArrayCopy();
}
// Find the max widget number for this type.
$widget_numbers = array_keys( $settings );
if ( count( $widget_numbers ) > 0 ) {
$widget_numbers[] = 1;
$max_widget_numbers[ $id_base ] = call_user_func_array( 'max', $widget_numbers );
} else {
$max_widget_numbers[ $id_base ] = 1;
}
}
$max_widget_numbers[ $id_base ] += 1;
$widget_id = sprintf( '%s-%d', $id_base, $max_widget_numbers[ $id_base ] );
$setting_id = sprintf( 'widget_%s[%d]', $id_base, $max_widget_numbers[ $id_base ] );
$setting_value = $this->widgets->sanitize_widget_js_instance( $instance );
if ( empty( $changeset_data[ $setting_id ] ) || ! empty( $changeset_data[ $setting_id ]['starter_content'] ) ) {
$this->set_post_value( $setting_id, $setting_value );
$this->pending_starter_content_settings_ids[] = $setting_id;
}
$sidebar_widget_ids[] = $widget_id;
}
$setting_id = sprintf( 'sidebars_widgets[%s]', $sidebar_id );
if ( empty( $changeset_data[ $setting_id ] ) || ! empty( $changeset_data[ $setting_id ]['starter_content'] ) ) {
$this->set_post_value( $setting_id, $sidebar_widget_ids );
$this->pending_starter_content_settings_ids[] = $setting_id;
}
}
$starter_content_auto_draft_post_ids = array();
if ( ! empty( $changeset_data['nav_menus_created_posts']['value'] ) ) {
$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, $changeset_data['nav_menus_created_posts']['value'] );
}
// Make an index of all the posts needed and what their slugs are.
$needed_posts = array();
$attachments = $this->prepare_starter_content_attachments( $attachments );
foreach ( $attachments as $attachment ) {
$key = 'attachment:' . $attachment['post_name'];
$needed_posts[ $key ] = true;
}
foreach ( array_keys( $posts ) as $post_symbol ) {
if ( empty( $posts[ $post_symbol ]['post_name'] ) && empty( $posts[ $post_symbol ]['post_title'] ) ) {
unset( $posts[ $post_symbol ] );
continue;
}
if ( empty( $posts[ $post_symbol ]['post_name'] ) ) {
$posts[ $post_symbol ]['post_name'] = sanitize_title( $posts[ $post_symbol ]['post_title'] );
}
if ( empty( $posts[ $post_symbol ]['post_type'] ) ) {
$posts[ $post_symbol ]['post_type'] = 'post';
}
$needed_posts[ $posts[ $post_symbol ]['post_type'] . ':' . $posts[ $post_symbol ]['post_name'] ] = true;
}
$all_post_slugs = array_merge(
wp_list_pluck( $attachments, 'post_name' ),
wp_list_pluck( $posts, 'post_name' )
);
/*
* Obtain all post types referenced in starter content to use in query.
* This is needed because 'any' will not account for post types not yet registered.
*/
$post_types = array_filter( array_merge( array( 'attachment' ), wp_list_pluck( $posts, 'post_type' ) ) );
// Re-use auto-draft starter content posts referenced in the current customized state.
$existing_starter_content_posts = array();
if ( ! empty( $starter_content_auto_draft_post_ids ) ) {
$existing_posts_query = new WP_Query( array(
'post__in' => $starter_content_auto_draft_post_ids,
'post_status' => 'auto-draft',
'post_type' => $post_types,
'posts_per_page' => -1,
) );
foreach ( $existing_posts_query->posts as $existing_post ) {
$post_name = $existing_post->post_name;
if ( empty( $post_name ) ) {
$post_name = get_post_meta( $existing_post->ID, '_customize_draft_post_name', true );
}
$existing_starter_content_posts[ $existing_post->post_type . ':' . $post_name ] = $existing_post;
}
}
// Re-use non-auto-draft posts.
if ( ! empty( $all_post_slugs ) ) {
$existing_posts_query = new WP_Query( array(
'post_name__in' => $all_post_slugs,
'post_status' => array_diff( get_post_stati(), array( 'auto-draft' ) ),
'post_type' => 'any',
'posts_per_page' => -1,
) );
foreach ( $existing_posts_query->posts as $existing_post ) {
$key = $existing_post->post_type . ':' . $existing_post->post_name;
if ( isset( $needed_posts[ $key ] ) && ! isset( $existing_starter_content_posts[ $key ] ) ) {
$existing_starter_content_posts[ $key ] = $existing_post;
}
}
}
// Attachments are technically posts but handled differently.
if ( ! empty( $attachments ) ) {
$attachment_ids = array();
foreach ( $attachments as $symbol => $attachment ) {
$file_array = array(
'name' => $attachment['file_name'],
);
$file_path = $attachment['file_path'];
$attachment_id = null;
$attached_file = null;
if ( isset( $existing_starter_content_posts[ 'attachment:' . $attachment['post_name'] ] ) ) {
$attachment_post = $existing_starter_content_posts[ 'attachment:' . $attachment['post_name'] ];
$attachment_id = $attachment_post->ID;
$attached_file = get_attached_file( $attachment_id );
if ( empty( $attached_file ) || ! file_exists( $attached_file ) ) {
$attachment_id = null;
$attached_file = null;
} elseif ( $this->get_stylesheet() !== get_post_meta( $attachment_post->ID, '_starter_content_theme', true ) ) {
// Re-generate attachment metadata since it was previously generated for a different theme.
$metadata = wp_generate_attachment_metadata( $attachment_post->ID, $attached_file );
wp_update_attachment_metadata( $attachment_id, $metadata );
update_post_meta( $attachment_id, '_starter_content_theme', $this->get_stylesheet() );
}
}
// Insert the attachment auto-draft because it doesn't yet exist or the attached file is gone.
if ( ! $attachment_id ) {
// Copy file to temp location so that original file won't get deleted from theme after sideloading.
$temp_file_name = wp_tempnam( basename( $file_path ) );
if ( $temp_file_name && copy( $file_path, $temp_file_name ) ) {
$file_array['tmp_name'] = $temp_file_name;
}
if ( empty( $file_array['tmp_name'] ) ) {
continue;
}
$attachment_post_data = array_merge(
wp_array_slice_assoc( $attachment, array( 'post_title', 'post_content', 'post_excerpt' ) ),
array(
'post_status' => 'auto-draft', // So attachment will be garbage collected in a week if changeset is never published.
)
);
// In PHP < 5.6 filesize() returns 0 for the temp files unless we clear the file status cache.
// Technically, PHP < 5.6.0 || < 5.5.13 || < 5.4.29 but no need to be so targeted.
// See https://bugs.php.net/bug.php?id=65701
if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
clearstatcache();
}
$attachment_id = media_handle_sideload( $file_array, 0, null, $attachment_post_data );
if ( is_wp_error( $attachment_id ) ) {
continue;
}
update_post_meta( $attachment_id, '_starter_content_theme', $this->get_stylesheet() );
update_post_meta( $attachment_id, '_customize_draft_post_name', $attachment['post_name'] );
}
$attachment_ids[ $symbol ] = $attachment_id;
}
$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, array_values( $attachment_ids ) );
}
// Posts & pages.
if ( ! empty( $posts ) ) {
foreach ( array_keys( $posts ) as $post_symbol ) {
if ( empty( $posts[ $post_symbol ]['post_type'] ) || empty( $posts[ $post_symbol ]['post_name'] ) ) {
continue;
}
$post_type = $posts[ $post_symbol ]['post_type'];
if ( ! empty( $posts[ $post_symbol ]['post_name'] ) ) {
$post_name = $posts[ $post_symbol ]['post_name'];
} elseif ( ! empty( $posts[ $post_symbol ]['post_title'] ) ) {
$post_name = sanitize_title( $posts[ $post_symbol ]['post_title'] );
} else {
continue;
}
// Use existing auto-draft post if one already exists with the same type and name.
if ( isset( $existing_starter_content_posts[ $post_type . ':' . $post_name ] ) ) {
$posts[ $post_symbol ]['ID'] = $existing_starter_content_posts[ $post_type . ':' . $post_name ]->ID;
continue;
}
// Translate the featured image symbol.
if ( ! empty( $posts[ $post_symbol ]['thumbnail'] )
&& preg_match( '/^{{(?P<symbol>.+)}}$/', $posts[ $post_symbol ]['thumbnail'], $matches )
&& isset( $attachment_ids[ $matches['symbol'] ] ) ) {
$posts[ $post_symbol ]['meta_input']['_thumbnail_id'] = $attachment_ids[ $matches['symbol'] ];
}
if ( ! empty( $posts[ $post_symbol ]['template'] ) ) {
$posts[ $post_symbol ]['meta_input']['_wp_page_template'] = $posts[ $post_symbol ]['template'];
}
$r = $this->nav_menus->insert_auto_draft_post( $posts[ $post_symbol ] );
if ( $r instanceof WP_Post ) {
$posts[ $post_symbol ]['ID'] = $r->ID;
}
}
$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, wp_list_pluck( $posts, 'ID' ) );
}
// The nav_menus_created_posts setting is why nav_menus component is dependency for adding posts.
if ( ! empty( $this->nav_menus ) && ! empty( $starter_content_auto_draft_post_ids ) ) {
$setting_id = 'nav_menus_created_posts';
$this->set_post_value( $setting_id, array_unique( array_values( $starter_content_auto_draft_post_ids ) ) );
$this->pending_starter_content_settings_ids[] = $setting_id;
}
// Nav menus.
$placeholder_id = -1;
$reused_nav_menu_setting_ids = array();
foreach ( $nav_menus as $nav_menu_location => $nav_menu ) {
$nav_menu_term_id = null;
$nav_menu_setting_id = null;
$matches = array();
// Look for an existing placeholder menu with starter content to re-use.
foreach ( $changeset_data as $setting_id => $setting_params ) {
$can_reuse = (
! empty( $setting_params['starter_content'] )
&&
! in_array( $setting_id, $reused_nav_menu_setting_ids, true )
&&
preg_match( '#^nav_menu\[(?P<nav_menu_id>-?\d+)\]$#', $setting_id, $matches )
);
if ( $can_reuse ) {
$nav_menu_term_id = intval( $matches['nav_menu_id'] );
$nav_menu_setting_id = $setting_id;
$reused_nav_menu_setting_ids[] = $setting_id;
break;
}
}
if ( ! $nav_menu_term_id ) {
while ( isset( $changeset_data[ sprintf( 'nav_menu[%d]', $placeholder_id ) ] ) ) {
$placeholder_id--;
}
$nav_menu_term_id = $placeholder_id;
$nav_menu_setting_id = sprintf( 'nav_menu[%d]', $placeholder_id );
}
$this->set_post_value( $nav_menu_setting_id, array(
'name' => isset( $nav_menu['name'] ) ? $nav_menu['name'] : $nav_menu_location,
) );
$this->pending_starter_content_settings_ids[] = $nav_menu_setting_id;
// @todo Add support for menu_item_parent.
$position = 0;
foreach ( $nav_menu['items'] as $nav_menu_item ) {
$nav_menu_item_setting_id = sprintf( 'nav_menu_item[%d]', $placeholder_id-- );
if ( ! isset( $nav_menu_item['position'] ) ) {
$nav_menu_item['position'] = $position++;
}
$nav_menu_item['nav_menu_term_id'] = $nav_menu_term_id;
if ( isset( $nav_menu_item['object_id'] ) ) {
if ( 'post_type' === $nav_menu_item['type'] && preg_match( '/^{{(?P<symbol>.+)}}$/', $nav_menu_item['object_id'], $matches ) && isset( $posts[ $matches['symbol'] ] ) ) {
$nav_menu_item['object_id'] = $posts[ $matches['symbol'] ]['ID'];
if ( empty( $nav_menu_item['title'] ) ) {
$original_object = get_post( $nav_menu_item['object_id'] );
$nav_menu_item['title'] = $original_object->post_title;
}
} else {
continue;
}
} else {
$nav_menu_item['object_id'] = 0;
}
if ( empty( $changeset_data[ $nav_menu_item_setting_id ] ) || ! empty( $changeset_data[ $nav_menu_item_setting_id ]['starter_content'] ) ) {
$this->set_post_value( $nav_menu_item_setting_id, $nav_menu_item );
$this->pending_starter_content_settings_ids[] = $nav_menu_item_setting_id;
}
}
$setting_id = sprintf( 'nav_menu_locations[%s]', $nav_menu_location );
if ( empty( $changeset_data[ $setting_id ] ) || ! empty( $changeset_data[ $setting_id ]['starter_content'] ) ) {
$this->set_post_value( $setting_id, $nav_menu_term_id );
$this->pending_starter_content_settings_ids[] = $setting_id;
}
}
// Options.
foreach ( $options as $name => $value ) {
if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {
if ( isset( $posts[ $matches['symbol'] ] ) ) {
$value = $posts[ $matches['symbol'] ]['ID'];
} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {
$value = $attachment_ids[ $matches['symbol'] ];
} else {
continue;
}
}
if ( empty( $changeset_data[ $name ] ) || ! empty( $changeset_data[ $name ]['starter_content'] ) ) {
$this->set_post_value( $name, $value );
$this->pending_starter_content_settings_ids[] = $name;
}
}
// Theme mods.
foreach ( $theme_mods as $name => $value ) {
if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {
if ( isset( $posts[ $matches['symbol'] ] ) ) {
$value = $posts[ $matches['symbol'] ]['ID'];
} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {
$value = $attachment_ids[ $matches['symbol'] ];
} else {
continue;
}
}
// Handle header image as special case since setting has a legacy format.
if ( 'header_image' === $name ) {
$name = 'header_image_data';
$metadata = wp_get_attachment_metadata( $value );
if ( empty( $metadata ) ) {
continue;
}
$value = array(
'attachment_id' => $value,
'url' => wp_get_attachment_url( $value ),
'height' => $metadata['height'],
'width' => $metadata['width'],
);
} elseif ( 'background_image' === $name ) {
$value = wp_get_attachment_url( $value );
}
if ( empty( $changeset_data[ $name ] ) || ! empty( $changeset_data[ $name ]['starter_content'] ) ) {
$this->set_post_value( $name, $value );
$this->pending_starter_content_settings_ids[] = $name;
}
}
if ( ! empty( $this->pending_starter_content_settings_ids ) ) {
if ( did_action( 'customize_register' ) ) {
$this->_save_starter_content_changeset();
} else {
add_action( 'customize_register', array( $this, '_save_starter_content_changeset' ), 1000 );
}
}
}
/**
* Prepare starter content attachments.
*
* Ensure that the attachments are valid and that they have slugs and file name/path.
*
* @since 4.7.0
* @access private
*
* @param array $attachments Attachments.
* @return array Prepared attachments.
*/
protected function prepare_starter_content_attachments( $attachments ) {
$prepared_attachments = array();
if ( empty( $attachments ) ) {
return $prepared_attachments;
}
// Such is The WordPress Way.
require_once( ABSPATH . 'wp-admin/includes/file.php' );
require_once( ABSPATH . 'wp-admin/includes/media.php' );
require_once( ABSPATH . 'wp-admin/includes/image.php' );
foreach ( $attachments as $symbol => $attachment ) {
// A file is required and URLs to files are not currently allowed.
if ( empty( $attachment['file'] ) || preg_match( '#^https?://$#', $attachment['file'] ) ) {
continue;
}
$file_path = null;
if ( file_exists( $attachment['file'] ) ) {
$file_path = $attachment['file']; // Could be absolute path to file in plugin.
} elseif ( is_child_theme() && file_exists( get_stylesheet_directory() . '/' . $attachment['file'] ) ) {
$file_path = get_stylesheet_directory() . '/' . $attachment['file'];
} elseif ( file_exists( get_template_directory() . '/' . $attachment['file'] ) ) {
$file_path = get_template_directory() . '/' . $attachment['file'];
} else {
continue;
}
$file_name = basename( $attachment['file'] );
// Skip file types that are not recognized.
$checked_filetype = wp_check_filetype( $file_name );
if ( empty( $checked_filetype['type'] ) ) {
continue;
}
// Ensure post_name is set since not automatically derived from post_title for new auto-draft posts.
if ( empty( $attachment['post_name'] ) ) {
if ( ! empty( $attachment['post_title'] ) ) {
$attachment['post_name'] = sanitize_title( $attachment['post_title'] );
} else {
$attachment['post_name'] = sanitize_title( preg_replace( '/\.\w+$/', '', $file_name ) );
}
}
$attachment['file_name'] = $file_name;
$attachment['file_path'] = $file_path;
$prepared_attachments[ $symbol ] = $attachment;
}
return $prepared_attachments;
}
/**
* Save starter content changeset.
*
* @since 4.7.0
* @access private
*/
public function _save_starter_content_changeset() {
if ( empty( $this->pending_starter_content_settings_ids ) ) {
return;
}
$this->save_changeset_post( array(
'data' => array_fill_keys( $this->pending_starter_content_settings_ids, array( 'starter_content' => true ) ),
'starter_content' => true,
) );
$this->pending_starter_content_settings_ids = array();
}
/**
* Get dirty pre-sanitized setting values in the current customized state.
*
* The returned array consists of a merge of three 源代码s:
* 1. If the theme is not currently active, then the base array is any stashed
* theme mods that were modified previously but never published.
* 2. The values from the current changeset, if it exists.
* 3. If the user can customize, the values parsed from the incoming
* `$_POST['customized']` JSON data.
* 4. Any programmatically-set post values via `WP_Customize_Manager::set_post_value()`.
*
* The name "unsanitized_post_values" is a carry-over from when the customized
* state was exclusively 源代码d from `$_POST['customized']`. Nevertheless,
* the value returned will come from the current changeset post and from the
* incoming post data.
*
* @since 4.1.1
* @since 4.7.0 Added $args param and merging with changeset values and stashed theme mods.
*
* @param array $args {
* Args.
*
* @type bool $exclude_changeset Whether the changeset values should also be excluded. Defaults to false.
* @type bool $exclude_post_data Whether the post input values should also be excluded. Defaults to false when lacking the customize capability.
* }
* @return array
*/
public function unsanitized_post_values( $args = array() ) {
$args = array_merge(
array(
'exclude_changeset' => false,
'exclude_post_data' => ! current_user_can( 'customize' ),
),
$args
);
$values = array();
// Let default values be from the stashed theme mods if doing a theme switch and if no changeset is present.
if ( ! $this->is_theme_active() ) {
$stashed_theme_mods = get_option( 'customize_stashed_theme_mods' );
$stylesheet = $this->get_stylesheet();
if ( isset( $stashed_theme_mods[ $stylesheet ] ) ) {
$values = array_merge( $values, wp_list_pluck( $stashed_theme_mods[ $stylesheet ], 'value' ) );
}
}
if ( ! $args['exclude_changeset'] ) {
foreach ( $this->changeset_data() as $setting_id => $setting_params ) {
if ( ! array_key_exists( 'value', $setting_params ) ) {
continue;
}
if ( isset( $setting_params['type'] ) && 'theme_mod' === $setting_params['type'] ) {
// Ensure that theme mods values are only used if they were saved under the current theme.
$namespace_pattern = '/^(?P<stylesheet>.+?)::(?P<setting_id>.+)$/';
if ( preg_match( $namespace_pattern, $setting_id, $matches ) && $this->get_stylesheet() === $matches['stylesheet'] ) {
$values[ $matches['setting_id'] ] = $setting_params['value'];
}
} else {
$values[ $setting_id ] = $setting_params['value'];
}
}
}
if ( ! $args['exclude_post_data'] ) {
if ( ! isset( $this->_post_values ) ) {
if ( isset( $_POST['customized'] ) ) {
$post_values = json_decode( wp_unslash( $_POST['customized'] ), true );
} else {
$post_values = array();
}
if ( is_array( $post_values ) ) {
$this->_post_values = $post_values;
} else {
$this->_post_values = array();
}
}
$values = array_merge( $values, $this->_post_values );
}
return $values;
}
/**
* Returns the sanitized value for a given setting from the current customized state.
*
* The name "post_value" is a carry-over from when the customized state was exclusively
* 源代码d from `$_POST['customized']`. Nevertheless, the value returned will come
* from the current changeset post and from the incoming post data.
*
* @since 3.4.0
* @since 4.1.1 Introduced the `$default` parameter.
* @since 4.6.0 `$default` is now returned early when the setting post value is invalid.
* @access public
*
* @see WP_REST_Server::dispatch()
* @see WP_Rest_Request::sanitize_params()
* @see WP_Rest_Request::has_valid_params()
*
* @param WP_Customize_Setting $setting A WP_Customize_Setting derived object.
* @param mixed $default Value returned $setting has no post value (added in 4.2.0)
* or the post value is invalid (added in 4.6.0).
* @return string|mixed $post_value Sanitized value or the $default provided.
*/
public function post_value( $setting, $default = null ) {
$post_values = $this->unsanitized_post_values();
if ( ! array_key_exists( $setting->id, $post_values ) ) {
return $default;
}
$value = $post_values[ $setting->id ];
$valid = $setting->validate( $value );
if ( is_wp_error( $valid ) ) {
return $default;
}
$value = $setting->sanitize( $value );
if ( is_null( $value ) || is_wp_error( $value ) ) {
return $default;
}
return $value;
}
/**
* Override a setting's value in the current customized state.
*
* The name "post_value" is a carry-over from when the customized state was
* exclusively 源代码d from `$_POST['customized']`.
*
* @since 4.2.0
* @access public
*
* @param string $setting_id ID for the WP_Customize_Setting instance.
* @param mixed $value Post value.
*/
public function set_post_value( $setting_id, $value ) {
$this->unsanitized_post_values(); // Populate _post_values from $_POST['customized'].
$this->_post_values[ $setting_id ] = $value;
/**
* Announce when a specific setting's unsanitized post value has been set.
*
* Fires when the WP_Customize_Manager::set_post_value() method is called.
*
* The dynamic portion of the hook name, `$setting_id`, refers to the setting ID.
*
* @since 4.4.0
*
* @param mixed $value Unsanitized setting post value.
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
do_action( "customize_post_value_set_{$setting_id}", $value, $this );
/**
* Announce when any setting's unsanitized post value has been set.
*
* Fires when the WP_Customize_Manager::set_post_value() method is called.
*
* This is useful for `WP_Customize_Setting` instances to watch
* in order to update a cached previewed value.
*
* @since 4.4.0
*
* @param string $setting_id Setting ID.
* @param mixed $value Unsanitized setting post value.
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
do_action( 'customize_post_value_set', $setting_id, $value, $this );
}
/**
* Print JavaScript settings.
*
* @since 3.4.0
*/
public function customize_preview_init() {
/*
* Now that Customizer previews are loaded into iframes via GET requests
* and natural URLs with transaction UUIDs added, we need to ensure that
* the responses are never cached by proxies. In practice, this will not
* be needed if the user is logged-in anyway. But if anonymous access is
* allowed then the auth cookies would not be sent and WordPress would
* not send no-cache headers by default.
*/
if ( ! headers_sent() ) {
nocache_headers();
header( 'X-Robots: noindex, nofollow, noarchive' );
}
add_action( 'wp_head', 'wp_no_robots' );
add_filter( 'wp_headers', array( $this, 'filter_iframe_security_headers' ) );
/*
* If preview is being served inside the customizer preview iframe, and
* if the user doesn't have customize capability, then it is assumed
* that the user's session has expired and they need to re-authenticate.
*/
if ( $this->messenger_channel && ! current_user_can( 'customize' ) ) {
$this->wp_die( -1, __( 'Unauthorized. You may remove the customize_messenger_channel param to preview as frontend.' ) );
return;
}
$this->prepare_controls();
add_filter( 'wp_redirect', array( $this, 'add_state_query_params' ) );
wp_enqueue_script( 'customize-preview' );
wp_enqueue_style( 'customize-preview' );
add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) );
add_action( 'wp_head', array( $this, 'remove_frameless_preview_messenger_channel' ) );
add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
add_filter( 'get_edit_post_link', '__return_empty_string' );
/**
* Fires once the Customizer preview has initialized and JavaScript
* settings have been printed.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
do_action( 'customize_preview_init', $this );
}
/**
* Filter the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer.
*
* @since 4.7.0
* @access public
*
* @param array $headers Headers.
* @return array Headers.
*/
public function filter_iframe_security_headers( $headers ) {
$customize_url = admin_url( 'customize.php' );
$headers['X-Frame-Options'] = 'ALLOW-FROM ' . $customize_url;
$headers['Content-Security-Policy'] = 'frame-ancestors ' . preg_replace( '#^(\w+://[^/]+).+?$#', '$1', $customize_url );
return $headers;
}
/**
* Add customize state query params to a given URL if preview is allowed.
*
* @since 4.7.0
* @access public
* @see wp_redirect()
* @see WP_Customize_Manager::get_allowed_url()
*
* @param string $url URL.
* @return string URL.
*/
public function add_state_query_params( $url ) {
$parsed_original_url = wp_parse_url( $url );
$is_allowed = false;
foreach ( $this->get_allowed_urls() as $allowed_url ) {
$parsed_allowed_url = wp_parse_url( $allowed_url );
$is_allowed = (
$parsed_allowed_url['scheme'] === $parsed_original_url['scheme']
&&
$parsed_allowed_url['host'] === $parsed_original_url['host']
&&
0 === strpos( $parsed_original_url['path'], $parsed_allowed_url['path'] )
);
if ( $is_allowed ) {
break;
}
}
if ( $is_allowed ) {
$query_params = array(
'customize_changeset_uuid' => $this->changeset_uuid(),
);
if ( ! $this->is_theme_active() ) {
$query_params['customize_theme'] = $this->get_stylesheet();
}
if ( $this->messenger_channel ) {
$query_params['customize_messenger_channel'] = $this->messenger_channel;
}
$url = add_query_arg( $query_params, $url );
}
return $url;
}
/**
* Prevent sending a 404 status when returning the response for the customize
* preview, since it causes the jQuery Ajax to fail. Send 200 instead.
*
* @since 4.0.0
* @deprecated 4.7.0
* @access public
*/
public function customize_preview_override_404_status() {
_deprecated_function( __METHOD__, '4.7.0' );
}
/**
* Print base element for preview frame.
*
* @since 3.4.0
* @deprecated 4.7.0
*/
public function customize_preview_base() {
_deprecated_function( __METHOD__, '4.7.0' );
}
/**
* Print a workaround to handle HTML5 tags in IE < 9.
*
* @since 3.4.0
* @deprecated 4.7.0 Customizer no longer supports IE8, so all supported browsers recognize HTML5.
*/
public function customize_preview_html5() {
_deprecated_function( __FUNCTION__, '4.7.0' );
}
/**
* Print CSS for loading indicators for the Customizer preview.
*
* @since 4.2.0
* @access public
*/
public function customize_preview_loading_style() {
?><style>
body.wp-customizer-unloading {
opacity: 0.25;
cursor: progress !important;
-webkit-transition: opacity 0.5s;
transition: opacity 0.5s;
}
body.wp-customizer-unloading * {
pointer-events: none !important;
}
form.customize-unpreviewable,
form.customize-unpreviewable input,
form.customize-unpreviewable select,
form.customize-unpreviewable button,
a.customize-unpreviewable,
area.customize-unpreviewable {
cursor: not-allowed !important;
}
</style><?php
}
/**
* Remove customize_messenger_channel query parameter from the preview window when it is not in an iframe.
*
* This ensures that the admin bar will be shown. It also ensures that link navigation will
* work as expected since the parent frame is not being sent the URL to navigate to.
*
* @since 4.7.0
* @access public
*/
public function remove_frameless_preview_messenger_channel() {
if ( ! $this->messenger_channel ) {
return;
}
?>
<script>
( function() {
var urlParser, oldQueryParams, newQueryParams, i;
if ( parent !== window ) {
return;
}
urlParser = document.createElement( 'a' );
urlParser.href = location.href;
oldQueryParams = urlParser.search.substr( 1 ).split( /&/ );
newQueryParams = [];
for ( i = 0; i < oldQueryParams.length; i += 1 ) {
if ( ! /^customize_messenger_channel=/.test( oldQueryParams[ i ] ) ) {
newQueryParams.push( oldQueryParams[ i ] );
}
}
urlParser.search = newQueryParams.join( '&' );
if ( urlParser.search !== location.search ) {
location.replace( urlParser.href );
}
} )();
</script>
<?php
}
/**
* Print JavaScript settings for preview frame.
*
* @since 3.4.0
*/
public function customize_preview_settings() {
$post_values = $this->unsanitized_post_values( array( 'exclude_changeset' => true ) );
$setting_validities = $this->validate_setting_values( $post_values );
$exported_setting_validities = array_map( array( $this, 'prepare_setting_validity_for_js' ), $setting_validities );
// Note that the REQUEST_URI is not passed into home_url() since this breaks subdirectory installs.
$self_url = empty( $_SERVER['REQUEST_URI'] ) ? home_url( '/' ) : esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );
$state_query_params = array(
'customize_theme',
'customize_changeset_uuid',
'customize_messenger_channel',
);
$self_url = remove_query_arg( $state_query_params, $self_url );
$allowed_urls = $this->get_allowed_urls();
$allowed_hosts = array();
foreach ( $allowed_urls as $allowed_url ) {
$parsed = wp_parse_url( $allowed_url );
if ( empty( $parsed['host'] ) ) {
continue;
}
$host = $parsed['host'];
if ( ! empty( $parsed['port'] ) ) {
$host .= ':' . $parsed['port'];
}
$allowed_hosts[] = $host;
}
$switched_locale = switch_to_locale( get_user_locale() );
$l10n = array(
'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
'linkUnpreviewable' => __( 'This link is not live-previewable.' ),
'formUnpreviewable' => __( 'This form is not live-previewable.' ),
);
if ( $switched_locale ) {
restore_previous_locale();
}
$settings = array(
'changeset' => array(
'uuid' => $this->_changeset_uuid,
),
'timeouts' => array(
'selectiveRefresh' => 250,
'keepAliveSend' => 1000,
),
'theme' => array(
'stylesheet' => $this->get_stylesheet(),
'active' => $this->is_theme_active(),
),
'url' => array(
'self' => $self_url,
'allowed' => array_map( 'esc_url_raw', $this->get_allowed_urls() ),
'allowedHosts' => array_unique( $allowed_hosts ),
'isCrossDomain' => $this->is_cross_domain(),
),
'channel' => $this->messenger_channel,
'activePanels' => array(),
'activeSections' => array(),
'activeControls' => array(),
'settingValidities' => $exported_setting_validities,
'nonce' => current_user_can( 'customize' ) ? $this->get_nonces() : array(),
'l10n' => $l10n,
'_dirty' => array_keys( $post_values ),
);
foreach ( $this->panels as $panel_id => $panel ) {
if ( $panel->check_capabilities() ) {
$settings['activePanels'][ $panel_id ] = $panel->active();
foreach ( $panel->sections as $section_id => $section ) {
if ( $section->check_capabilities() ) {
$settings['activeSections'][ $section_id ] = $section->active();
}
}
}
}
foreach ( $this->sections as $id => $section ) {
if ( $section->check_capabilities() ) {
$settings['activeSections'][ $id ] = $section->active();
}
}
foreach ( $this->controls as $id => $control ) {
if ( $control->check_capabilities() ) {
$settings['activeControls'][ $id ] = $control->active();
}
}
?>
<script type="text/javascript">
var _wpCustomizeSettings = <?php echo wp_json_encode( $settings ); ?>;
_wpCustomizeSettings.values = {};
(function( v ) {
<?php
/*
* Serialize settings separately from the initial _wpCustomizeSettings
* serialization in order to avoid a peak memory usage spike.
* @todo We may not even need to export the values at all since the pane syncs them anyway.
*/
foreach ( $this->settings as $id => $setting ) {
if ( $setting->check_capabilities() ) {
printf(
"v[%s] = %s;\n",
wp_json_encode( $id ),
wp_json_encode( $setting->js_value() )
);
}
}
?>
})( _wpCustomizeSettings.values );
</script>
<?php
}
/**
* Prints a signature so we can ensure the Customizer was properly executed.
*
* @since 3.4.0
* @deprecated 4.7.0
*/
public function customize_preview_signature() {
_deprecated_function( __METHOD__, '4.7.0' );
}
/**
* Removes the signature in case we experience a case where the Customizer was not properly executed.
*
* @since 3.4.0
* @deprecated 4.7.0
*
* @param mixed $return Value passed through for {@see 'wp_die_handler'} filter.
* @return mixed Value passed through for {@see 'wp_die_handler'} filter.
*/
public function remove_preview_signature( $return = null ) {
_deprecated_function( __METHOD__, '4.7.0' );
return $return;
}
/**
* Is it a theme preview?
*
* @since 3.4.0
*
* @return bool True if it's a preview, false if not.
*/
public function is_preview() {
return (bool) $this->previewing;
}
/**
* Retrieve the template name of the previewed theme.
*
* @since 3.4.0
*
* @return string Template name.
*/
public function get_template() {
return $this->theme()->get_template();
}
/**
* Retrieve the stylesheet name of the previewed theme.
*
* @since 3.4.0
*
* @return string Stylesheet name.
*/
public function get_stylesheet() {
return $this->theme()->get_stylesheet();
}
/**
* Retrieve the template root of the previewed theme.
*
* @since 3.4.0
*
* @return string Theme root.
*/
public function get_template_root() {
return get_raw_theme_root( $this->get_template(), true );
}
/**
* Retrieve the stylesheet root of the previewed theme.
*
* @since 3.4.0
*
* @return string Theme root.
*/
public function get_stylesheet_root() {
return get_raw_theme_root( $this->get_stylesheet(), true );
}
/**
* Filters the current theme and return the name of the previewed theme.
*
* @since 3.4.0
*
* @param $current_theme {@internal Parameter is not used}
* @return string Theme name.
*/
public function current_theme( $current_theme ) {
return $this->theme()->display('Name');
}
/**
* Validates setting values.
*
* Validation is skipped for unregistered settings or for values that are
* already null since they will be skipped anyway. Sanitization is applied
* to values that pass validation, and values that become null or `WP_Error`
* after sanitizing are marked invalid.
*
* @since 4.6.0
* @access public
*
* @see WP_REST_Request::has_valid_params()
* @see WP_Customize_Setting::validate()
*
* @param array $setting_values Mapping of setting IDs to values to validate and sanitize.
* @param array $options {
* Options.
*
* @type bool $validate_existence Whether a setting's existence will be checked.
* @type bool $validate_capability Whether the setting capability will be checked.
* }
* @return array Mapping of setting IDs to return value of validate method calls, either `true` or `WP_Error`.
*/
public function validate_setting_values( $setting_values, $options = array() ) {
$options = wp_parse_args( $options, array(
'validate_capability' => false,
'validate_existence' => false,
) );
$validities = array();
foreach ( $setting_values as $setting_id => $unsanitized_value ) {
$setting = $this->get_setting( $setting_id );
if ( ! $setting ) {
if ( $options['validate_existence'] ) {
$validities[ $setting_id ] = new WP_Error( 'unrecognized', __( 'Setting does not exist or is unrecognized.' ) );
}
continue;
}
if ( $options['validate_capability'] && ! current_user_can( $setting->capability ) ) {
$validity = new WP_Error( 'unauthorized', __( 'Unauthorized to modify setting due to capability.' ) );
} else {
if ( is_null( $unsanitized_value ) ) {
continue;
}
$validity = $setting->validate( $unsanitized_value );
}
if ( ! is_wp_error( $validity ) ) {
/** This filter is documented in wp-includes/class-wp-customize-setting.php */
$late_validity = apply_filters( "customize_validate_{$setting->id}", new WP_Error(), $unsanitized_value, $setting );
if ( ! empty( $late_validity->errors ) ) {
$validity = $late_validity;
}
}
if ( ! is_wp_error( $validity ) ) {
$value = $setting->sanitize( $unsanitized_value );
if ( is_null( $value ) ) {
$validity = false;
} elseif ( is_wp_error( $value ) ) {
$validity = $value;
}
}
if ( false === $validity ) {
$validity = new WP_Error( 'invalid_value', __( 'Invalid value.' ) );
}
$validities[ $setting_id ] = $validity;
}
return $validities;
}
/**
* Prepares setting validity for exporting to the client (JS).
*
* Converts `WP_Error` instance into array suitable for passing into the
* `wp.customize.Notification` JS model.
*
* @since 4.6.0
* @access public
*
* @param true|WP_Error $validity Setting validity.
* @return true|array If `$validity` was a WP_Error, the error codes will be array-mapped
* to their respective `message` and `data` to pass into the
* `wp.customize.Notification` JS model.
*/
public function prepare_setting_validity_for_js( $validity ) {
if ( is_wp_error( $validity ) ) {
$notification = array();
foreach ( $validity->errors as $error_code => $error_messages ) {
$notification[ $error_code ] = array(
'message' => join( ' ', $error_messages ),
'data' => $validity->get_error_data( $error_code ),
);
}
return $notification;
} else {
return true;
}
}
/**
* Handle customize_save WP Ajax request to save/update a changeset.
*
* @since 3.4.0
* @since 4.7.0 The semantics of this method have changed to update a changeset, optionally to also change the status and other attributes.
*/
public function save() {
if ( ! is_user_logged_in() ) {
wp_send_json_error( 'unauthenticated' );
}
if ( ! $this->is_preview() ) {
wp_send_json_error( 'not_preview' );
}
$action = 'save-customize_' . $this->get_stylesheet();
if ( ! check_ajax_referer( $action, 'nonce', false ) ) {
wp_send_json_error( 'invalid_nonce' );
}
$changeset_post_id = $this->changeset_post_id();
if ( empty( $changeset_post_id ) ) {
if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->create_posts ) ) {
wp_send_json_error( 'cannot_create_changeset_post' );
}
} else {
if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id ) ) {
wp_send_json_error( 'cannot_edit_changeset_post' );
}
}
if ( ! empty( $_POST['customize_changeset_data'] ) ) {
$input_changeset_data = json_decode( wp_unslash( $_POST['customize_changeset_data'] ), true );
if ( ! is_array( $input_changeset_data ) ) {
wp_send_json_error( 'invalid_customize_changeset_data' );
}
} else {
$input_changeset_data = array();
}
// Validate title.
$changeset_title = null;
if ( isset( $_POST['customize_changeset_title'] ) ) {
$changeset_title = sanitize_text_field( wp_unslash( $_POST['customize_changeset_title'] ) );
}
// Validate changeset status param.
$is_publish = null;
$changeset_status = null;
if ( isset( $_POST['customize_changeset_status'] ) ) {
$changeset_status = wp_unslash( $_POST['customize_changeset_status'] );
if ( ! get_post_status_object( $changeset_status ) || ! in_array( $changeset_status, array( 'draft', 'pending', 'publish', 'future' ), true ) ) {
wp_send_json_error( 'bad_customize_changeset_status', 400 );
}
$is_publish = ( 'publish' === $changeset_status || 'future' === $changeset_status );
if ( $is_publish && ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->publish_posts ) ) {
wp_send_json_error( 'changeset_publish_unauthorized', 403 );
}
}
/*
* Validate changeset date param. Date is assumed to be in local time for
* the WP if in MySQL format (YYYY-MM-DD HH:MM:SS). Otherwise, the date
* is parsed with strtotime() so that ISO date format may be supplied
* or a string like "+10 minutes".
*/
$changeset_date_gmt = null;
if ( isset( $_POST['customize_changeset_date'] ) ) {
$changeset_date = wp_unslash( $_POST['customize_changeset_date'] );
if ( preg_match( '/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/', $changeset_date ) ) {
$mm = substr( $changeset_date, 5, 2 );
$jj = substr( $changeset_date, 8, 2 );
$aa = substr( $changeset_date, 0, 4 );
$valid_date = wp_checkdate( $mm, $jj, $aa, $changeset_date );
if ( ! $valid_date ) {
wp_send_json_error( 'bad_customize_changeset_date', 400 );
}
$changeset_date_gmt = get_gmt_from_date( $changeset_date );
} else {
$timestamp = strtotime( $changeset_date );
if ( ! $timestamp ) {
wp_send_json_error( 'bad_customize_changeset_date', 400 );
}
$changeset_date_gmt = gmdate( 'Y-m-d H:i:s', $timestamp );
}
}
$r = $this->save_changeset_post( array(
'status' => $changeset_status,
'title' => $changeset_title,
'date_gmt' => $changeset_date_gmt,
'data' => $input_changeset_data,
) );
if ( is_wp_error( $r ) ) {
$response = array(
'message' => $r->get_error_message(),
'code' => $r->get_error_code(),
);
if ( is_array( $r->get_error_data() ) ) {
$response = array_merge( $response, $r->get_error_data() );
} else {
$response['data'] = $r->get_error_data();
}
} else {
$response = $r;
// Note that if the changeset status was publish, then it will get set to trash if revisions are not supported.
$response['changeset_status'] = get_post_status( $this->changeset_post_id() );
if ( $is_publish && 'trash' === $response['changeset_status'] ) {
$response['changeset_status'] = 'publish';
}
if ( 'publish' === $response['changeset_status'] ) {
$response['next_changeset_uuid'] = wp_generate_uuid4();
}
}
if ( isset( $response['setting_validities'] ) ) {
$response['setting_validities'] = array_map( array( $this, 'prepare_setting_validity_for_js' ), $response['setting_validities'] );
}
/**
* Filters response data for a successful customize_save Ajax request.
*
* This filter does not apply if there was a nonce or authentication failure.
*
* @since 4.2.0
*
* @param array $response Additional information passed back to the 'saved'
* event on `wp.customize`.
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
$response = apply_filters( 'customize_save_response', $response, $this );
if ( is_wp_error( $r ) ) {
wp_send_json_error( $response );
} else {
wp_send_json_success( $response );
}
}
/**
* Save the post for the loaded changeset.
*
* @since 4.7.0
* @access public
*
* @param array $args {
* Args for changeset post.
*
* @type array $data Optional additional changeset data. Values will be merged on top of any existing post values.
* @type string $status Post status. Optional. If supplied, the save will be transactional and a post revision will be allowed.
* @type string $title Post title. Optional.
* @type string $date_gmt Date in GMT. Optional.
* @type int $user_id ID for user who is saving the changeset. Optional, defaults to the current user ID.
* @type bool $starter_content Whether the data is starter content. If false (default), then $starter_content will be cleared for any $data being saved.
* }
*
* @return array|WP_Error Returns array on success and WP_Error with array data on error.
*/
function save_changeset_post( $args = array() ) {
$args = array_merge(
array(
'status' => null,
'title' => null,
'data' => array(),
'date_gmt' => null,
'user_id' => get_current_user_id(),
'starter_content' => false,
),
$args
);
$changeset_post_id = $this->changeset_post_id();
$existing_changeset_data = array();
if ( $changeset_post_id ) {
$existing_status = get_post_status( $changeset_post_id );
if ( 'publish' === $existing_status || 'trash' === $existing_status ) {
return new WP_Error( 'changeset_already_published' );
}
$existing_changeset_data = $this->get_changeset_post_data( $changeset_post_id );
}
// Fail if attempting to publish but publish hook is missing.
if ( 'publish' === $args['status'] && false === has_action( 'transition_post_status', '_wp_customize_publish_changeset' ) ) {
return new WP_Error( 'missing_publish_callback' );
}
// Validate date.
$now = gmdate( 'Y-m-d H:i:59' );
if ( $args['date_gmt'] ) {
$is_future_dated = ( mysql2date( 'U', $args['date_gmt'], false ) > mysql2date( 'U', $now, false ) );
if ( ! $is_future_dated ) {
return new WP_Error( 'not_future_date' ); // Only future dates are allowed.
}
if ( ! $this->is_theme_active() && ( 'future' === $args['status'] || $is_future_dated ) ) {
return new WP_Error( 'cannot_schedule_theme_switches' ); // This should be allowed in the future, when theme is a regular setting.
}
$will_remain_auto_draft = ( ! $args['status'] && ( ! $changeset_post_id || 'auto-draft' === get_post_status( $changeset_post_id ) ) );
if ( $will_remain_auto_draft ) {
return new WP_Error( 'cannot_supply_date_for_auto_draft_changeset' );
}
} elseif ( $changeset_post_id && 'future' === $args['status'] ) {
// Fail if the new status is future but the existing post's date is not in the future.
$changeset_post = get_post( $changeset_post_id );
if ( mysql2date( 'U', $changeset_post->post_date_gmt, false ) <= mysql2date( 'U', $now, false ) ) {
return new WP_Error( 'not_future_date' );
}
}
// The request was made via wp.customize.previewer.save().
$update_transactionally = (bool) $args['status'];
$allow_revision = (bool) $args['status'];
// Amend post values with any supplied data.
foreach ( $args['data'] as $setting_id => $setting_params ) {
if ( array_key_exists( 'value', $setting_params ) ) {
$this->set_post_value( $setting_id, $setting_params['value'] ); // Add to post values so that they can be validated and sanitized.
}
}
// Note that in addition to post data, this will include any stashed theme mods.
$post_values = $this->unsanitized_post_values( array(
'exclude_changeset' => true,
'exclude_post_data' => false,
) );
$this->add_dynamic_settings( array_keys( $post_values ) ); // Ensure settings get created even if they lack an input value.
/*
* Get list of IDs for settings that have values different from what is currently
* saved in the changeset. By skipping any values that are already the same, the
* subset of changed settings can be passed into validate_setting_values to prevent
* an underprivileged modifying a single setting for which they have the capability
* from being blocked from saving. This also prevents a user from touching of the
* previous saved settings and overriding the associated user_id if they made no change.
*/
$changed_setting_ids = array();
foreach ( $post_values as $setting_id => $setting_value ) {
$setting = $this->get_setting( $setting_id );
if ( $setting && 'theme_mod' === $setting->type ) {
$prefixed_setting_id = $this->get_stylesheet() . '::' . $setting->id;
} else {
$prefixed_setting_id = $setting_id;
}
$is_value_changed = (
! isset( $existing_changeset_data[ $prefixed_setting_id ] )
||
! array_key_exists( 'value', $existing_changeset_data[ $prefixed_setting_id ] )
||
$existing_changeset_data[ $prefixed_setting_id ]['value'] !== $setting_value
);
if ( $is_value_changed ) {
$changed_setting_ids[] = $setting_id;
}
}
/**
* Fires before save validation happens.
*
* Plugins can add just-in-time {@see 'customize_validate_{$this->ID}'} filters
* at this point to catch any settings registered after `customize_register`.
* The dynamic portion of the hook name, `$this->ID` refers to the setting ID.
*
* @since 4.6.0
*
* @param WP_Customize_Manager $this WP_Customize_Manager instance.
*/
do_action( 'customize_save_validation_before', $this );
// Validate settings.
$validated_values = array_merge(
array_fill_keys( array_keys( $args['data'] ), null ), // Make sure existence/capability checks are done on value-less setting updates.
$post_values
);
$setting_validities = $this->validate_setting_values( $validated_values, array(
'validate_capability' => true,
'validate_existence' => true,
) );
$invalid_setting_count = count( array_filter( $setting_validities, 'is_wp_error' ) );
/*
* Short-circuit if there are invalid settings the update is transactional.
* A changeset update is transactional when a status is supplied in the request.
*/
if ( $update_transactionally && $invalid_setting_count > 0 ) {
$response = array(
'setting_validities' => $setting_validities,
'message' => sprintf( _n( 'There is %s invalid setting.', 'There are %s invalid settings.', $invalid_setting_count ), number_format_i18n( $invalid_setting_count ) ),
);
return new WP_Error( 'transaction_fail', '', $response );
}
// Obtain/merge data for changeset.
$original_changeset_data = $this->get_changeset_post_data( $changeset_post_id );
$data = $original_changeset_data;
if ( is_wp_error( $data ) ) {
$data = array();
}
// Ensure that all post values are included in the changeset data.
foreach ( $post_values as $setting_id => $post_value ) {
if ( ! isset( $args['data'][ $setting_id ] ) ) {
$args['data'][ $setting_id ] = array();
}
if ( ! isset( $args['data'][ $setting_id ]['value'] ) ) {
$args['data'][ $setting_id ]['value'] = $post_value;
}
}
foreach ( $args['data'] as $setting_id => $setting_params ) {
$setting = $this->get_setting( $setting_id );
if ( ! $setting || ! $setting->check_capabilities() ) {
continue;
}
// Skip updating changeset for invalid setting values.
if ( isset( $setting_validities[ $setting_id ] ) && is_wp_error( $setting_validities[ $setting_id ] ) ) {
continue;
}
$changeset_setting_id = $setting_id;
if ( 'theme_mod' === $setting->type ) {
$changeset_setting_id = sprintf( '%s::%s', $this->get_stylesheet(), $setting_id );
}
if ( null === $setting_params ) {
// Remove setting from changeset entirely.
unset( $data[ $changeset_setting_id ] );
} else {
if ( ! isset( $data[ $changeset_setting_id ] ) ) {
$data[ $changeset_setting_id ] = array();
}
// Merge any additional setting params that have been supplied with the existing params.
$merged_setting_params = array_merge( $data[ $changeset_setting_id ], $setting_params );
// Skip updating setting params if unchanged (ensuring the user_id is not overwritten).
if ( $data[ $changeset_setting_id ] === $merged_setting_params ) {
continue;
}
$data[ $changeset_setting_id ] = array_merge(
$merged_setting_params,
array(
'type' => $setting->type,
'user_id' => $args['user_id'],
)
);
// Clear starter_content flag in data if changeset is not explicitly being updated for starter content.
if ( empty( $args['starter_content'] ) ) {
unset( $data[ $changeset_setting_id ]['starter_content'] );
}
}
}
$filter_context = array(
'uuid' => $this->changeset_uuid(),
'title' => $args['title'],
'status' => $args['status'],
'date_gmt' => $args['date_gmt'],
'post_id' => $changeset_post_id,
'previous_data' => is_wp_error( $original_changeset_data ) ? array() : $original_changeset_data,
'manager' => $this,
);
/**
* Filters the settings' data that will be persisted into the changeset.
*
* Plugins may amend additional data (such as additional meta for settings) into the changeset with this filter.
*
* @since 4.7.0
*
* @param array $data Updated changeset data, mapping setting IDs to arrays containing a $value item and optionally other metadata.
* @param array $context {
* Filter context.
*
* @type string $uuid Changeset UUID.
* @type string $title Requested title for the changeset post.
* @type string $status Requested status for the changeset post.
* @type string $date_gmt Requested date for the changeset post in MySQL format and GMT timezone.
* @type int|false $post_id Post ID for the changeset, or false if it doesn't exist yet.
* @type array $previous_data Previous data contained in the changeset.
* @type WP_Customize_Manager $manager Manager instance.
* }
*/
$data = apply_filters( 'customize_changeset_save_data', $data, $filter_context );
// Switch theme if publishing changes now.
if ( 'publish' === $args['status'] && ! $this->is_theme_active() ) {
// Temporarily stop previewing the theme to allow switch_themes() to operate properly.
$this->stop_previewing_theme();
switch_theme( $this->get_stylesheet() );
update_option( 'theme_switched_via_customizer', true );
$this->start_previewing_theme();
}
// Gather the data for wp_insert_post()/wp_update_post().
$json_options = 0;
if ( defined( 'JSON_UNESCAPED_SLASHES' ) ) {
$json_options |= JSON_UNESCAPED_SLASHES; // Introduced in PHP 5.4. This is only to improve readability as slashes needn't be escaped in storage.
}
$json_options |= JSON_PRETTY_PRINT; // Also introduced in PHP 5.4, but WP defines constant for back compat. See WP Trac
更新日志
Version | description |
---|---|
3.4.0 | Introduced. |
Methods
- __construct Constructor.
- _cmp_priority Helper function to compare two objects by priority, ensuring sort stability via instance_number. deprecated
- _filter_revision_post_has_changed Filters whether a changeset has changed to create a new revision.
- _publish_changeset_values Publish changeset values.
- _render_custom_logo_partial Callback for rendering the custom logo, used in the custom_logo partial.
- _sanitize_background_setting Callback for validating a background setting value.
- _sanitize_external_header_video Callback for sanitizing the external_header_video value.
- _sanitize_header_textcolor Callback for validating the header_textcolor value.
- _save_starter_content_changeset Save starter content changeset.
- _validate_external_header_video Callback for validating the external_header_video value.
- _validate_header_video Callback for validating the header_video value.
- add_control Add a customize control.
- add_dynamic_settings Register any dynamically-created settings, such as those from $_POST['customized'] that have no corresponding setting created.
- add_panel Add a customize panel.
- add_section Add a customize section.
- add_setting Add a customize setting.
- add_state_query_params Add customize state query params to a given URL if preview is allowed.
- after_setup_theme Callback to validate a theme once it is loaded
- changeset_data Get changeset data.
- changeset_post_id Get the changeset post id for the loaded changeset.
- changeset_uuid Get the changeset UUID.
- containers Get the registered containers.
- controls Get the registered controls.
- current_theme Filters the current theme and return the name of the previewed theme.
- customize_pane_settings Print JavaScript settings for parent window.
- customize_preview_base Print base element for preview frame. deprecated
- customize_preview_html5 Print a workaround to handle HTML5 tags in IE < 9. deprecated
- customize_preview_init Print JavaScript settings.
- customize_preview_loading_style Print CSS for loading indicators for the Customizer preview.
- customize_preview_override_404_status Prevent sending a 404 status when returning the response for the customize preview, since it causes the jQuery Ajax to fail. Send 200 instead. deprecated
- customize_preview_settings Print JavaScript settings for preview frame.
- customize_preview_signature Prints a signature so we can ensure the Customizer was properly executed. deprecated
- doing_ajax Return true if it's an Ajax request.
- enqueue_control_scripts Enqueue scripts for customize controls.
- export_header_video_settings Export header video settings to facilitate selective refresh.
- filter_iframe_security_headers Filter the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer.
- find_changeset_post_id Find the changeset post ID for a given changeset UUID.
- get_allowed_urls Get URLs allowed to be previewed.
- get_autofocus Get the autofocused constructs.
- get_changeset_post_data Get the data stored in a changeset post.
- get_control Retrieve a customize control.
- get_document_title_template Get the template string for the Customizer pane document title.
- get_messenger_channel Get messenger channel.
- get_nonces Get nonces for the Customizer.
- get_panel Retrieve a customize panel.
- get_preview_url Get the initial URL to be previewed.
- get_previewable_devices Returns a list of devices to allow previewing.
- get_return_url Get URL to link the user to when closing the Customizer.
- get_section Retrieve a customize section.
- get_setting Retrieve a customize setting.
- get_stylesheet Retrieve the stylesheet name of the previewed theme.
- get_stylesheet_root Retrieve the stylesheet root of the previewed theme.
- get_template Retrieve the template name of the previewed theme.
- get_template_root Retrieve the template root of the previewed theme.
- has_published_pages Return whether there are published pages.
- import_theme_starter_content Import theme starter content into the customized state.
- is_cross_domain Determines whether the admin and the frontend are on different domains.
- is_ios Determine whether the user agent is iOS.
- is_preview Is it a theme preview?
- is_theme_active Checks if the current theme is active.
- panels Get the registered panels.
- post_value Returns the sanitized value for a given setting from the current customized state.
- prepare_controls Prepare panels, sections, and controls.
- prepare_setting_validity_for_js Prepares setting validity for exporting to the client (JS).
- prepare_starter_content_attachments Prepare starter content attachments.
- refresh_nonces Refresh nonces for the current preview.
- register_control_type Register a customize control type.
- register_controls Register some default controls.
- register_dynamic_settings Add settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets
- register_panel_type Register a customize panel type.
- register_section_type Register a customize section type.
- remove_control Remove a customize control.
- remove_frameless_preview_messenger_channel Remove customize_messenger_channel query parameter from the preview window when it is not in an iframe.
- remove_panel Remove a customize panel.
- remove_preview_signature Removes the signature in case we experience a case where the Customizer was not properly executed. deprecated
- remove_section Remove a customize section.
- remove_setting Remove a customize setting.
- render_control_templates Render JS templates for all registered control types.
- render_panel_templates Render JS templates for all registered panel types.
- render_section_templates Render JS templates for all registered section types.
- save Handle customize_save WP Ajax request to save/update a changeset.
- save_changeset_post Save the post for the loaded changeset.
- sections Get the registered sections.
- set_autofocus Set the autofocused constructs.
- set_post_value Override a setting's value in the current customized state.
- set_preview_url Set the initial URL to be previewed.
- set_return_url Set URL to link the user to when closing the Customizer.
- settings Get the registered settings.
- setup_theme Start preview and customize theme.
- start_previewing_theme If the theme to be previewed isn't the active theme, add filter callbacks to swap it out at runtime.
- stop_previewing_theme Stop previewing the selected theme.
- theme Get the theme being customized.
- unsanitized_post_values Get dirty pre-sanitized setting values in the current customized state.
- update_stashed_theme_mod_settings Update stashed theme mod settings.
- validate_setting_values Validates setting values.
- wp_die Custom wp_die wrapper. Returns either the standard message for UI or the Ajax message.
- wp_die_handler Return the Ajax wp_die() handler if it's a customized request. deprecated
- wp_loaded Register styles/scripts and initialize the preview of each setting
- wp_redirect_status Prevents Ajax requests from following redirects when previewing a theme by issuing a 200 response instead of a 30x. deprecated
User Contributed Notes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论