Function Reference WordPress Codex PDF
Function Reference WordPress Codex PDF
Codex
Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!
Function Reference
Languages: English Espaol Persian Franais Italiano
() () (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
WordPress functionality.
Many of the core WordPress functions are useful to Plugin and Theme developers.
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
about WordPress functions. In addition to this information, the WordPress phpdoc site
least by adding short comments in the lists below. If you create a subpage for a
Read Contributing to WordPress to find out more about how you can contribute to the effort!
Functions by category
Post, Custom Post Type, Page,
Attachment and Bookmarks Functions
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
wp_get_single_post (deprecated)
get_the_tags
has_post_thumbnail
has_tag
has_excerpt
is_tag
has_post_format
the_tags
single_tag_title
tag_description
wp_generate_tag_cloud
register_post_type
wp_tag_cloud
is_post_type_archive
post_type_archive_title
Taxonomy
add_post_type_support
remove_post_type_support
get_edit_term_link
post_type_supports
get_taxonomy
set_post_type
get_taxonomies
post_type_exists
get_term
get_post_type
get_the_term_list
get_post_types
get_term_by
get_post_type_archive_link
the_terms
get_post_type_object
get_the_terms
get_post_type_capabilities
get_term_children
get_post_type_labels
get_term_link
is_post_type_hierarchical
get_terms
is_taxonomy (deprecated)
Post insertion/removal
is_taxonomy_hierarchical
is_term (deprecated)
wp_delete_post
taxonomy_exists
wp_insert_post
term_exists
wp_publish_post
register_taxonomy
wp_trash_post
register_taxonomy_for_object_type
wp_update_post
wp_get_object_terms
wp_remove_object_terms
Pages
wp_set_object_terms
wp_insert_term
get_all_page_ids
wp_update_term
get_ancestors
wp_delete_term
get_page (deprecated)
wp_terms_checklist
get_page_link
get_page_by_path
get_page_by_title
get_page_children
get_page_hierarchy
get_page_uri
get_pages
is_page
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
Feed Functions
bloginfo_rss
comment_author_rss
add_cap
comment_link
add_role
comment_text_rss
author_can
do_feed
current_user_can
do_feed_atom
current_user_can_for_blog
do_feed_rdf
get_role
do_feed_rss
get_super_admins
do_feed_rss2
is_super_admin
fetch_feed
map_meta_cap
fetch_rss (deprecated)
remove_cap
get_author_feed_link
remove_role
get_bloginfo_rss
user_can
get_category_feed_link
get_comment_link
get_comment_author_rss
get_post_comments_feed_link
auth_redirect
get_rss (deprecated)
count_users
get_search_comments_feed_link
count_user_posts
get_search_feed_link
count_many_users_posts
get_the_category_rss
email_exists
get_the_title_rss
get_currentuserinfo
permalink_single_rss (deprecated)
get_current_user_id
post_comments_feed_link
get_profile (deprecated)
rss_enclosure
get_user_by
the_title_rss
get_userdata
the_category_rss
get_usernumposts (deprecated)
the_content_rss (deprecated)
get_users
the_excerpt_rss
set_current_user (deprecated)
wp_rss (deprecated)
user_pass_ok (deprecated)
wp_authenticate
username_exists
validate_username
wp_dropdown_users
wp_get_current_user
wp_set_current_user
wp_set_password
get_author_posts_url
get_the_modified_author
is_multi_author
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
add_ping
add_comment_meta
has_filter
check_comment
add_filter
comment_text
apply_filters
comment_form
apply_filters_ref_array
comments_number
current_filter
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
Theme-Related Functions
Include functions
Formatting Functions
absint
add_magic_quotes
comments_template
addslashes_gpc
get_footer
antispambot
get_header
attribute_escape (deprecated)
get_sidebar
backslashit
get_search_form
balanceTags
clean_pre
Other functions
clean_url
convert_chars
add_custom_background (deprecated)
convert_smilies
add_custom_image_header (deprecated)
ent2ncr
add_image_size
esc_attr
add_theme_support
esc_html
body_class
esc_js
current_theme_supports
esc_textarea
dynamic_sidebar
esc_sql
get_404_template
esc_url
get_archive_template
esc_url_raw
get_attachment_template
force_balance_tags
get_author_template
format_to_edit
get_body_class
format_to_post (deprecated)
get_category_template
funky_javascript_fix (deprecated)
get_comments_popup_template
htmlentities2
get_current_theme
is_email
get_date_template
js_escape (deprecated)
get_header_image
make_clickable
get_header_textcolor
popuplinks
get_home_template
remove_accents
get_locale_stylesheet_uri
sanitize_email
get_page_template
sanitize_file_name
get_paged_template
sanitize_html_class
get_post_class
sanitize_key
get_query_template
sanitize_mime_type
get_search_template
sanitize_option
get_single_template
sanitize_sql_orderby
get_stylesheet
sanitize_text_field
get_stylesheet_directory
sanitize_title
get_stylesheet_directory_uri
sanitize_title_for_query
get_stylesheet_uri
sanitize_title_with_dashes
get_tag_template
sanitize_user
get_taxonomy_template
seems_utf8
get_template
stripslashes_deep
get_template_directory
trailingslashit
get_template_directory_uri
untrailingslashit
get_template_part
urlencode_deep
get_theme (deprecated)
url_shorten
wp_get_themes
utf8_uri_encode
get_theme_data (deprecated)
wpautop
get_theme_support
wptexturize
get_theme_mod
wp_filter_kses
get_theme_mods
wp_filter_post_kses
get_theme_root
wp_filter_nohtml_kses
get_theme_roots
wp_iso_descrambler
get_theme_root_uri
wp_kses
get_themes (deprecated)
wp_kses_array_lc
has_header_image
wp_kses_attr
header_image
wp_kses_bad_protocol
header_textcolor
wp_kses_bad_protocol_once
in_the_loop
wp_kses_bad_protocol_once2
is_child_theme
wp_kses_check_attr_val
is_active_sidebar
wp_kses_decode_entities
is_admin_bar_showing
wp_kses_hair
is_dynamic_sidebar
wp_kses_hook
language_attributes
wp_kses_html_error
load_template
wp_kses_js_entities
locale_stylesheet
wp_kses_no_null
locate_template
wp_kses_normalize_entities
post_class
wp_kses_normalize_entities2
preview_theme
wp_kses_split
preview_theme_ob_filter
wp_kses_split2
preview_theme_ob_filter_callback
wp_kses_stripslashes
register_nav_menu
wp_kses_version
register_nav_menus
wp_make_link_relative
get_registered_nav_menus
wp_normalize_path
register_sidebar
wp_rel_nofollow
register_sidebars
wp_richedit_pre
register_theme_directory
wp_specialchars
remove_theme_mod
wp_trim_words
remove_theme_mods
zeroise
remove_theme_support
require_if_theme_supports
search_theme_directories
set_theme_mod
switch_theme
validate_current_theme
unregister_nav_menu
unregister_sidebar
wp_add_inline_style
wp_clean_themes_cache
wp_get_archives
wp_get_nav_menu_items
wp_get_theme
wp_nav_menu
wp_oembed_remove_provider
wp_page_menu
wp_title
Miscellaneous Functions
Multisite functions
Time/Date Functions
current_time
http://codex.wordpress.org/WPMU_Functions (deprecated
date_i18n
page).
get_calendar
get_date_from_gmt
get_lastpostdate
get_lastpostmodified
confirm_delete_users
get_day_link
is_user_member_of_blog
get_gmt_from_date
wp_dashboard_quota
get_month_link
the_date
get_the_date
(since 3.0.0).
the_time
get_the_time
admin_notice_feed (deprecated)
the_modified_time
avoid_blog_page_permalink_collision
get_the_modified_time
check_import_new_users
get_weekstartend
check_upload_size
get_year_link
choose_primary_blog
human_time_diff
display_space_usage
is_new_day
fix_import_form_size
iso8601_timezone_to_offset
format_code_lang
iso8601_to_datetime
get_site_allowed_themes (deprecated)
mysql2date
grant_super_admin
ms_deprecated_blogs_file (deprecated)
Serialization
mu_dropdown_languages
new_user_email_admin_notice
is_serialized
redirect_user_to_blog (deprecated)
is_serialized_string
refresh_user_details
maybe_serialize
revoke_super_admin
maybe_unserialize
secret_salt_warning
send_confirmation_on_profile_email
Options
show_post_thumbnail_warning (deprecated)
site_admin_notice
add_option
sync_category_tag_slugs
add_site_option
update_option_new_admin_email
delete_option
update_user_status
delete_site_option
upload_is_user_over_quote
form_option
upload_space_setting
get_alloptions (deprecated)
wpmu_delete_blog
get_site_option
wpmu_delete_user
get_site_url
wpmu_get_blog_allowedthemes (deprecated)
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
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
add_options_page
add_pages_page
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/msadd_node
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
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
__
_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
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
These functions are needed to load Multisite, found in file wpincludes/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
Home Page
Codex Resources
Community portal
Current events
Recent changes
Random page
Help
About
Support
Showcase
WordCamp
Blog
Developers
Plugins
WordPress.TV
Hosting
Get Involved
Themes
BuddyPress
Jobs
Learn
Ideas
bbPress
WordPress.com
Follow
Matt
Suka
Privacy
939rb
10R+
License / GPLv2