WordPress Functions Reference

Essential Functions Every PHP Developer Should Know

Core WordPress Functions

Basic Info

get_bloginfo() home_url() site_url() admin_url() wp_get_theme() get_template_directory() get_stylesheet_directory()

Content Functions

the_content() get_the_content() the_title() get_the_title() the_excerpt() get_the_excerpt() the_permalink() get_permalink()

Loop Functions

have_posts() the_post() wp_reset_postdata() wp_reset_query() rewind_posts()

Database Functions

Query Functions

get_posts() wp_query() get_post() get_page() get_post_meta() update_post_meta() delete_post_meta() add_post_meta()

User Functions

get_users() get_user_by() get_current_user_id() wp_get_current_user() get_user_meta() update_user_meta() is_user_logged_in()

Options API

get_option() update_option() add_option() delete_option() get_site_option() update_site_option()

Hooks & Filters

Action Hooks

add_action() remove_action() do_action() has_action() wp_head wp_footer init wp_enqueue_scripts

Filter Hooks

add_filter() remove_filter() apply_filters() has_filter() the_content the_title wp_nav_menu_items

Common Hooks

wp_loaded template_redirect wp_ajax_ wp_ajax_nopriv_ save_post pre_get_posts

Security Functions

Sanitization

sanitize_text_field() sanitize_email() sanitize_url() sanitize_title() wp_kses() wp_kses_post() esc_html() esc_attr()

Validation

wp_verify_nonce() wp_create_nonce() check_admin_referer() current_user_can() is_admin() wp_die()

Escaping

esc_url() esc_js() esc_sql() esc_textarea() wp_strip_all_tags()

Theme Functions

Template Functions

get_header() get_footer() get_sidebar() get_template_part() locate_template() load_template()

Enqueue Functions

wp_enqueue_style() wp_enqueue_script() wp_register_style() wp_register_script() wp_dequeue_style() wp_dequeue_script()

Theme Support

add_theme_support() remove_theme_support() current_theme_supports() register_nav_menus() wp_nav_menu()

Utility Functions

Conditional Tags

is_home() is_front_page() is_single() is_page() is_category() is_tag() is_archive() is_search()

Date & Time

current_time() get_the_date() get_the_time() human_time_diff() wp_date()

Media Functions

wp_get_attachment_image() wp_get_attachment_url() get_the_post_thumbnail() has_post_thumbnail() wp_insert_attachment()

Debugging

wp_debug_log() error_log() var_dump() print_r() wp_die()
Wesley Classen
Wesley's AI Assistant Usually replies in ~15 min Ask me anything — if I can't answer, Wesley gets pinged and replies personally.
Hello! I'm Wesley's AI assistant. How can I help you today?