Posts, pages... (category)

edit_post_link()

Displays the edit post link for a post, if the user is allowed to change the post.

get_delete_post_link()

Retrieves the delete posts link for post.

get_edit_post_link()

Gets the link (URL) to edit post in the admin panel.

get_permalink()

Gets a permanent link to the current or specified post, for further use in php.

get_post_field()

Gets the value of any post field based on the transmitted post ID: post_type, post_status, post_content ...

get_post_status()

Retrieve the post status based on the Post ID.

get_post_time()

Gets the time of the current post creation in the specified format. You can specify a return format (the default is Unix format). Must be used in WordPress loop.

get_sample_permalink()

Get a sample permalink based off of the post name.

get_the_content()

Gets the content of the current post. Must be used inside the WordPress loop.

get_the_date()

Gets the creation date of the current post. you can specify an arbitrary date output format. Used in a WordPress loop.

get_the_excerpt()

Retrieves the excerpt of current or defined post. By default, should be used in WordPress Loop.

get_the_ID()

Retrieve the ID of the current post in the WordPress Loop. Can be used only inside the loop.

get_the_modified_date()

Retrieve the date on which the post was last modified.

get_the_modified_time()

Retrieve the time at which the post was last modified. Works similar to get_the_modified_date().

get_the_permalink()

Gets, rather than displays, the URL of the post that is currently being processed in the Loop. Template tag.

get_the_time()

Gets the time at which the current post was written in the specified format. Used inside the Loop of WordPress.

get_the_title()

Gets the title of the post for further use in php. You can specify the post whose title you want to get.

get_the_title_rss()

Retrieve the current post title for the feed.

has_excerpt()

Whether the post has a custom excerpt.

post_password_required()

Whether post requires password and correct password has been provided.

register_post_status()

Register a post status. Do not use before init.

single_post_title()

Displays or retrieve page title for post. Designed for use on individual post pages.

the_author()

Display the name of the author of the current post.

the_content()

Display the post content. It is template tag and must be used inside the loop.

the_date()

Displays or Retrieve the date of the current post was written. Works with a group of posts (published on the same day).

the_excerpt()

Displays the excerpt (quote) of the post, with [...] at the end (but this is not a link to reading the full material).

the_excerpt_rss()

Display the post excerpt for the feed.

the_ID()

Display the ID of the current post in the WordPress Loop.

the_modified_date()

Display the date on which the post was last modified.

the_permalink()

Displays link (URL) to the post that is currently being processed in the Loop.

the_time()

Display the time (date) at which the post was written in the specified format.

the_title()

Display the current post title with optional HTML markup. It is accepted to use inside the WordPress Loop.

the_title_attribute()

Displays the title of the post prepared (sanitized) for use in the HTML attributes of HTML tag.

Post meta (custom fields)

add_post_meta()

Adds meta field to the specified post.

delete_post_meta()

Remove metadata matching criteria from a post.

get_post_custom()

Retrieve post meta fields, based on post ID.

get_post_custom_keys()

Retrieve meta field names for a post.

get_post_custom_values()

Retrieve values for a custom post field.

get_post_meta()

Gets the value of the specified custom field of the post. Also can get an array of all post meta fields.

register_post_meta()

Registers a meta key for posts (post custom field).

the_meta()

Display list of post custom fields.

update_post_meta()

Updates specified meta field of specified post. Or adds it, if it's not exists.

Custom Types

add_post_type_support()

Register support of certain features for a post type.

get_post_permalink()

Retrieves the permalink for a post of a custom post type.

get_post_type()

Retrieves the post type of the current post or of a given post.

get_post_type_archive_link()

Retrieves the permalink for a post type archive.

get_post_type_object()

Retrieves a post type object by name.

get_post_types()

Gets data (objects) of registered post types. Not the posts themselves, but the post types data.

get_the_post_type_description()

Retrieves the description for a post type archive.

is_post_type_archive()

Checks if current user is on the archive page of custom post type.

is_post_type_hierarchical()

Checks if the post type is hierarchical.

is_post_type_viewable()

Determines whether a post type is considered "viewable".

post_type_archive_title()

Display or retrieve title for a post type archive.

post_type_exists()

Determines whether the specified post type is registered.

post_type_supports()

Check a post type's support for a given feature.

register_post_type()

Creates a new post type or changes an existing one.

remove_post_type_support()

Remove support for a feature from a post type.

set_post_type()

Update the post type for the post ID.

unregister_post_type()

Unregisters (deletes) a post type.

Other

comments_open()

Whether the current post is open for comments.

get_extended()

Divides content into 2 parts: before <!--more--> and after it. Returns an array with the resulting parts.

get_lastpostdate()

Retrieve the date that the last post was published.

get_lastpostmodified()

Get the timestamp of the last time any post was modified.

get_post_embed_html()

Retrieves the embed code for a specific post.

get_post_embed_url()

Retrieves the URL to embed a specific post in an iframe.

get_post_parent()

Retrieves the parent post object for the given post.

get_post_stati()

Get a list of post statuses.

get_post_status_object()

Retrieve a post status object by name.

get_post_statuses()

Retrieve all of the WordPress supported post statuses.

get_post_timestamp()

Retrieves post published or modified time as a Unix timestamp.

has_post_parent()

Returns whether the given post has a parent post.

is_sticky()

Checks if the current post is attached to the top of the home page posts query. Conditional tag.

pings_open()

Whether the current post is open for pings.

post_exists()

Determine if a post with the specified title (post_title) exists. In addition, for the check, you can pass post_content and post_date.

sanitize_post()

Sanitize every post field.

the_shortlink()

Displays the shortlink for a post.

url_to_postid()

Gets post, page ID by transmitted URL. Examine a URL and try to determine the post ID it represents.

wp_embed_register_handler()

Registers an embed handler.

WP_Embed::delete_oembed_caches()

Delete all oEmbed caches. Unused by core as of 4.0.0.

wp_get_canonical_url()

Returns the canonical URL for a post.

wp_get_shortlink()

Returns a shortlink for a post, page, attachment, or site.

wp_oembed_add_provider()

Adds a URL format and oEmbed provider URL pair.

wp_transition_post_status()

Fires action hooks related to the transitioning of a post's status. (from draft to publish, from publish to private, etc.).

Navigation

get_adjacent_post()

Gets the object of the adjacent (next or previous) post from the specified taxonomy (the default is category).

get_adjacent_post_link()

Gets the adjacent (next/previous) post link (HTML tag A) from the specified taxonomy (the default is category).

get_boundary_post()

Retrieves the first or last post of the site (by publish date).

get_next_post()

Retrieves the next post (as object) from the specified taxonomy (the default is category).

get_next_post_link()

Gets a link (tag A) to the next post relative (by date) to the current post.

get_previous_post()

Retrieves the previous post (as object) from the specified taxonomy (the default is category).

get_previous_post_link()

Gets a link (tag A) to the previous post relative (by date) to the current post.

get_the_post_navigation()

Gets the navigation links (HTML) to the next and previous posts. Uses on a single post page: is_singular().

next_post_link()

Displays a link (tag A) to the next post relative (by date) to the current post from the specified taxonomy (the default is category).

previous_post_link()

Displays a link to the previous (by date) post from the specified taxonomy (the default is category).

the_post_navigation()

Displays the HTML block of links to the next and previous posts. Uses on a single post page: is_singular().

Pages

get_all_page_ids()

Get a list of page IDs.

get_page_by_path()

Retrieves a page given its path.

get_page_children()

Identify descendants of a given page ID in a list of page objects.

get_page_link()

Retrieves the permalink for the current page or page ID.

get_page_template_slug()

Gets the specific template name for a given post.

get_page_uri()

Build the URI path for a page.

get_pages()

Retrieve pages data (or hierarchical post type data) as an array of posts objects. Caches the result in object cache.

get_post_ancestors()

Retrieve ancestors of a post.

page_template_dropdown()

Print out option HTML elements for the page templates drop-down.

parent_dropdown()

Print out option HTML elements for the page parents drop-down.

wp_dropdown_pages()

Retrieve or display list of pages as a dropdown (select list).

wp_link_pages()

The formatted output of a list of pages.

wp_list_pages()

Retrieve or display list of pages (or hierarchical post type items) in list (li) format.

wp_page_menu()

Displays or retrieves a list of pages with an optional home link.

Insert, delete, update

get_default_post_to_edit()

Default post information to use when populating the "Write Post" form.

wp_delete_post()

Trash or delete from the database specified post. The post can be of any type: post, attachment, page, custom type.

wp_insert_post()

Safely insert/update post in the database.

wp_publish_post()

Publish a post by transitioning the post status.

wp_trash_post()

Move a post or page to the Trash

wp_update_post()

Updates a post with new post data in WordPress Database. To work as expected, it is necessary to pass the ID of the post to be updated.

Queries

get_page_by_title()

Retrieve any type of post (page, post, custom type) by given title.

get_post()

Gets the data of the current or specified post. You need to specify post ID, or the function will return the current post. Returns a WP_Post object.

get_posts()

Gets an array of posts (pages, attachments, custom post types) from the database. You can specify any criteria for getting the posts.

have_posts()

Checks if global $wp_query has posts to process. Conditional tag.

in_the_loop()

Determines whether the caller is in The Loop (i.e. whether the loop is currently active). A conditional tag that is used to execute code only inside The Loop.

is_404()

Checks whether the 404 error page is displayed (HTTP 404: page not found). Conditional tag.

is_archive()

Conditional tag. Return true when any of the archive pages are shown (Year, Category, Author, Post Type archive...).

is_attachment()

Is the query for an existing attachment page?

is_author()

Is the query for an existing author archive page?

is_category()

Conditional tag. Checks whether the category page is displayed or not.

is_date()

Determines whether the date archive page is displayed. Conditional tag.

is_day()

Determines whether a day archive page is shown (example.com/2009/08/05) — page with posts for a specific day. A conditional tag.

is_feed()

Is the query for a feed?

is_front_page()

Checks whether the main (home) page of the site is displayed. Conditional tag.

is_home()

The conditional tag that checks if the page with the last posts is displayed, usually it is the main page of the site or the blog homepage.

is_main_query()

Is the query the main query?

is_month()

Determines whether a monthly archive page is shown (example.com/2009/08) — page with posts for a specific month. A conditional tag.

is_new_day()

Whether the publish date of the current post in the loop is different from the publish date of the previous post in the loop.

is_page()

Checks whether a "static page" is displaying. You can specify an ID, name, or page title to check a specific page. Conditional tag.

is_paged()

Checks whether the pagination page is displayed (page type /page/2, /page/3). Conditional tag.

is_preview()

Is the query for a post or page preview?

is_search()

Works when the search results page is displayed. Conditional tag.

is_single()

Checks whether a post page (of any post type) is displayed. Posts with attachment and page post types will not be checked. Conditional tag.

is_singular()

Checks whether the post page is viewed (post, page, attachment, any post type). Conditional Tag.

is_tag()

Is the query for an existing tag archive page?

is_tax()

Works on the custom taxonomy archive page. Conditional tag.

is_time()

Determines whether the query is for a time-based archive page (page of posts for the specified time). A conditional tag.

is_year()

Determines whether a year archive page is shown (example.com/2009) — page with posts for a specific year. A conditional tag.

query_posts()

Sets up The Loop with query parameters.

rewind_posts()

Rewind the loop posts.

setup_postdata()

Sets up all urgent data of the post (except global $post variable).

the_post()

Sets the next post to the global $post variable. Also sets all post data with setup_postdata().

wp_count_posts()

Gets the number of posts of any post type and any status (publish, draft).

wp_get_recent_posts()

Retrieve the last posts of the website, including drafts, scheduled, and posts on moderation. Gets the last 10 posts only.

wp_reset_postdata()

Restores the global $post variable to the correct state: to correspond the current page.

wp_reset_query()

Invalidates (destroys) the data of the last query created for use in an arbitrary WordPress Loop and restores the default loop data.

Formats

get_post_format()

Retrieve the format slug for a post

has_post_format()

Check if a post has any of the given formats, or any format.

set_post_format()

Assign a format to a post

Revisions

wp_delete_auto_drafts()

Delete auto-drafts for new posts that are more than 7 days old.

wp_delete_post_revision()

Deletes a revision.

wp_get_post_revision()

Gets a post revision by revision's ID. If there is no such revision, null will be returned.

wp_get_post_revisions()

Returns all revisions of specified post.

wp_is_post_autosave()

Determines if the specified post is an autosave.

wp_is_post_revision()

Determines if the specified post is a revision.

wp_revisions_enabled()

Determine if revisions are enabled for a given post.

wp_revisions_to_keep()

Determine how many revisions to retain for a given post.

wp_save_post_revision()

Creates a revision for the current version of a post.

wp_text_diff()

Displays a human readable HTML representation of the difference between two strings.