Professional Documents
Culture Documents
Function Reference Laquo Wordpress Codexpdf PDF
Function Reference Laquo Wordpress Codexpdf PDF
Codex Codex tools: Log in
Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!
Function Reference
Languages: English • Español • Persian • Français • Italiano • 日本語 • • 한국어 • Português do Brasil • Русский • Türkçe •
• עברית中文(简体) • 中文(繁體) • (Add your language)
The files of WordPress define many useful PHP functions. Some of the functions,
Contents
known as Template Tags, are defined especially for use in WordPress Themes. There
are also some functions related to actions and filters (the Plugin API), which are 1 Functions by category
therefore used primarily for developing Plugins. The rest are used to create the core 1.1 Post, Custom Post Type,
Many of the core WordPress functions are useful to Plugin and Theme developers. 1.2 Category, Tag and Taxonomy
So, this article lists most of the core functions, excluding Template Tags. At the Functions
bottom of the page, there is a section listing other resources for finding information 1.3 User and Author Functions
about WordPress functions. In addition to this information, the WordPress phpdoc site 1.4 Feed Functions
details all the WordPress functions by version since 2.6.1. 1.5 HTTP API Functions
1.6 Comment, Ping, and
Trackback Functions
You can help make this page more complete! 1.7 Action, Filter, and Plugin
Functions
Here are some things you can do to help: 1.8 Theme-Related Functions
1.9 Formatting Functions
Add documentation to un-documented functions, by creating sub-pages or at 1.10 Miscellaneous Functions
least by adding short comments in the lists below. If you create a subpage for a 1.11 Multisite functions
function, please include information and examples of usage of that function, if 2 Official and Unofficial References
possible, per the examples found in Template Tags.
List more functions here, following the category structure.
Correct errors by moving functions to better categories where appropriate, and of course fixing typos. Note: that it is OK for a
function to appear in more than one category.
Read Contributing to WordPress to find out more about how you can contribute to the effort!
Functions by category
Post, Custom Post Type, Page, Category, Tag and Taxonomy Functions
Attachment and Bookmarks Functions
Categories
Posts
cat_is_ancestor_of
get_adjacent_post get_all_category_ids
get_boundary_post get_ancestors
get_children get_cat_ID
get_extended get_cat_name
get_next_post get_categories
get_next_posts_link get_category
next_posts_link get_category_by_path
get_permalink get_category_by_slug
the_permalink get_the_category_by_ID
get_the_excerpt get_the_category_list
the_excerpt get_category_link
get_the_post_thumbnail get_category_parents
get_post get_the_category
get_post_field single_cat_title
get_post_ancestors in_category
get_post_mime_type is_category
get_post_status the_category
get_post_format wp_category_checklist
set_post_format wp_dropdown_categories
get_edit_post_link wp_list_categories
get_delete_post_link
get_previous_post Category Creation
get_previous_posts_link
previous_posts_link wp_create_category
get_posts wp_delete_category
have_posts wp_insert_category
is_post (deprecated)
is_single Tags
is_sticky
get_the_ID get_tag
the_ID get_tag_link
the_post get_tags
wp_get_recent_posts get_the_tag_list
add_post_meta
delete_post_meta
get_post_custom
get_post_custom_keys
get_post_custom_values
get_post_meta
update_post_meta
register_meta
Attachments
get_attached_file
image_resize (deprecated)
image_edit_before_change (ported to
WP_Image_Editor object)
is_attachment
is_local_attachment
set_post_thumbnail
update_attached_file
wp_attachment_is_image
wp_create_thumbnail (deprecated)
wp_insert_attachment
wp_delete_attachment
wp_get_attachment_image
wp_get_attachment_link
wp_get_attachment_image_src
wp_get_attachment_metadata
wp_get_attachment_thumb_file
wp_get_attachment_thumb_url
wp_get_attachment_url
wp_check_for_changed_slugs
wp_count_posts
wp_get_mime_types
wp_mime_type_icon
wp_generate_attachment_metadata
wp_prepare_attachment_for_js
wp_update_attachment_metadata
Bookmarks
get_bookmark
get_bookmarks
wp_list_bookmarks
Terms
wp_get_post_categories
wp_set_post_categories
wp_get_post_tags
wp_set_post_tags
wp_get_post_terms
wp_set_post_terms
wp_count_terms
has_term
is_object_in_term
Others
add_meta_box
remove_meta_box
get_the_ID
the_ID
get_the_author
the_author
get_the_author_posts
get_the_content
the_content
get_the_title
the_title
the_title_attribute
register_post_status
wp_trim_excerpt
wp_get_post_revision
wp_get_post_revisions
wp_is_post_revision
paginate_links
User meta
add_user_meta
delete_user_meta
get_user_meta
update_user_meta
get_the_author_meta
User insertion/removal
wp_create_user
wp_delete_user
wp_insert_user
wp_update_user
Login / Logout
is_user_logged_in
wp_login_form
wp_signon
wp_logout
wp_loginout
discover_pingback_server_uri merge_filters
delete_comment_meta remove_filter
do_all_pings remove_all_filters
do_enclose
do_trackbacks Actions (Reference)
generic_ping
get_approved_comments has_action
get_avatar add_action
get_comment do_action
get_comment_text do_action_ref_array
get_comment_meta did_action
get_comments remove_action
wp_list_comments remove_all_actions
get_enclosed
get_lastcommentmodified Plugins (Reference)
get_pung
get_to_ping plugin_basename
have_comments plugins_url
get_comment_author get_plugin_data
is_trackback get_admin_page_title
pingback plugin_dir_path
privacy_ping_filter register_activation_hook
sanitize_comment_cookies register_deactivation_hook
trackback menu_page_url
trackback_url is_plugin_active
trackback_url_list is_plugin_active_for_network
update_comment_meta is_plugin_inactive
weblog_ping is_plugin_page
wp_allow_comment add_contextual_help (deprecated)
wp_count_comments get_plugins
wp_delete_comment
wp_filter_comment Widgets (Reference)
wp_get_comment_status
wp_get_current_commenter is_active_widget
wp_insert_comment register_widget
wp_new_comment the_widget
wp_set_comment_status unregister_widget
wp_throttle_comment_flood wp_add_dashboard_widget
wp_update_comment wp_convert_widget_settings
wp_update_comment_count wp_get_sidebars_widgets
wp_update_comment_count_now wp_get_widget_defaults
wp_register_sidebar_widget
Comments Loop wp_register_widget_control
wp_set_sidebars_widgets
comment_class wp_unregister_sidebar_widget
comment_ID wp_unregister_widget_control
comment_author wp_widget_description
comment_date
comment_time
get_comment_date Settings (Reference)
get_comment_time
register_setting
Comments Pagination unregister_setting
settings_fields
paginate_comments_links do_settings_fields
previous_comments_link do_settings_sections
next_comments_link add_settings_field
get_comment_pages_count add_settings_section
add_settings_error
get_settings_errors
settings_errors
Shortcodes (Reference)
add_shortcode
do_shortcode
do_shortcode_tag
get_shortcode_regex
remove_shortcode
remove_all_shortcodes
shortcode_atts
shortcode_parse_atts
strip_shortcodes
get_admin_url _admin_notice_multisite_activate_plugins_page
get_user_option (deprecated)
get_option
update_option
update_site_option Multisite Functions
update_user_option
wp_load_alloptions Site/blog functions that work with the blogs table and related
data, found in file wp-includes/ms-blogs.php (since 3.0.0).
Transients
add_blog_option
set_transient() delete_blog_option
get_transient() get_blogaddress_by_domain
delete_transient() get_blogaddress_by_id
set_site_transient() get_blogaddress_by_name
get_site_transient() get_blog_details
delete_site_transient() get_blog_option
get_blog_status
Admin Menu Functions get_id_from_blogname
get_last_updated
add_menu_page is_archived
remove_menu_page refresh_blog_details
add_submenu_page restore_current_blog
remove_submenu_page switch_to_blog
add_object_page update_archived
add_utility_page update_blog_details
add_comments_page update_blog_option
add_dashboard_page update_blog_status
add_links_page wpmu_update_blogs_date
add_management_page
add_media_page Defines constants and global variables that can be overridden,
add_options_page generally in wp-config.php, found in file wp-includes/ms-
add_pages_page default-constants.php (since 3.0.0).
add_plugins_page
add_posts_page ms_cookie_constants
add_theme_page ms_file_constants
add_users_page ms_subdomain_constants
ms_upload_constants
Toolbar Functions
Multisite WordPress API, found in file wp-includes/ms-
add_node functions.php (since 3.0.0).
remove_node
add_group add_existing_user_to_blog
get_node add_new_user_to_blog
get_nodes add_user_to_blog
check_upload_mimes
Form Helpers create_empty_blog
domain_exists
checked filter_SSL
disabled fix_phpmailer_messageid
selected force_ssl_content
submit_button get_active_blog_for_user
get_submit_button get_admin_users_for_domain
get_blogs_of_user
get_blog_count
Nonces and Referers (Security) get_blog_id_from_url
get_blog_permalink
check_admin_referer get_blog_post
check_ajax_referer get_current_site
wp_create_nonce get_dashboard_blog
wp_explain_nonce (deprecated) get_dirsize
wp_get_original_referer get_most_recent_post_of_user
wp_get_referer get_sitestats
wp_nonce_ays get_space_allowed
wp_nonce_field get_space_used
wp_nonce_url get_upload_space_available
wp_original_referer_field get_user_count
wp_referer_field get_user_id_from_string (deprecated)
wp_send_json global_terms
wp_send_json_error insert_blog
wp_send_json_success install_blog
wp_verify_nonce install_blog_defaults
is_blog_user (deprecated)
XMLRPC is_email_address_unsafe
is_upload_space_available
xmlrpc_getpostcategory is_user_option_local
xmlrpc_getposttitle is_user_spammy
xmlrpc_removepostdata maybe_add_existing_user_to_blog
user_pass_ok (deprecated) maybe_redirect_404
newblog_notify_siteadmin
Localization newuser_notify_siteadmin
recurse_dirsize
__ redirect_mu_dashboard (not a function??)
_x redirect_this_site
_n remove_user_from_blog
_nx signup_nonce_check
_e signup_nonce_fields
_ex update_blog_public
_ngettext (deprecated) update_posts_count
esc_attr__ upload_is_file_too_big
esc_attr_e upload_is_user_over_quota
get_locale upload_size_limit_filter
load_default_textdomain users_can_register_signup_filter
load_plugin_textdomain welcome_user_msg_filter
load_textdomain wordpressmu_wp_mail_from (not a function??)
load_theme_textdomain wp_get_sites
is_rtl wpmu_activate_signup
wpmu_admin_redirect_add_updated_param
Cron (Scheduling) (deprecated)
wpmu_create_blog
spawn_cron wpmu_create_user
wp_clear_scheduled_hook wpmu_log_new_registrations
wp_cron wpmu_signup_blog
wp_get_schedule wpmu_signup_blog_notification
wp_get_schedules wpmu_signup_user
wp_next_scheduled wpmu_signup_user_notification
wp_reschedule_event wpmu_validate_blog_signup
wp_schedule_event wpmu_validate_user_signup
wp_schedule_single_event wpmu_welcome_notification
wp_unschedule_event wpmu_welcome_user_notification
Conditional Tags Index These functions are needed to load Multisite, found in file wp-
includes/ms-load.php (since 3.0.0).
comments_open
has_nav_menu get_current_site_name (deprecated)
has_tag is_subdomain_install
in_category ms_not_installed
is_404 ms_site_check
is_admin wpmu_current_site (deprecated)
is_archive
is_attachment
is_author
is_category
is_comments_popup
is_date
is_day
is_feed
is_front_page
is_home
is_month
is_page
is_page_template
is_paged
is_preview
is_search
is_single
is_singular
is_sticky
is_tag
is_tax
is_time
is_trackback
is_year
pings_open
wp_dequeue_script
wp_dequeue_style
wp_deregister_script
wp_deregister_style
wp_enqueue_script
wp_enqueue_style
wp_localize_script
wp_register_script
wp_register_style
wp_script_is
wp_style_is
sql
get_tax_sql
get_meta_sql
get_posts_by_author_sql
Miscellaneous
add_editor_style
add_query_arg
add_rewrite_rule
admin_url
bool_from_yn
cache_javascript_headers
capital_P_dangit
clean_blog_cache
content_url
do_robots
flush_rewrite_rules
get_bloginfo
get_num_queries
get_post_stati
get_post_statuses
get_query_var
home_url
includes_url
is_blog_installed
is_main_site
is_main_query
is_multisite
is_ssl
is_wp_error
log_app
make_url_footnote (deprecated)
network_admin_url
network_home_url
network_site_url
nocache_headers
plugin_dir_url
query_posts
remove_query_arg
rewind_posts
setup_postdata
site_url
status_header
unzip_file
validate_file
validate_file_to_edit
wp
wp_cache_set
wp_cache_get
wp_cache_reset (deprecated)
wp_check_filetype
wp_clearcookie (deprecated)
wp_die
wp_editor
wp_footer
wp_get_cookie_login (deprecated)
wp_get_image_editor
wp_get_installed_translations
wp_hash
wp_handle_sideload
wp_head
wp_install_defaults
wp_is_mobile
wp_mail
wp_mkdir_p
wp_new_user_notification
wp_password_change_notification
wp_notify_moderator
wp_notify_postauthor
wp_parse_args
wp_redirect
wp_reset_postdata
wp_reset_query
wp_salt
wp_set_auth_cookie
wp_safe_redirect
wp_upload_bits
wp_upload_dir
wp_list_pluck
wp_text_diff
post_submit_meta_box
Categories:
Advanced Topics
Functions
WordPress Development
Home Page
WordPress Lessons
Getting Started
Working with
WordPress
Advanced Topics
Troubleshooting
Developer Docs
About WordPress
Codex Resources
Community portal
Current events
Recent changes
Random page
Help
WordPress.com Follow