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()

Gets the link (URL) to delete a post.

get_edit_post_link()

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

get_permalink()

Gets the permalink for a 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()

Gets the status of the specified post: publish, draft, etc.

get_post_time()

Gets the publication time of the post in the specified format (default is unix timestamp). Used inside the WordPress loop.

get_sample_permalink()

Gets a sample of the permalink (permalink) of a post.

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()

Gets the date (time) when 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()

Gets the post title. Used when displaying the title in the RSS feed. Used in The Loop.

has_excerpt()

Checks if the current post has an excerpt (quote, short description). Conditional tag.

post_password_required()

Checks if the post is password protected or not. Also checks the correctness of the password if a password is set for the post.

register_post_status()

Function for creating a new or editing an old post status, based on the provided parameters.

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()

Displays a brief description of the post (quote) or the first 55 words of the content. Used within the WordPress Loop.

the_ID()

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

the_modified_date()

Outputs the time (date) when the post was 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()

Deletes all custom fields (meta-fields) with the specified key for the specified post.

get_post_custom()

Gets a multidimensional array with data from all custom fields of the current post.

get_post_custom_keys()

Gets an array of keys of custom fields belonging to the current post.

get_post_custom_values()

Gets an array of values of custom fields with the specified name for the specified post.

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()

Outputs custom fields of a post (metadata from wp_postmeta). The fields are displayed in a list <li>. Hidden fields are ignored.

update_post_meta()

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

Custom Types

add_post_type_support()

Adds support for additional features (functions) for the post type.

get_post_permalink()

Gets the URL (permalink) of a custom post type.

get_post_type()

Gets the post type by the given ID (post, page, attachment).

get_post_type_archive_link()

Returns the URL (permalink) to the archive page of a custom post type.

get_post_type_object()

Gets the object (data) of the specified post type: post, page, attachment, or new post type. The object contains all parameters (settings) of the post type.

get_post_types()

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

get_the_post_type_description()

Gets the description of the current archive page for the post type.

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 the specified post type is public (accessible for viewing on the front end of the site). You need to specify an object of the post type.

post_type_archive_title()

Outputs or returns the title for the archive page of a custom post type.

post_type_exists()

Determines whether the specified post type is registered.

post_type_supports()

Checks if the post type supports the specified feature (meta-box): title, editor, author, thumbnail...

register_post_type()

Creates a new post type or changes an existing one.

remove_post_type_support()

Removes the registered capability from the specified post type.

set_post_type()

Updates the post type for the specified post (record). For example: post >> page.

unregister_post_type()

Cancels the registration of the specified post type. Deletes the post type.

Other

comments_open()

Checks if commenting is open for the specified post.

get_extended()

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

get_lastpostdate()

Gets the date and time when the last post was published on the site.

get_lastpostmodified()

Gets the date and time when the specified type of post was last edited.

get_post_embed_html()

Gets the ready HTML code for embedding the specified post using oEmbed. This code is intended to be used for embedding the post on another resource.

get_post_embed_url()

Gets the URL to be used in an iframe for embedding the specified post on another site (oEmbed format).

get_post_parent()

Gets the parent post object for the specified or current post in the loop.

get_post_stati()

Gets all existing post statuses as an array of names or an array of objects.

get_post_status_object()

Gets the data object of the specified post status.

get_post_statuses()

Returns an array of the following basic post statuses: Draft, Pending, Private, Publish.

get_post_timestamp()

Gets the publication or modification time of a post as a Unix timestamp (1270995315).

has_post_parent()

Checks if there is a parent post for the specified or current post in the loop.

is_sticky()

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

pings_open()

Checks if the current post is allowed to receive pings. Conditional tag.

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()

Clears each field of the specified post object/array.

the_shortlink()

Outputs a short link to the current post, for example: /?p=1234.

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. This is a handler that turns a link in the content into HTML code.

WP_Embed::delete_oembed_caches()

Deletes all oEmbed cache for the specified post.

wp_get_canonical_url()

Gets the canonical URL of a post.

wp_get_shortlink()

Returns a short link to a post.

wp_oembed_add_provider()

Adds an oEmbed provider. This is a URL that will be parsed in the content to output HTML code from another site.

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()

Gets the ID of all permanent pages of type page.

get_page_by_path()

Gets the post by the specified path of this page: parent-page/sub-page. The result is cached.

get_page_children()

Collects child pages from the provided array of pages. All levels of nesting are processed.

get_page_link()

Gets the URL (link) of a permanent WordPress page (post type page).

get_page_template_slug()

Gets the name of the PHP file that is set as the template for the specified post.

get_page_uri()

Gets the path (URL without the domain) to the specified permanent page. It collects the slugs of the current and all parent pages and combines them with a slash /.

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()

Gets the IDs of all parent posts for the specified one as an array.

page_template_dropdown()

Gets the template files for the specified post type and outputs them on the screen as <option> elements for the form select field.

parent_dropdown()

Gets a list of child pages of the specified parent page. Outputs an HTML list of <option> elements for the <select> element.

wp_dropdown_pages()

Outputs a dropdown list of static pages (list in the <select> tag).

wp_link_pages()

Outputs navigation links for paginated posts (the separator used is <!--nextpage-->, one or more times in the content).

wp_list_pages()

Outputs a list of static pages as links.

wp_page_menu()

Outputs a list of static blog pages as links to the corresponding pages. An analogue of wp_list_pages(), but there is an option to add a "home" link at the beginning.

Insert, delete, update

get_default_post_to_edit()

Gets default data for the post form when adding a new post in the admin panel.

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 inserts/updates a post in the database.

wp_publish_post()

Publishes a post. Changes its status from future, draft, etc. to publish. Triggers all hooks necessary for changing the post status.

wp_trash_post()

Moves the specified post to the trash. If the trash is disabled, the post will be permanently deleted.

wp_update_post()

Updates a post with new post data in WordPress Database.

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()

Checks if the current page is an attachment page. Conditional Tag.

is_author()

Checks if the author's posts page is displayed. You can specify a specific author. Conditional tag.

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()

Checks if a feed is being requested at the current moment.

is_front_page()

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

is_home()

Checks whether the page showing posts is being displayed, usually this is the site's front page. Conditional tag.

is_main_query()

Checks if the action is being executed in the main WordPress loop. Conditional tag.

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()

Checking the difference between the current date and the previous one (in a loop). Conditional tag.

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()

Check if the user is on the post preview page. Conditional tag

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()

Check if the tag archive page is displayed. Conditional tag.

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()

WordPress is used when retrieving posts for the current page (author archive, single post, category, tag).

rewind_posts()

Rewinds the loop to the beginning.

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()

Gets the format of the current or specified post: quote, video, audio.

has_post_format()

Checks for the presence of the specified format for a post. Conditional tag.

set_post_format()

Sets the format for 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 post revision by ID.

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()

Gets all revisions (edits, changes) of the specified post.

wp_is_post_autosave()

Determines whether the specified post is an autosave.

wp_is_post_revision()

Determines whether the specified post is a revision.

wp_revisions_enabled()

Check if revisions are enabled for the specified post.

wp_revisions_to_keep()

Defines how many of the latest revisions (changes) should be stored in the database for a specific post.

wp_save_post_revision()

Creates a revision (copy) of the specified post. It also deletes excess revisions.

wp_text_diff()

Gets a human-readable HTML table with differences between two provided strings (texts). Used for comparing changes in post revisions.