# Wordpress Cheat sheet

<div class="entry" id="bkmrk-theme-headers%C2%A0style." style="box-sizing: inherit; display: flex; justify-content: space-between; flex-wrap: wrap; padding: 0px 30px; color: rgb(33, 33, 33); font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen-Sans, Ubuntu, Arial, sans-serif; font-size: 14.0625px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" x-data="{ isAllOpened: true }"><div class="left_sections" style="width: 100%;"><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Theme Headers `style.css`

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[style.css Headers](https://wp-kama.ru/handbook/themes/style-css)</div>```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg>/**
 * Theme Name:  My theme (required)
 * Template:    The name of the parent theme. E.g. Twenty Seventeen
 * Description: A short description of the theme.
 *
 * Theme URI:   Subject URL. E.g. http://wordpress.org/themes/twenty
 * Author:      Kama
 * Author URI:  https://wp-kama.com
 *
 * Tags:        black, brown, orange
 * Text Domain: Subject translation domain. E.g. twentythirteen
 *
 * License:     License. E.g. GNU General Public License v2 or later
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Version:     1.0
 */
```

</section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## .htaccess code

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg># BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
```

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[mod\_rewrite\_rules](https://wp-kama.com/hook/mod_rewrite_rules)[save\_mod\_rewrite\_rules()](https://wp-kama.com/function/save_mod_rewrite_rules)[insert\_with\_markers()](https://wp-kama.com/function/insert_with_markers)[WP\_Rewrite::mod\_rewrite\_rules()](https://wp-kama.com/function/WP_Rewrite::mod_rewrite_rules)</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Theme Files `(include)`

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Theme files include functions](https://wp-kama.com/function-cat/theme-files)- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> get\_header()<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>header.php.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> get\_template\_part('file')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>file.php.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> get\_search\_form()<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Search form searchform.php.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> comments\_template()<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Comments form comments.php.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> get\_sidebar()<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>sidebar.php.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> get\_footer()<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>footer.php.*
- 
- *[get\_template\_directory()](https://wp-kama.com/function/get_template_directory "$tpl_dir = get_template_directory();
    ")The path to the parent theme (not child). No trailing /.*
- *[get\_stylesheet\_directory()](https://wp-kama.com/function/get_stylesheet_directory "get_stylesheet_directory();
    ")Theme Path (where parent/child style.css). No trailing /.*
- *[get\_parent\_theme\_file\_path()](https://wp-kama.com/function/get_parent_theme_file_path "get_parent_theme_file_path( $file = '' );
    ")File path of parent theme (not child).*
- *[get\_theme\_file\_path()](https://wp-kama.com/function/get_theme_file_path "$filepath = get_theme_file_path( $file );
    ")File path of parent/child theme.*
- *[load\_template()](https://wp-kama.com/function/load_template "load_template( $_template_file, $require_once, $args );
    ")Includes file (require\_once).*
- *[locate\_template()](https://wp-kama.com/function/locate_template "locate_template( $template_names, $load, $require_once, $args );
    ")Finds/Includes parent/child theme file.*
- 
- *[get\_template\_directory\_uri()](https://wp-kama.com/function/get_template_directory_uri)URL of parent theme (not child). No trailing /.*
- *[get\_stylesheet\_directory\_uri()](https://wp-kama.com/function/get_stylesheet_directory_uri "$theme_url = get_stylesheet_directory_uri();
    ")Theme URL (child theme if it exists). No trailing /.*
- *[get\_theme\_root\_uri()](https://wp-kama.com/function/get_theme_root_uri "get_theme_root_uri( $stylesheet_or_template, $theme_root );
    ")URL of the theme's DIR. No trailing /.*
- *[get\_stylesheet\_uri()](https://wp-kama.com/function/get_stylesheet_uri)URL of the theme's style.css file.*
- *[get\_theme\_file\_uri()](https://wp-kama.com/function/get_theme_file_uri "get_theme_file_uri( $file );
    ")URL of the parent/child theme file.*
- *[get\_parent\_theme\_file\_uri()](https://wp-kama.com/function/get_parent_theme_file_uri "get_parent_theme_file_uri( $file );
    ")URL of the parent theme file.*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Theme Files `(hierarchy)` `/themes/THEME/`

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Theme Files Hierarchy](https://wp-kama.com/67/theme-files-hierarchy)- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">style*.css*</var>Theme styles file (required)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">index*.php*</var>Any page without a template file (required)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">front-page*.php*</var>Front (Home) page*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">home*.php*</var>Posts page (or Home page)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">functions*.php*</var>A special file for php functions (code)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">404*.php*</var>Page **"not found"***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">comments*.php*</var>**Comments** Template (part)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">header*.php*</var>**Site Header** Template (part)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">searchform*.php*</var>**Search Form** Template (part)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">sidebar*.php*</var>**Sidebar** Template (part)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">footer*.php*</var>**Site Footer** Template (part)*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">single*.php*</var>Post page **post\_type = post***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">single-POST\_TYPE*.php*</var>Post page **post\_type = POST\_TYPE***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">single-POST\_TYPE-POST\_NAME*.php*</var>Post page with **POST\_NAME and POST\_TYPE***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">singular*.php*</var>Post of **any post type***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">page*.php*</var>Page **post\_type = page***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">page-POST\_NAME*.php*</var>Page **post\_name = POST\_NAME***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">page-ID*.php*</var>Page **ID = ID***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">attachment*.php*</var>Any **attachment** page*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">image*.php*</var>Image **attachment** page*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">archive*.php*</var>Page of **any archive***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">archive-POST\_TYPE*.php*</var>Page of **post type archive***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">search*.php*</var>**Search** page*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">category*.php*</var>Any **Category** page*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">category-SLUG*.php*</var>Category page with **slug = SLUG***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">category-ID*.php*</var>Category page with **term\_id = id***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">tag*.php*</var>Any **Tag** page*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">tag-SLUG*.php*</var>Tag page with **slug = SLUG***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">tag-ID*.php*</var>Tag page with **term\_id = id***
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">taxonomy*.php*</var>Any **custom taxonomy element** page*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">taxonomy-TAXONOMY*.php*</var>Page of any term of TAXONOMY taxonomy*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">taxonomy-TAXONOMY-SLUG*.php*</var>Page of SLUG term of TAXONOMY taxonomy*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">author*.php*</var>Page of **Author posts***

</div>A post template from any file:

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php
/*
Template Name: My page template
Template Post Type: post, page, product
*/

// … template file code
```

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Read more about post templates](https://wp-kama.com/63/page-template-for-any-post-type-in-wp-4-7)</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Site Information `bloginfo`

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">- *[bloginfo()](https://wp-kama.com/function/bloginfo "bloginfo( $show );
    ")Displays **information about the site**.*
- *[get\_bloginfo()](https://wp-kama.com/function/get_bloginfo "get_bloginfo( $show, $filter );
    ")Gets **information about the site**.*
- 
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('name')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Site name.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('description')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Short description of the site.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('template\_url')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Theme URL: [get\_template\_directory()](https://wp-kama.com/function/get_template_directory).*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('template\_directory')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Same as template\_url.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('stylesheet\_directory')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Theme URL: [get\_stylesheet\_directory\_uri()](https://wp-kama.com/function/get_stylesheet_directory_uri).*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('stylesheet\_url')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Theme file style.css URL: [get\_stylesheet\_uri()](https://wp-kama.com/function/get_stylesheet_uri).*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('charset')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>The site's encoding: UTF-8.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('html\_type')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Content-Type of the page: text/html.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('language')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Site locale (language): RU.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('version')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>WordPress version: 5.5.3.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('rss2\_url ')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>URL of the feed: /feed.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('comments\_rss2\_url')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>URL of the comments feed: /comments/feed.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('admin\_email')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>E-mail of Admin.*
- 
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('pingback\_url')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Notification URL to the xmlrpc.php file.*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('rdf\_url')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>RDF/RSS 1.0 feed URL (/feed/rfd).*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('rss\_url')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>RSS 0.92 feed URL (/feed/rss).*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('atom\_url ')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Atom feed URL (/feed/atom).*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('url')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Home page URL. Alias [home\_url()](https://wp-kama.com/function/home_url).*
- *<var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;"><span style="box-sizing: inherit; color: rgb(170, 170, 170);">&lt;?php</span> bloginfo('wpurl')<span style="box-sizing: inherit; color: rgb(170, 170, 170);">; ?&gt;</span></var>Admin panel URL. Alias [site\_url()](https://wp-kama.com/function/site_url).*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Comment Loop

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">- *[comment\_ID()](https://wp-kama.com/function/comment_ID "<?php comment_ID(); ?>
    ")Displays the ID of the current comment.*
- *[comments\_popup\_link()](https://wp-kama.com/function/comments_popup_link "comments_popup_link( $zero, $one, $more, $css_class, $none);
    ")Displays &lt;a&gt; link to the comment popup.*
- *[comment\_text()](https://wp-kama.com/function/comment_text "<?php comment_text( $comment_ID, $args ); ?>
    ")Displays the text of the comment.*
- *[comment\_author()](https://wp-kama.com/function/comment_author "<?php comment_author( $comment_ID ); ?>
    ")Displays the comment author name.*
- *[comments\_link()](https://wp-kama.com/function/comments_link "<?php comments_link(); ?>
    ")Displays a URL to the post comment form.*
- *[comment\_reply\_link()](https://wp-kama.com/function/comment_reply_link "<?php comment_reply_link( $args, $comment, $post ); ?>
    ")Displays a &lt;a&gt; link that allows you to reply to comments.*
- *[comment\_time()](https://wp-kama.com/function/comment_time "comment_time( $d );
    ")Displays the comment publishing time.*
- *[comment\_author\_link()](https://wp-kama.com/function/comment_author_link "<?php comment_author_link( $comment_ID ); ?>
    ")Displays the comment author's name as a link.*
- *[comment\_author\_url()](https://wp-kama.com/function/comment_author_url "<?php comment_author_url( $comment_ID ); ?>
    ")Displays comment author URL (sets when commenting).*
- *[comment\_author\_url\_link()](https://wp-kama.com/function/comment_author_url_link "<?php comment_author_url_link($linktext, $before, $after); ?>
    ")Displays comment author link (A tag).*
- *[comment\_author\_email\_link()](https://wp-kama.com/function/comment_author_email_link)Displays comment author email as a mailto link.*
- *[edit\_comment\_link()](https://wp-kama.com/function/edit_comment_link "<?php edit_comment_link( $link, $before, $after ); ?>
    ")Displays edit comment link.*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## The Loop

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[The Loop](https://wp-kama.com/1572/the-loop)[3 ways to Create Loop in WordPress](https://wp-kama.com/1573/3-ways-to-create-loop)- *[in\_the\_loop()](https://wp-kama.com/function/in_the_loop "if( in_the_loop() ){
    // we inside the loop...
    }
    ")Checks if the WordPress loop is active.*
- *[have\_posts()](https://wp-kama.com/function/have_posts "// not loop
    if( have_posts() ){
    // ...
    } // loop
    while ( have_posts() ) {
    the_post();     // ...
    }
    ")Checks if there are posts for the loop.*
- *[the\_post()](https://wp-kama.com/function/the_post)Sets the next post in the loop and global $post.*
- *[setup\_postdata()](https://wp-kama.com/function/setup_postdata "global $post;
    setup_postdata( $post );
    ")Sets global $post.*
- *[the\_ID()](https://wp-kama.com/function/the_ID "<?php the_ID(); ?>
    ")Displays the ID of the current post.*
- *[the\_title()](https://wp-kama.com/function/the_title "the_title( $before, $after, $echo );
    ")Displays current post title.*
- *[the\_title\_attribute()](https://wp-kama.com/function/the_title_attribute)Displays post title for html tag attribute.*
- *[the\_content()](https://wp-kama.com/function/the_content "<?php the_content( $more_link_text, $strip_teaser ); ?>
    ")Displays post content.*
- *[the\_excerpt()](https://wp-kama.com/function/the_excerpt "<?php the_excerpt(); ?>
    ")Displays the excerpt (quote) of the post, with \[...\] at the end.*
- *[the\_excerpt\_rss()](https://wp-kama.com/function/the_excerpt_rss "<?php the_excerpt_rss(); ?>
    ")Displays the excerpt (quote) (for RSS).*
- *[get\_permalink()](https://wp-kama.com/function/get_permalink "$url = get_permalink( $post, $leavename );
    ")Gets post URL.*
- *[the\_permalink()](https://wp-kama.com/function/the_permalink)Displays post URL.*
- *[comments\_number()](https://wp-kama.com/function/comments_number "<?php comments_number( $zero, $one, $more, $post_id ); ?>
    ")Displays post's number of comments.*
- *[edit\_post\_link()](https://wp-kama.com/function/edit_post_link)Displays edit post link (A html tag).*
- 
- *[the\_date()](https://wp-kama.com/function/the_date "<?php the_date( $d, $before, $after, $echo ); ?>
    ")Displays/retrieves post publication date.*
- *[get\_the\_date()](https://wp-kama.com/function/get_the_date)Gets the post creation date.*
- *[the\_time()](https://wp-kama.com/function/the_time "<?php the_time( $d ); ?>
    ")Displays post publication date.*
- *[get\_post\_time()](https://wp-kama.com/function/get_post_time "get_post_time( $d, $gmt, $post, $translate );
    ")Gets time (date) of post publication.*
- *[the\_modified\_date()](https://wp-kama.com/function/the_modified_date "<?php the_modified_date( $format, $before, $after, $display ); ?>
    ")Displays time (date) when post was changed.*
- 
- *[the\_post\_thumbnail()](https://wp-kama.com/function/the_post_thumbnail "<?php the_post_thumbnail( $size, $attr ); ?>
    ")Displays html code of post thumbnail image.*
- *[get\_post\_thumbnail\_id()](https://wp-kama.com/function/get_post_thumbnail_id)Gets the post thumbnail ID.*
- *[has\_post\_thumbnail()](https://wp-kama.com/function/has_post_thumbnail "<?php has_post_thumbnail( $post_id ); ?>
    ")Whether or not the post has a thumbnail. Conditional tag.*
- *[the\_post\_thumbnail\_url()](https://wp-kama.com/function/the_post_thumbnail_url "<?php the_post_thumbnail_url( $size ); ?>
    ")Displays the URL of the post thumbnail.*
- *[the\_attachment\_link()](https://wp-kama.com/function/the_attachment_link "<?php the_attachment_link( $id, $fullsize, $deprecated, $permalink ); ?>
    ")Displays the link (A tag) of the attachment or the attachment page.*
- *[get\_attachment\_link()](https://wp-kama.com/function/get_attachment_link "$attachment_page = get_attachment_link( $id );
    ")Gets the URL to the attachment page.*
- *[wp\_get\_attachment\_link()](https://wp-kama.com/function/wp_get_attachment_link)Gets the link (A tag) of the attachment or the attachment page.*
- 
- *[the\_tags()](https://wp-kama.com/function/the_tags)Displays links to the post tags.*
- *[the\_category()](https://wp-kama.com/function/the_category)Displays post categories as links.*
- *[the\_taxonomies()](https://wp-kama.com/function/the_taxonomies "<?php the_taxonomies( $args ); ?>
    ")Displays links &lt;a&gt; to the post terms.*
- *[in\_category()](https://wp-kama.com/function/in_category "if( in_category( $category, $post ) ){
    // ...
    }
    ")Checks if the post belongs to a category.*
- *[sticky\_class()](https://wp-kama.com/function/sticky_class "<?php sticky_class(); ?>
    ")Displays a "sticky" class if it is a sticky post.*
- *[is\_sticky()](https://wp-kama.com/function/is_sticky "<?php
    if( is_sticky( $post_ID ) ){
    // ...
    }
    ?>
    ")Checks if the post is sticky to the home page.*
- *[the\_meta()](https://wp-kama.com/function/the_meta "<?php the_meta(); ?>
    ")Displays post meta-fields in &lt;li&gt; list.*
- *[get\_post\_format()](https://wp-kama.com/function/get_post_format "$format = get_post_format( $post_id );
    ")Gets the post format: quote, status, video, audio.*
- 
- *[the\_author()](https://wp-kama.com/function/the_author "<?php the_author(); ?>
    ")Displays post's author name.*
- *[get\_the\_author()](https://wp-kama.com/function/get_the_author "$author = get_the_author();
    ")Gets post's author name (display\_name).*
- *[the\_author\_link()](https://wp-kama.com/function/the_author_link "<?php the_author_link(); ?>
    ")Displays link (A tag) to the site of post's author.*
- *[get\_the\_author\_link()](https://wp-kama.com/function/get_the_author_link "get_the_author_link();
    ")Gets link (A tag) to the site of post's author.*
- *[the\_author\_posts()](https://wp-kama.com/function/the_author_posts "<?php the_author_posts(); ?>
    ")Displays the total number of posts written by the author.*
- *[the\_author\_posts\_link()](https://wp-kama.com/function/the_author_posts_link)Displays link (A tag) to the post author's archive page .*
- *[the\_author\_meta()](https://wp-kama.com/function/the_author_meta "<?php the_author_meta( $field, $user_id ); ?>
    ")Displays specified meta-field of the post author (wp user).*
- *[get\_the\_author\_meta()](https://wp-kama.com/function/get_the_author_meta "get_the_author_meta( $field, $user_id );
    ")Gets specified meta-field of the post author (wp user).*
- *[the\_modified\_author()](https://wp-kama.com/function/the_modified_author "<?php the_modified_author(); ?>
    ")Displays the name of the author who last modified the post.*

</div>```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   <!-- Post output, loop functions: the_title(), etc. -->
<?php endwhile; else: ?>
	No posts.
<?php endif; ?>
```

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php if ( have_posts() ){ while ( have_posts() ){ the_post(); ?>
	<!-- Post output, loop functions: the_title(), etc. -->
<?php } } else { ?>
	No posts.
<?php } ?>
```

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php while ( have_posts() ){ the_post(); ?>
	<!-- Post output, loop functions: the_title(), etc. -->
<?php } ?>
<?php if ( ! have_posts() ){ ?>
	No posts.
<?php } ?>
```

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php
global $post;

$myposts = get_posts([
	'numberposts' => 5,
	'offset'      => 1,
	'category'    => 1
]);

if( $myposts ){
	foreach( $myposts as $post ){
		setup_postdata( $post );
		?>
		<!-- Post output, loop functions: the_title(), etc. -->
		<?php
	}
} else {
	// No posts found
}

wp_reset_postdata(); // Reset $post
?>
```

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php
global $post;

$query = new WP_Query( [
	'posts_per_page' => 5,
	'orderby'        => 'comment_count',
] );

if ( $query->have_posts() ) {
	while ( $query->have_posts() ) {
		$query->the_post();
		?>
		<!-- Post output, loop functions: the_title(), etc. -->
		<?php
	}
} else {
	// No posts found
}

wp_reset_postdata(); // Reset $post
?>
```

</section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## WP CLI

### [Core](https://wp-kama.com/handbook/wp-cli/wp/core):

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg># Download WordPress
wp core download --locale=ru_RU

# Generate wp-config.php:
wp core config --dbname=NAME --dbuser=USER --dbpass=PASS --dbprefix=wp_

# Create DB (based on wp-config.php)
wp db create

# Install WP to created DB
wp core install --url=example.com --title=Example --admin_user=supervisor \
--admin_email=info@example.com --admin_password=strongpassword
```

### [Post](https://wp-kama.com/handbook/wp-cli/wp/post):

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg># List posts:
wp post list

# Edit post:
wp post edit 1

# Post update:
wp post update 1 --post_title="Your New title..."

# Create posts:
wp post create --post_status=publish --post_title="Second Post" --edit
```

### [Post meta](https://wp-kama.com/handbook/wp-cli/wp/post#wp-post-meta-list):

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg># See all metas of post 18:
wp post meta list 18

# Get post meta value:
wp post meta get 18 meta_name

# Delete post meta by key:
wp post meta delete 18 meta_name
```

### [DB](https://wp-kama.com/handbook/wp-cli/wp/db):

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg># Create DB dump
wp db export - --add-drop-table --default-character-set=utf8mb4 | gzip > ./db-dump-$(date +%Y-%m-%d-%H%M%S).sql.gz

# Insert data from DB dump to DB
wp db import db_backup-2022-01-20.sql

# Login WordPress db:
wp db cli

# Run SQL Query:
wp db query "SELECT user_login, ID FROM wp_users;"

# Optimize db:
wp db optimize
```

### [Update](https://wp-kama.com/handbook/wp-cli/wp/core):

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg># Update WordPress
wp core update

# Update all plugins:
wp plugin update --all
```

### [Themes](https://wp-kama.com/handbook/wp-cli/wp/theme) &amp; [Plugins](https://wp-kama.com/handbook/wp-cli/wp/plugin)

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg># List plugins:
wp plugin list

# Search plugin:
wp plugin search yoast

# Install plugin:
wp plugin install yoast

# List installed themes:
wp theme list

# Install theme:
wp theme install twentyone

# Activate theme:
wp theme activate twentyone
```

</section></div><div class="right_sections" style="box-sizing: inherit; width: 980px;"><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Plugin Headers

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Plugin Headers](https://wp-kama.com/handbook/plugin/create/plugin-headings)[readme.txt file](https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/)</div>```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php

/**
 * Plugin Name: My Plugin
 * Description: Description of the plugin (140 characters)
 *
 * Plugin URI:  URL to info about plugin
 * Author URI:  https://wp-kama.com
 * Author:      Kama
 *
 * Text Domain: Translation ID. E.g. my-plugin
 * Domain Path: Path to MO file (relative to plugin folder)
 *
 * Requires PHP: 7.0
 * Requires at least: 5.7
 *
 * License:     GPL2
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 *
 * Network:     true - activates the plugin for the whole network
 * Update URI:  https://example.com/link_to_update
 *
 * Requires Plugins: some-plugin, some-plugin-2
 *
 * Version:     1.0
 */

// plugin code
```

</section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Plugin

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Plugin Creation](https://developer.wordpress.org/plugins/)- *[register\_activation\_hook()](https://wp-kama.com/function/register_activation_hook)Registers the function **to activate the plugin**.*
- *[register\_deactivation\_hook()](https://wp-kama.com/function/register_deactivation_hook "register_deactivation_hook( $file, $function );
    ")Registers the function **to deactivate the plugin**.*
- *[register\_uninstall\_hook()](https://wp-kama.com/function/register_uninstall_hook "register_uninstall_hook( $file, $callback );
    ")Registers the function **for deleting the plugin**.*
- 
- *[plugins\_url()](https://wp-kama.com/function/plugins_url "plugins_url( $path, $plugin );
    ")Gets **URL of plugins/mu plugins folder** (no slash at the end)\*\*.*
- *[plugin\_basename()](https://wp-kama.com/function/plugin_basename)**Path to plugin file** (from plugins folder).*
- *[plugin\_dir\_path()](https://wp-kama.com/function/plugin_dir_path "plugin_dir_path( $file );
    ")Gets **Path to plugin folder** (has slash at the end).*
- *[plugin\_dir\_url()](https://wp-kama.com/function/plugin_dir_url "$url = plugin_dir_url( $file );
    ")Gets **URL of the plugin folder** (has slash at the end).*
- 
- *[get\_plugins()](https://wp-kama.com/function/get_plugins)Gets **data of plugins** (active and inactive).*
- *[get\_plugin\_data()](https://wp-kama.com/function/get_plugin_data "get_plugin_data( $plugin_file, $markup, $translate );
    ")Gets **data of the plugin from file headers**.*
- 
- *[activate\_plugins()](https://wp-kama.com/function/activate_plugins "activate_plugins( $plugins, $redirect, $network_wide, $silent );
    ")Activates plugins.*
- *[deactivate\_plugins()](https://wp-kama.com/function/deactivate_plugins "deactivate_plugins( $plugins, $silent, $network_wide );
    ")Deactivates plugins.*
- *[is\_plugin\_active()](https://wp-kama.com/function/is_plugin_active)Checks if a plugin is **active**. Works only in the admin panel.*

</div>[uninstall.php](https://wp-kama.com/handbook/plugins/osnovy/udalenie)

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg><?php
if( ! defined('WP_UNINSTALL_PLUGIN') ) exit;

// the check passed successfully. Starting from here remove all plugin data (options, db tables etc.).
delete_option( 'plug_option' );
```

</section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Script and Style

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Script &amp; Style functions](https://wp-kama.com/function-cat/scripts-and-styles)- *[wp\_register\_script()](https://wp-kama.com/function/wp_register_script "wp_register_script( $handle, $src, $deps, $ver, $in_footer );
    ")Registers the js file.*
- *[wp\_enqueue\_script()](https://wp-kama.com/function/wp_enqueue_script "wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
    ")Registers and connects the js file.*
- *[wp\_dequeue\_script()](https://wp-kama.com/function/wp_dequeue_script "wp_dequeue_script( $handle );
    ")Deletes file from the output queue.*
- *[wp\_add\_inline\_script()](https://wp-kama.com/function/wp_add_inline_script)Adds JS code to the registered script.*
- *[wp\_deregister\_script()](https://wp-kama.com/function/wp_deregister_script)Unregisters the js file.*
- *[wp\_script\_add\_data()](https://wp-kama.com/function/wp_script_add_data "wp_script_add_data( $handle, $key, $value );
    ")Adds data to the script. Example: script only for "IE 6", "lt IE 9".*
- *[wp\_localize\_script()](https://wp-kama.com/function/wp_localize_script)Adds data before the specified script.*
- *[wp\_script\_is()](https://wp-kama.com/function/wp_script_is "wp_script_is( $handle, $list );
    ")Whether the file has been registered/waiting for output.*
- 
- *[wp\_register\_style()](https://wp-kama.com/function/wp_register_style)Registers the css file.*
- *[wp\_enqueue\_style()](https://wp-kama.com/function/wp_enqueue_style "wp_enqueue_style( $handle, $src, $deps, $ver, $media );
    ")Registers and connects the css file.*
- *[wp\_dequeue\_style()](https://wp-kama.com/function/wp_dequeue_style "wp_dequeue_style( $handle );
    ")Deletes file from the output queue.*
- *[wp\_add\_inline\_style()](https://wp-kama.com/function/wp_add_inline_style "wp_add_inline_style( $handle, $data );
    ")Adds styles directly to the html document.*
- *[wp\_deregister\_style()](https://wp-kama.com/function/wp_deregister_style "wp_deregister_style( $handle );
    ")Unregisters the css file.*
- *[wp\_style\_add\_data()](https://wp-kama.com/function/wp_style_add_data "wp_style_add_data( $handle, $key, $value );
    ")Adds data to styles. Example: styles only for "IE 6", "lt IE 9".*
- *[wp\_style\_is()](https://wp-kama.com/function/wp_style_is "wp_style_is( $handle, $list );
    ")Whether the file has been registered/waiting for output.*

</div>```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg>add_action( 'wp_enqueue_scripts', 'add_my_scripts' );    // Front
add_action( 'admin_enqueue_scripts', 'add_my_scripts' ); // Admin
add_action( 'login_enqueue_scripts', 'add_my_scripts' ); // wp-login.php
function add_my_scripts(){

	if ( ! wp_script_is( 'my-script', 'enqueued' ) ) {
		// The my-script is not added to the queue
	}

	if ( ! wp_style_is( 'my-style', 'registered' ) ) {
		// Styles my-script is not registered
	}

	wp_enqueue_script( 'my-script', 'src', ['deps'], '1.0', 'in_footer' );
	wp_enqueue_style(  'my-style',  'src', ['deps'], '1.0', 'all' );

	wp_enqueue_style( 'theme-style', get_stylesheet_uri() ); // theme style.css

	wp_localize_script( 'my-script', 'myajax', [
		'ajaxurl' => admin_url( 'admin-ajax.php' )
	] );

	wp_script_add_data( 'my-script', 'conditional', 'lt IE 9' );
	wp_style_add_data(  'my-style',  'conditional', 'lt IE 9' )

	wp_add_inline_script( 'my-scripts', 'alert("Hello!");' );
	wp_add_inline_style( 'my-style', '
		.mycolor{
			background: #fff;
		}
	');

	wp_deregister_script( 'my-script' );
	wp_deregister_style( 'my-style' );
}
```

</section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Hooks Functions

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[How hooks work in WordPress](https://wp-kama.ru/handbook/codex/hooks)[Hooks execution order](https://wp-kama.com/hooks/actions-order)- *[add\_action()](https://wp-kama.com/function/add_action)Hangs a function on an event.*
- *[remove\_action()](https://wp-kama.com/function/remove_action "remove_action( $tag, $function_to_remove, $priority );
    ")Deletes a function from the event.*
- *[did\_action()](https://wp-kama.com/function/did_action)Gets a number of how many times the event was performed.*
- *[do\_action()](https://wp-kama.com/function/do_action)Creates an event.*
- *[do\_action\_ref\_array()](https://wp-kama.com/function/do_action_ref_array)Creates an event. Arguments are passed in an array.*
- *[has\_action()](https://wp-kama.com/function/has_action "$has = has_action( $tag, $function_to_check );
    ")Checks whether a function is hung on the event.*
- *[current\_action()](https://wp-kama.com/function/current_action)Gets the name of the current event.*
- *[doing\_action()](https://wp-kama.com/function/doing_action "doing_action( $action );
    ")Checks if the event is being processed at the moment.*
- *[remove\_all\_actions()](https://wp-kama.com/function/remove_all_actions "remove_all_actions( $tag, $priority );
    ")Deletes all functions attached to the event.*
- 
- *[add\_filter()](https://wp-kama.com/function/add_filter)Hangs a function on a filter.*
- *[remove\_filter()](https://wp-kama.com/function/remove_filter)Deletes a function from the filter.*
- *[apply\_filters()](https://wp-kama.com/function/apply_filters)Creates a filter.*
- *[apply\_filters\_ref\_array()](https://wp-kama.com/function/apply_filters_ref_array "apply_filters_ref_array( $tag, $args );
    ")Creates a filter. Arguments are passed in an array.*
- *[has\_filter()](https://wp-kama.com/function/has_filter "has_filter( $tag, $function_to_check );
    ")Checks whether the function is hung on the filter.*
- *[current\_filter()](https://wp-kama.com/function/current_filter "$filter_name = current_filter();
    ")Gets the name of the current filter.*
- *[doing\_filter()](https://wp-kama.com/function/doing_filter "if( doing_filter( $filter_name ) ){
    // ...
    }
    ")Checks if the filter is currently being processed.*
- *[remove\_all\_filters()](https://wp-kama.com/function/remove_all_filters "remove_all_filters( $tag, $priority );
    ")Deletes all functions attached to the filter.*

</div>```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg>function my_filter_function( $str ){
	return 'Hello '. $str;
}

// Let's attach a function to the filter
add_filter( 'my_filter', 'my_filter_function' );

// Call the filter
echo apply_filters( 'my_filter', 'John' ); //> Hello John
```

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg>// Create a function for the event
function my_action_function( $text ){
	echo 'The my_action event has been triggered just now.';
}

// Let's attach the function to the my_action event
add_action( 'my_action', 'my_action_function' );

// Action call
do_action( 'my_action' ); //> The my_action event has been triggered just now.
```

</section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Localization (translation)

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Localization Functions](https://wp-kama.com/function-tag/localize)[Translations in WordPress](https://wp-kama.ru/handbook/codex/translations)- *[\_\_()](https://wp-kama.com/function/__ "$text = __( $text, $domain );
    ")Gets string translation.*
- *[\_e()](https://wp-kama.com/function/_e "<?php _e( $text, $domain ); ?>
    ")Outputs a string translation.*
- *[\_n()](https://wp-kama.com/function/_n)Gets a string translation after a number.*
- 
- *[esc\_attr\_\_()](https://wp-kama.com/function/esc_attr__)Gets string translation + esc\_attr().*
- *[esc\_attr\_e()](https://wp-kama.com/function/esc_attr_e)Outputs the string translation + esc\_attr().*
- *[esc\_html\_\_()](https://wp-kama.com/function/esc_html__)Gets the string translation + esc\_html().*
- *[esc\_html\_e()](https://wp-kama.com/function/esc_html_e)Outputs the string translation + esc\_html().*
- 
- *[\_x()](https://wp-kama.com/function/_x)Gets the string translation for context.*
- *[\_ex()](https://wp-kama.com/function/_ex "<?php _ex( $text, $context, $domain ); ?>
    ")Outputs the string translation for the context.*
- *[\_nx()](https://wp-kama.com/function/_nx)Gets a string translation after a number for the context.*
- 
- *[date\_i18n()](https://wp-kama.com/function/date_i18n "date_i18n( $format, $timestamp_with_offset, $gmt );
    ")Gets the translated date. Localization for date().*
- 
- *[determine\_locale()](https://wp-kama.com/function/determine_locale)Gets the locale of the site suitable for the current query.*
- *[get\_locale()](https://wp-kama.com/function/get_locale)Gets the locale of the site. E.g. en\_US.*
- *[get\_user\_locale()](https://wp-kama.com/function/get_user_locale)Gets the user's locale.*
- *[switch\_to\_locale()](https://wp-kama.com/function/switch_to_locale "switch_to_locale( $locale );
    ")Switches the user's locale.*
- *[is\_locale\_switched()](https://wp-kama.com/function/is_locale_switched "if( is_locale_switched() ){
    // locale is switched
    }
    ")Checks if switch\_to\_locale() was used.*
- 
- *[load\_plugin\_textdomain()](https://wp-kama.com/function/load_plugin_textdomain)Loads .mo file **from plugin folder**.*
- *[load\_muplugin\_textdomain()](https://wp-kama.com/function/load_muplugin_textdomain "load_muplugin_textdomain( $domain, $mu_plugin_rel_path );
    ")Loads .mo file **from plugin's MU folder**.*
- *[load\_theme\_textdomain()](https://wp-kama.com/function/load_theme_textdomain "load_theme_textdomain( $domain, $path );
    ")Loads the .mo file **from the theme folder**.*
- *[load\_child\_theme\_textdomain()](https://wp-kama.com/function/load_child_theme_textdomain "load_child_theme_textdomain( $domain, $path );
    ")Loads the .mo file **from the child theme folder**.*
- *[load\_textdomain()](https://wp-kama.com/function/load_textdomain)Loads the specified .mo file **from any folder**.*
- *[is\_textdomain\_loaded()](https://wp-kama.com/function/is_textdomain_loaded "if( is_textdomain_loaded( $domain ) ){
    // localization file is loaded - translation exists...
    }
    ")Checks if the .mo file is loaded.*
- *[unload\_textdomain()](https://wp-kama.com/function/unload_textdomain "unload_textdomain( $domain );
    ")Unloads (removes) the loaded .mo file.*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Conditional tags `(post types and queries)`

```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg>if( is_single() ){
	// single post type page
}
```

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">- *[wp\_doing\_ajax()](https://wp-kama.com/function/wp_doing_ajax "if( wp_doing_ajax() ){
    // this is AJAX request
    }
    ")Works for an AJAX request in WordPress.*
- *[wp\_doing\_cron()](https://wp-kama.com/function/wp_doing_cron "if( wp_doing_cron() ){
    // WP loaded through cron
    }
    ")Works for WordPress cron requests.*
- *[is\_ssl()](https://wp-kama.com/function/is_ssl "if( is_ssl() ){
    // ...
    }
    ")Works for HTTPS (SSL).*
- *[is\_front\_page()](https://wp-kama.com/function/is_front_page "if( is_front_page() ) {
    // code
    }
    ")Home page.*
- *[is\_home()](https://wp-kama.com/function/is_home "if( is_home() ){
    // code
    }
    ")Posts page (or Home page).*
- *[is\_single()](https://wp-kama.com/function/is_single "if( is_single( $post ) ){
    // ...
    }
    ")Page of post of any type except: attachment and page.*
- *[is\_singular()](https://wp-kama.com/function/is_singular "if( is_singular($post_types) ){
    // ...
    }
    ")Page of post of any type.*
- *[is\_page()](https://wp-kama.com/function/is_page "if( is_page( $page ) ){
    // code
    }
    ")The page of a Static page.*
- *[is\_page\_template()](https://wp-kama.com/function/is_page_template "if( is_page_template( $template ) ){
    // ...
    }
    ")Whether or not a template file is used for the page.*
- *[is\_attachment()](https://wp-kama.com/function/is_attachment "if( is_attachment( $attachment ) ){
    // attachment page
    }
    ")Attachment page.*
- *[is\_search()](https://wp-kama.com/function/is_search "<?php
    if( is_search() ){
    // ...
    }
    ?>
    ")Search result page.*
- *[is\_archive()](https://wp-kama.com/function/is_archive "<?php if( is_archive() ){ ... } ?>
    ")Archive page: category, tag, author, date.*
- *[is\_category()](https://wp-kama.com/function/is_category "if( is_category( $category ) ){
    // code...
    }
    ")Category page.*
- *[is\_tag()](https://wp-kama.com/function/is_tag "if( is_tag() ){
    // code
    }
    ")Tag page.*
- *[is\_tax()](https://wp-kama.com/function/is_tax "if( is_tax( $taxonomy, $term ) ){
    // it is taxonomy...
    }
    ")Page of custom taxonomy.*
- *[is\_post\_type\_archive()](https://wp-kama.com/function/is_post_type_archive "if( is_post_type_archive( $post_types ) ){
    // ...
    }
    ")Page of custom post type archive.*
- *[is\_author()](https://wp-kama.com/function/is_author "if( is_author() ){
    // ...
    }
    ")Page of author posts archive.*
- *[is\_date()](https://wp-kama.com/function/is_date)Archive page by date.*
- *[is\_year()](https://wp-kama.com/function/is_year "if( is_year() ){
    // ...
    }
    ")Archive page by Year.*
- *[is\_month()](https://wp-kama.com/function/is_month "if( is_month() ){
    // ...
    }
    ")Archive page by Month.*
- *[is\_day()](https://wp-kama.com/function/is_day "if( is_day() ){
    // ...
    }
    ")Archive page by Day.*
- *[is\_time()](https://wp-kama.com/function/is_time)Archive page by an hour, minute, second.*
- *[is\_paged()](https://wp-kama.com/function/is_paged "if( is_paged() ){
    // ...
    }
    ")Pagination page.*
- *[is\_404()](https://wp-kama.com/function/is_404)"Not found" page.*
- *[is\_preview()](https://wp-kama.com/function/is_preview)Post preview page.*
- *[is\_feed()](https://wp-kama.com/function/is_feed "if( is_feed( $feeds ) ){
    ...
    }
    ")Feed page.*
- *[is\_admin()](https://wp-kama.com/function/is_admin "if( is_admin() ){
    // ...
    }
    ")Admin panel.*
- *[is\_network\_admin()](https://wp-kama.com/function/is_network_admin "if( is_network_admin() ){
    // we are in network administration
    }
    ")Administration panel "Network management" of Multisite sites.*
- *[is\_blog\_admin()](https://wp-kama.com/function/is_blog_admin)Section of the admin panel of a separate site in Multisite.*
- *[is\_user\_admin()](https://wp-kama.com/function/is_user_admin "if( is_user_admin() ){
    //
    }
    ")The "User" section of the admin panel in Multisite.*
- *[is\_customize\_preview()](https://wp-kama.com/function/is_customize_preview)Page of customizer in the admin area.*
- *[is\_robots()](https://wp-kama.com/function/is_robots "if( is_robots() ){
    // this is robots.txt file
    }
    ")Query to the robots.txt file.*
- *[is\_embed()](https://wp-kama.com/function/is_embed "if( is_embed() ){
    // request for the embed post page
    }
    ")Page of embedding post.*
- *[is\_comment\_feed()](https://wp-kama.com/function/is_comment_feed "if( is_comment_feed() ){
    // comment feed page.
    }
    ")Comments feed page.*
- *[is\_trackback()](https://wp-kama.com/function/is_trackback "if( is_trackback() ){
    // ping request
    }
    ")Page of pings (trackback).*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Conditional tags `(others)`

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[All Conditional Tags](https://wp-kama.com/function-tag/conditional-tags)</div>```
<svg class="svg-ico copy-svg hljs-copy-btn" data-tooltip_pos="top" title="Copy to clipboard"></svg>if( is_user_logged_in() ){
	// user is authorized
}
```

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">- *[is\_user\_logged\_in()](https://wp-kama.com/function/is_user_logged_in "if ( is_user_logged_in() ) {
    // ...
    }
    ")Checks if the user is logged in.*
- *[have\_comments()](https://wp-kama.com/function/have_comments "if( have_comments() ){
    // there are comments, we display them
    }
    ")Checks if there are comments to be displayed on the page.*
- *[comments\_open()](https://wp-kama.com/function/comments_open "comments_open( $post_id );
    ")Checks if comments are opened.*
- *[has\_category()](https://wp-kama.com/function/has_category)Checks if the post is in at least one category.*
- *[has\_tag()](https://wp-kama.com/function/has_tag "has_tag( $tag, $post );
    ")Checks if the post is in at least one tag.*
- *[has\_term()](https://wp-kama.com/function/has_term "if( has_term( $term, $taxonomy, $post ) ){
    ...
    }
    ")Checks if the post is in at least one taxonomy term.*
- *[has\_excerpt()](https://wp-kama.com/function/has_excerpt "if( has_excerpt( $id ) ){
    // ...
    }
    ")Checks if the post has an excerpt (quote, short description).*
- *[is\_nav\_menu()](https://wp-kama.com/function/is_nav_menu "is_nav_menu( $menu );
    ")Checks if there is a menu by ID, slug or name.*
- *[has\_nav\_menu()](https://wp-kama.com/function/has_nav_menu "if( has_nav_menu( $location ) ){
    // ...
    }
    ")Checks if registered menu area have an attached menu.*
- *[has\_shortcode()](https://wp-kama.com/function/has_shortcode "if ( has_shortcode( $content, $tag ) ) { }
    ")Checks if content contains the specified shortcode.*
- *[shortcode\_exists()](https://wp-kama.com/function/shortcode_exists "if ( shortcode_exists( $tag ) ) { }
    ")Checks if the specified shortcode is registered.*
- *[in\_category()](https://wp-kama.com/function/in_category "if( in_category( $category, $post ) ){
    // ...
    }
    ")Checks if the post are in a category.*
- *[in\_the\_loop()](https://wp-kama.com/function/in_the_loop "if( in_the_loop() ){
    // we inside the loop...
    }
    ")Checks if we are inside a WP Loop.*
- *[is\_main\_query()](https://wp-kama.com/function/is_main_query "if( is_main_query() ){ ... };
    ")Checks if we are in the main WP Loop.*
- *[is\_active\_sidebar()](https://wp-kama.com/function/is_active_sidebar "if( is_active_sidebar( $index ) ){
    // code
    }
    ")Checks if there is at least one widget in the widgets area.*
- *[is\_child\_theme()](https://wp-kama.com/function/is_child_theme "if( is_child_theme() ){
    // child theme
    }
    ")Checks if a child theme being used.*
- *[is\_dynamic\_sidebar()](https://wp-kama.com/function/is_dynamic_sidebar "is_dynamic_sidebar();
    ")Checks if theme sidebars are enabled and they has at least one widget.*
- *[is\_local\_attachment()](https://wp-kama.com/function/is_local_attachment "if( is_local_attachment( $url ) ){
    // this is a file from the WordPress media library
    }
    ")Checks if the given URL is an attachment page.*
- *[is\_multisite()](https://wp-kama.com/function/is_multisite "if ( is_multisite() ) {
    echo 'Мультисайтовость включена';
    }
    ")Checks if the multisite mode is turned on.*
- *[is\_new\_day()](https://wp-kama.com/function/is_new_day "<?php
    if( is_new_day() ){
    echo 'New day';
    }
    ?>
    ")Checks if the current date differs from the previous (in the loop).*
- *[is\_post\_type\_hierarchical()](https://wp-kama.com/function/is_post_type_hierarchical)Checks if the post type is hierarchical (tree-like).*
- *[is\_taxonomy\_hierarchical()](https://wp-kama.com/function/is_taxonomy_hierarchical "if( is_taxonomy_hierarchical( $taxonomy ) ){
    // do something
    }
    ")Checks if the taxonomy is hierarchical (tree-like).*
- *[is\_sticky()](https://wp-kama.com/function/is_sticky "<?php
    if( is_sticky( $post_ID ) ){
    // ...
    }
    ?>
    ")Checks if the post is sticky (be shown on front page).*
- *[pings\_open()](https://wp-kama.com/function/pings_open "<?php if( pings_open($post_id) ){ ... } ?>
    ")Checks if the post is allowed to receive pings.*
- *[post\_exists()](https://wp-kama.com/function/post_exists "post_exists( $title, $content, $date );
    ")Checks if there is a post with a specified title (post\_title).*
- *[taxonomy\_exists()](https://wp-kama.com/function/taxonomy_exists "<?php taxonomy_exists($taxonomy); ?>
    ")Checks if the specified taxonomy exist.*
- *[post\_password\_required()](https://wp-kama.com/function/post_password_required "if( post_password_required( $post ) ){ ... }
    ")Checks if the post is password protected and it is correct.*
- *[term\_exists()](https://wp-kama.com/function/term_exists)Checks if the taxonomy element exist (return the term ID).*
- *[cat\_is\_ancestor\_of()](https://wp-kama.com/function/cat_is_ancestor_of)Checks if the category is child of another one (all nesting levels).*
- *[term\_is\_ancestor\_of()](https://wp-kama.com/function/term_is_ancestor_of "if( term_is_ancestor_of( $term1, $term2, $taxonomy ) ){
    // there is a dependency
    }
    ")Checks if the term is child of another one (all nesting levels).*
- *[wp\_attachment\_is()](https://wp-kama.com/function/wp_attachment_is "wp_attachment_is( $type, $post_id );
    ")Checks if the attachment is an image, audio or video.*
- *[wp\_attachment\_is\_image()](https://wp-kama.com/function/wp_attachment_is_image "wp_attachment_is_image( $post );
    ")Checks if the attachment (post) is a image .*
- *[is\_header\_video\_active()](https://wp-kama.com/function/is_header_video_active "if( has_header_video() && is_header_video_active() ){
    // ...
    }
    ")Checks if the header video should be shown on the page.*
- *[has\_custom\_header()](https://wp-kama.com/function/has_custom_header "if( has_custom_header() ){
    // video or image is set for the theme header
    }
    ")Checks if the picture/video is set for the theme header.*
- *[wp\_is\_mobile()](https://wp-kama.com/function/wp_is_mobile "if( wp_is_mobile() ){ ... }
    ")Checks if the site is viewed on a mobile device.*
- *[wp\_is\_post\_autosave()](https://wp-kama.com/function/wp_is_post_autosave "wp_is_post_autosave( $post );
    ")Checks if the post is an auto-save.*
- *[wp\_is\_post\_revision()](https://wp-kama.com/function/wp_is_post_revision "wp_is_post_revision( $post );
    ")Checks if the post is a revision.*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Template Tags

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[All Template Tags](https://wp-kama.com/functions/template-tags)- *[home\_url()](https://wp-kama.com/function/home_url)Gets the URL of the homepage.*
- *[site\_url()](https://wp-kama.com/function/site_url "site_url( $path, $scheme );
    ")Gets the URL of the admin panel.*
- *[wp\_get\_document\_title()](https://wp-kama.com/function/wp_get_document_title "<title><?php echo wp_get_document_title(); ?></title>
    ")Gets the page title for &lt;title&gt;.*
- *[the\_archive\_title()](https://wp-kama.com/function/the_archive_title)Outputs the title of the archive page: tag, category, date.*
- *[single\_term\_title()](https://wp-kama.com/function/single_term_title "<?php single_term_title( $prefix, $display ); ?>
    ")Outputs/Gets the title of the term page.*
- *[single\_post\_title()](https://wp-kama.com/function/single_post_title)Outputs/Gets title of a post page.*
- *[single\_cat\_title()](https://wp-kama.com/function/single_cat_title "<?php single_cat_title( $prefix, $display ); ?>
    ")Outputs/Gets title of a category/tag page.*
- *[body\_class()](https://wp-kama.com/function/body_class)Outputs css classes for the &lt;body&gt; tag.*
- *[wp\_body\_open()](https://wp-kama.com/function/wp_body_open "<body <?php body_class(); ?>>     <?php wp_body_open(); ?>  ...
    ")Triggers the [wp\_body\_open](https://wp-kama.com/hook/wp_body_open) hook. Use is after &lt;body&gt; tag.*
- *[wp\_head()](https://wp-kama.com/function/wp_head "<?php wp_head(); ?>
    ")Triggers the [wp\_head](https://wp-kama.com/hook/wp_head) hook. Use it in header.php file.*
- *[wp\_footer()](https://wp-kama.com/function/wp_footer "<?php wp_footer(); ?>
    ")Triggers the [wp\_footer](https://wp-kama.com/hook/wp_footer) hook. Use it in footer.php file.*
- *[wp\_list\_categories()](https://wp-kama.com/function/wp_list_categories "<ul>
    <?php wp_list_categories( $args ); ?>
    </ul>
    ")Outputs list of categories as links.*
- *[wp\_dropdown\_categories()](https://wp-kama.com/function/wp_dropdown_categories)Outputs a dropdown list of categories/terms.*
- *[wp\_list\_comments()](https://wp-kama.com/function/wp_list_comments "<?php wp_list_comments( $args, $comments ); ?>
    ")Outputs/Gets post comments.*
- *[comment\_form()](https://wp-kama.com/function/comment_form "comment_form( $args, $post_id );
    ")Outputs comment form.*
- *[wp\_tag\_cloud()](https://wp-kama.com/function/wp_tag_cloud "<?php wp_tag_cloud( $args ); ?>
    ")Outputs/Gets tag cloud.*
- *[register\_sidebar()](https://wp-kama.com/function/register_sidebar "register_sidebar( $args );
    ")Registers a widget panel.*
- *[register\_sidebars()](https://wp-kama.com/function/register_sidebars)Registers a widget panels (several at once).*
- *[wp\_nav\_menu()](https://wp-kama.com/function/wp_nav_menu "<?php wp_nav_menu( $args ); ?>
    ")Outputs a custom menu created in the admin panel.*
- *[register\_nav\_menu()](https://wp-kama.com/function/register_nav_menu "<?php register_nav_menu( $location, $description ); ?>
    ")Registers a single menu location (area).*
- *[register\_nav\_menus()](https://wp-kama.com/function/register_nav_menus)Registers multiple menu locations (areas).*
- *[wp\_get\_attachment\_image()](https://wp-kama.com/function/wp_get_attachment_image "$img = wp_get_attachment_image( $attachment_id, $size, $icon, $attr );
    ")Gets image IMG tag.*
- *[wp\_get\_attachment\_image\_src()](https://wp-kama.com/function/wp_get_attachment_image_src)Gets image data: URL/Width/Height.*
- *[wp\_get\_attachment\_image\_url()](https://wp-kama.com/function/wp_get_attachment_image_url "wp_get_attachment_image_url( $attachment_id, $size, $icon );
    ")Gets image URL by it's ID.*
- *[category\_description()](https://wp-kama.com/function/category_description "$description = category_description( $category_id );
    ")Gets category description.*
- *[term\_description()](https://wp-kama.com/function/term_description "term_description( $term, $deprecated );
    ")Gets term description.*
- *[get\_the\_term\_list()](https://wp-kama.com/function/get_the_term_list)Outputs a list of post terms as links.*
- *[get\_avatar()](https://wp-kama.com/function/get_avatar "get_avatar( $id_or_email, $size, $default, $alt, $args );
    ")Gets image of the user avatar (&lt;img&gt; tag).*
- *[next\_post\_link()](https://wp-kama.com/function/next_post_link "next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
    ")Displays a link to the next most recent post (by date).*
- *[previous\_post\_link()](https://wp-kama.com/function/previous_post_link "<?php previous_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy ); ?>
    ")Displays a link to the previous most recent post (by date).*
- *[get\_post\_type\_archive\_link()](https://wp-kama.com/function/get_post_type_archive_link)Gets the URL for the post type archive page.*
- *[wp\_link\_pages()](https://wp-kama.com/function/wp_link_pages "<?php wp_link_pages( $args ); ?>
    ")Outputs pagination for multi-page post &lt;!--nextpage--&gt;.*
- *[the\_post\_navigation()](https://wp-kama.com/function/the_post_navigation "<?php the_post_navigation( $args ); ?>
    ")Outputs links to next/previous posts (as HTML block).*
- *[wp\_get\_archives()](https://wp-kama.com/function/wp_get_archives "wp_get_archives( $args );
    ")Outputs links to date archives pages: days, months, years.*
- *[wp\_login\_form()](https://wp-kama.com/function/wp_login_form "<?php wp_login_form( $args ); ?>
    ")Outputs login form HTML code.*
- *[edit\_tag\_link()](https://wp-kama.com/function/edit_tag_link "<?php edit_tag_link( $link, $before, $after, $tag ); ?>
    ")Outputs a link to edit the current tag.*
- *[edit\_term\_link()](https://wp-kama.com/function/edit_term_link)Outputs a link to edit the current term.*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Formatting

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Formatting](https://wp-kama.com/function-cat/formatting)- *[absint()](https://wp-kama.com/function/absint)Convert a value to non-negative integer.*
- *[antispambot()](https://wp-kama.com/function/antispambot)Converts all email characters to HTML entities.*
- *[force\_balance\_tags()](https://wp-kama.com/function/force_balance_tags "force_balance_tags( $text );
    ")Fixes HTML tags: not closed, wrong syntax.*
- *[links\_add\_target()](https://wp-kama.com/function/links_add_target "links_add_target( $content, $target, $tags );
    ")Adds a target attr with the specified value to A tags.*
- *[make\_clickable()](https://wp-kama.com/function/make_clickable "$text = make_clickable( $text );
    ")Changes links like <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">http://site.com</var>, <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">www.site.com</var> to HTML link.*
- *[normalize\_whitespace()](https://wp-kama.com/function/normalize_whitespace "normalize_whitespace( $str );
    ")Replaces all line breaks (EOL) with <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">\\n</var>, removes extra spaces.*
- *[number\_format\_i18n()](https://wp-kama.com/function/number_format_i18n "number_format_i18n( $number, $decimals = 0 );
    ")Corrects integer or decimal number format to fit localisation.*
- *[size\_format()](https://wp-kama.com/function/size_format)Changes bytes to format: 500 B, 63 KB, 9 MB, 2 GB, 1 TB.*
- *[set\_url\_scheme()](https://wp-kama.com/function/set_url_scheme)Fixs URL protocol. If set "relative" domain will be removed.*
- *[wp\_rel\_nofollow()](https://wp-kama.com/function/wp_rel_nofollow)Adds <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">rel="nofollow"</var> to all <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">&lt;a&gt;</var>. Internal links are skipped.*
- *[trailingslashit()](https://wp-kama.com/function/trailingslashit "$string = trailingslashit( $string );
    ")Adds a slash (/) to the end of string (URL/path).*
- *[untrailingslashit()](https://wp-kama.com/function/untrailingslashit "$url = untrailingslashit( $url );
    ")Removes closing slash (/) at the end of a string.*
- *[user\_trailingslashit()](https://wp-kama.com/function/user_trailingslashit "user_trailingslashit( $string, $type_of_url );
    ")Adds or removes a slash (/) at the end. Depends on WP permalink settings.*
- *[wp\_trim\_words()](https://wp-kama.com/function/wp_trim_words)Trims text to the specified number of words.*
- *[wpautop()](https://wp-kama.com/function/wpautop "$pee = wpautop( $text, $br );
    ")Replaces double newline (\\n\\n) with HTML <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">&lt;p&gt;...&lt;/p&gt;</var> and single with <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">&lt;br&gt;</var>.*
- *[wptexturize()](https://wp-kama.com/function/wptexturize "wptexturize( $text, $reset );
    ")Changes some characters in the text: <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">(tm)</var> &gt;&gt; <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">™</var> etc.*
- *[zeroise()](https://wp-kama.com/function/zeroise)Add leading zeros when necessary: <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">10</var> &gt;&gt; <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">0010</var>.*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Escaping on output

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Escaping on output](https://wp-kama.com/function-tag/esc_)- *[esc\_attr()](https://wp-kama.com/function/esc_attr "<?php echo esc_attr( $text ) ?>
    ")Cleans for use in HTML tag attribute.*
- *[esc\_html()](https://wp-kama.com/function/esc_html "esc_html( $text );
    ")Cleans for displaying text on the screen.*
- *[esc\_url()](https://wp-kama.com/function/esc_url "$url = esc_url( $url, $protocols, $_context );
    ")Cleans for use in the <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">src=</var>, <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">url=</var>, etc. attributes.*
- *[esc\_textarea()](https://wp-kama.com/function/esc_textarea)Cleans for use in <var style="box-sizing: inherit; font-style: normal; font-family: 'Roboto Mono', Consolas, Monaco, monospace;">&lt;textarea&gt;</var> value.*
- *[wp\_strip\_all\_tags()](https://wp-kama.com/function/wp_strip_all_tags)Removes all HTML tags.*
- *[wp\_kses()](https://wp-kama.com/function/wp_kses "wp_kses( $string, $allowed_html, $allowed_protocols );
    ")Removes all HTML tags.*
- *[esc\_js()](https://wp-kama.com/function/esc_js)Prepares string for display in JS.*
- *[esc\_sql()](https://wp-kama.com/function/esc_sql)Cleans the string, leaving only the specified HTML tags.*

</div></section><section style="box-sizing: inherit; margin-bottom: 3em; font-variation-settings: 'wdth' 80;">## Sanitize on input

<div class="section_body" style="box-sizing: inherit;" x-show="isOpened" x-transition.scale.origin.top="">[Sanitize on input](https://wp-kama.com/function-tag/check-sanitize)- *[sanitize\_text\_field()](https://wp-kama.com/function/sanitize_text_field)Cleans string, leaving only clean text: without HTML, extra spaces, etc.*
- *[sanitize\_textarea\_field()](https://wp-kama.com/function/sanitize_textarea_field)Cleans string for textarea (when saving to the database).*
- *[sanitize\_key()](https://wp-kama.com/function/sanitize_key)Cleans string to use it as a key/ID.*
- *[sanitize\_url()](https://wp-kama.com/function/sanitize_url "sanitize_url( $url, $protocols );
    ")Cleans string to use it for redirects or to store it in the DB.*
- *[sanitize\_html\_class()](https://wp-kama.com/function/sanitize_html_class "$sanitized = sanitize_html_class( $class, $fallback );
    ")Cleans the text for use in the HTML attribute "class".*
- *[sanitize\_email()](https://wp-kama.com/function/sanitize_email "$email = sanitize_email( $email );
    ")Cleans string, leaving only the permissible characters for an email.*
- *[sanitize\_file\_name()](https://wp-kama.com/function/sanitize_file_name "sanitize_file_name( $filename );
    ")Cleans the file name, replacing " " with "\_" and removing impermissible characters.*
- *[sanitize\_title\_with\_dashes()](https://wp-kama.com/function/sanitize_title_with_dashes "<?php sanitize_title_with_dashes( $title, $raw_title, $context ) ?>
    ")Cleans title, replacing " " with "-".*
- *[sanitize\_mime\_type()](https://wp-kama.com/function/sanitize_mime_type "sanitize_mime_type( $mime_type );
    ")Removes all characters except "-+\*\*.a-zA-Z0-9/." - allowed in MIME type.*

</div></section></div></div>