{"id":114738,"date":"2024-08-26T08:40:22","date_gmt":"2024-08-26T08:40:22","guid":{"rendered":"\/tutorials\/?p=114738"},"modified":"2026-03-09T19:17:13","modified_gmt":"2026-03-09T19:17:13","slug":"wordpress-add_action","status":"publish","type":"post","link":"\/ng\/tutorials\/wordpress-add_action","title":{"rendered":"What are WordPress actions and how to use WordPress add_action() function"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>WordPress is a highly customizable platform that allows users to extend its functionality through various hooks and functions. One of the most used functions is <strong>add_action()<\/strong>, which lets you add custom behavior to your site without modifying WordPress core files.<\/p><p>In this article, you&rsquo;ll learn how to use WordPress&rsquo;s <strong>add_action()<\/strong> function to connect your custom code with predefined actions within the platform. By mastering this function, you can easily enhance your website&rsquo;s capabilities and tailor it to your needs.<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Mega-WordPress-Cheat-EN.pdf\">Download all-in-one WordPress cheat sheet<\/a><\/p><p>\n\n\n\n<div class=\"protip\">\n                    <h2 class=\"featured-snippet title\">What is WordPress action?<\/h2>\n                    <p> WordPress actions are hooks that execute custom code at specific points during the WordPress execution process. These action hooks trigger functions when certain events occur, like loading the header or publishing a post.<br>\n<\/p>\n                <\/div>\n\n\n\n<\/p><p><a href=\"\/ng\/tutorials\/what-are-wordpress-hooks\">WordPress hooks<\/a> are divided into two types&mdash;<strong>actions<\/strong> and <strong>filters<\/strong>. While actions let you add or modify functionality by attaching functions to specific events, filters alter data as WordPress processes it.<\/p><p>For example, the <strong>add_action()<\/strong> function adds your custom code to run when a post is published, while <strong>add_filter()<\/strong> modifies a post&rsquo;s content before displaying it.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-do-wordpress-actions-work\">How do WordPress actions work?<\/h3><p>WordPress actions work by inserting custom functions into predefined events in the WordPress lifecycle. The <strong>add_action()<\/strong> function hooks these events so that your custom code runs at the appropriate time.<\/p><p>For instance, if you want to add a custom script to your site&rsquo;s header, you can use the <strong>wp_head<\/strong> action hook. WordPress will execute your code whenever it reaches your site&rsquo;s header while the page loads by hooking your function to this event.<\/p><p><strong>Adding actions to WordPress<\/strong><\/p><p>You can add actions to WordPress in several ways, depending on where you want to place your custom code:<\/p><ul class=\"wp-block-list\">\n<li><strong>Theme&rsquo;s functions.php file<\/strong>. This is the most common place to add actions if your custom functionality is tied to the theme. Open your active theme&rsquo;s <a href=\"\/ng\/tutorials\/functions-php-wordpress\">functions.php file<\/a> and add your <strong>add_action()<\/strong> code.<\/li>\n\n\n\n<li><strong>Child theme&rsquo;s functions.php file<\/strong>. If you&rsquo;ve <a href=\"\/ng\/tutorials\/how-to-create-wordpress-child-theme\">created a child theme<\/a>, you can place your actions in the child theme&rsquo;s <strong>functions.php<\/strong> file. This method is helpful if you want to keep your changes separate from the parent theme.<\/li>\n\n\n\n<li><strong>Custom plugin<\/strong>. Consider creating a custom plugin if you want your custom actions independent of the theme. This way, your code will continue to work even if you change your site&rsquo;s theme. To do this, create a new PHP file in the <strong>wp-content\/plugins\/ <\/strong>directory, add your <strong>add_action()<\/strong> code, and activate the plugin.<\/li>\n<\/ul><h3 class=\"wp-block-heading\" id=\"h-wordpress-add-action-parameters\">WordPress add_action() parameters<\/h3><p>The WordPress <strong>add_action()<\/strong> function controls how and when your custom code is executed by taking several parameters. Let&rsquo;s break them down:<\/p><ul class=\"wp-block-list\">\n<li><strong>$hook_name<\/strong>. This parameter specifies the action hook name to which you want to attach your custom function. This hook determines when your function will run. WordPress has many predefined hooks, such as <strong>init<\/strong> to run code after WordPress has finished loading and <strong>wp_footer<\/strong> to add code to the footer.<\/li>\n\n\n\n<li><strong>$callback<\/strong>. Often referred to as the callback function, it&rsquo;s the function name you wish to execute when the specified action hook is triggered. This function contains the custom code that will run at the appropriate point in WordPress.<\/li>\n\n\n\n<li><strong>$priority (optional)<\/strong>. The <strong>$priority<\/strong> parameter determines the order in which WordPress executes functions tied to the same hook. The default priority is <strong>10<\/strong>, but you can adjust this value to control whether your function runs earlier or later than other functions in the same action. Lower numbers mean the function will run sooner.<\/li>\n\n\n\n<li><strong>$accepted_args (optional)<\/strong>. It defines the number of arguments that your callback function can accept. By default, WordPress sets this to <strong>1<\/strong>, but you can increase it if your function needs to accept more arguments.<\/li>\n<\/ul><p>Here&rsquo;s an example of a complete <strong>add_action()<\/strong> function:<\/p><pre class=\"wp-block-preformatted\">function my_custom_script() {<br><br>echo '&lt;script&gt;alert(\"Hello, World!\");&lt;\/script&gt;';<br><br>}<br><br>add_action( 'wp_footer', 'my_custom_script', 10, 1 );<\/pre><ul class=\"wp-block-list\">\n<li><strong>$hook_name &ndash; &lsquo;wp_footer&rsquo;<\/strong>. This specifies that the function should run when the <strong>wp_footer<\/strong> action hook is triggered, which happens when WordPress is about to close the body tag on every page.<\/li>\n\n\n\n<li><strong>$callback &ndash; &lsquo;my_custom_script&rsquo;<\/strong>. The function name that will be executed when the <strong>wp_footer<\/strong> hook is called.<\/li>\n\n\n\n<li><strong>$priority &ndash; 10<\/strong>. This is the default priority, meaning the function will run in the standard order relative to other functions hooked to <strong>wp_footer<\/strong>.<\/li>\n\n\n\n<li><strong>$accepted_args &ndash; 1<\/strong>. Although this function doesn&rsquo;t require arguments, WordPress sets it to accept <strong>1<\/strong> argument by default.<\/li>\n<\/ul><p>As the WordPress page loads the footer, the <strong>my_custom_script<\/strong> function executes, inserting a script that displays an alert box with the message &ldquo;Hello, World!&rdquo; before the page closes.<\/p><h2 class=\"wp-block-heading\" id=\"h-example-of-add-action-in-wordpress\">Example of add_action() in WordPress<\/h2><p>This section demonstrates some practical uses of the <strong>add_action()<\/strong> function. If you <a href=\"\/ng\/wordpress-hosting\">host your WordPress site on Hostinger<\/a> and want to try these examples, test them in a staging environment first.<\/p><p>This way, you can safely experiment without affecting your live site. You can follow our guide on <a href=\"\/ng\/tutorials\/wordpress-staging-environment\">setting up a WordPress staging environment<\/a> using Hostinger&rsquo;s staging tool.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/ng\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-adding-a-custom-script-to-the-wordpress-frontend\">Adding a custom script to the WordPress frontend<\/h3><p>One common use of <strong>add_action()<\/strong> is inserting custom scripts into your WordPress site&rsquo;s frontend. This can be useful when you need to include JavaScript files or inline scripts that enhance your site&rsquo;s functionality or design.<\/p><p>For instance, add a custom JavaScript file to your site&rsquo;s header to create interactive elements or track user behavior. To achieve this, hook into the <strong>wp_enqueue_scripts<\/strong> action, which enqueues scripts and styles in WordPress.<\/p><p>Here&rsquo;s how to do it:<\/p><pre class=\"wp-block-preformatted\">function add_custom_script() {<br><br>wp_enqueue_script( 'custom-js', get_template_directory_uri() . '\/js\/custom-script.js', array(), null, true );<br><br>}<br><br>add_action( 'wp_enqueue_scripts', 'add_custom_script' );<\/pre><p>In this example, you call the <strong>wp_enqueue_script<\/strong> function with several parameters:<\/p><ul class=\"wp-block-list\">\n<li><strong>&lsquo;custom-js&rsquo;<\/strong> &ndash; a unique handle for your script.<\/li>\n\n\n\n<li><strong>get_template_directory_uri() . &lsquo;\/js\/custom-script.js&rsquo;<\/strong> &ndash; your JavaScript file&rsquo;s location within your theme directory.<\/li>\n\n\n\n<li><strong>array()<\/strong> &ndash; an array of dependencies for your script. You can leave this empty if there are none.<\/li>\n\n\n\n<li><strong>null (optional)<\/strong> &ndash; the script version number.<\/li>\n\n\n\n<li><strong>true<\/strong> &ndash; whether to load the script in the footer (<strong>true<\/strong>) or the header (<strong>false<\/strong>).<\/li>\n<\/ul><p>The <strong>add_action(&lsquo;wp_enqueue_scripts&rsquo;, &lsquo;add_custom_script&rsquo;)<\/strong> line hooks your <strong>add_custom_script<\/strong> function to the <strong>wp_enqueue_scripts<\/strong> action. This approach prevents conflicts with other themes or plugins that might be enqueuing their scripts.<\/p><h3 class=\"wp-block-heading\" id=\"h-adding-a-custom-footer-message\">Adding a custom footer message<\/h3><p>You can also use the <strong>add_action() <\/strong>function to customize your WordPress site&rsquo;s footer. Whether you want to display a personalized message, add a copyright notice, or include extra HTML or scripts, the <strong>wp_footer<\/strong> hook provides the ideal opportunity.<\/p><p>This hook is triggered just before the closing <strong>&lt;\/body&gt;<\/strong> tag on every page of your WordPress site. It&rsquo;s the perfect place to add custom content that you want to appear site-wide, as shown in the following example:<\/p><pre class=\"wp-block-preformatted\">function add_custom_footer_message() {<br><br>echo '&lt;p style=\"text-align: center;\"&gt;Thank you for visiting our website!&lt;\/p&gt;';<br><br>}<br><br>add_action( 'wp_footer', 'add_custom_footer_message' );<\/pre><p>Here, you add a simple HTML paragraph with a centered text message. Then, <strong>add_action()<\/strong> hooks the <strong>add_custom_footer_message<\/strong> function to the <strong>wp_footer<\/strong> action.<\/p><p>As a result, every time WordPress reaches the <strong>wp_footer<\/strong> hook, the custom message is displayed in the site&rsquo;s footer.<\/p><h3 class=\"wp-block-heading\" id=\"h-adding-a-custom-admin-notice\">Adding a custom admin notice<\/h3><p>In WordPress, admin notices effectively communicate important information to users within the admin dashboard. These notices can display warnings, updates, or other messages that need the site administrator&rsquo;s attention.<\/p><p>Hooking <strong>add_action()<\/strong> into the <strong>admin_notices<\/strong> action triggers the notice at a specific point whenever the WordPress admin area loads. The following code snippet shows how to add a custom admin notice:<\/p><pre class=\"wp-block-preformatted\">function custom_admin_notice() {<br><br>echo '&lt;div class=\"notice notice-success is-dismissible\"&gt;<br><br>&lt;p&gt;This is a custom admin notice!&lt;\/p&gt;<br><br>&lt;\/div&gt;';<br><br>}<br><br>add_action( 'admin_notices', 'custom_admin_notice' );<\/pre><p>This custom WordPress function generates the HTML for the admin notice. The <strong>&lt;div&gt;<\/strong> element includes several classes:<\/p><ul class=\"wp-block-list\">\n<li><strong>notice<\/strong> &ndash; this class is required to style the element as an admin notice.<\/li>\n\n\n\n<li><strong>notice-success<\/strong> &ndash; it defines the notice as a success message. To display different types of messages, change this to <strong>notice-warning<\/strong>, <strong>notice-error<\/strong>, or <strong>notice-info<\/strong>.<\/li>\n\n\n\n<li><strong>is-dismissible<\/strong> &ndash; this class adds a close button so users can dismiss the notice.<\/li>\n<\/ul><p>You can add logic to your custom function to display the notice only under certain conditions, such as when editing a specific post type or after updating a plugin.<\/p><p>Here&rsquo;s an example that shows an admin notice only when you edit a certain post type:<\/p><pre class=\"wp-block-preformatted\">function conditional_admin_notice() {<br><br>global $post;<br><br>if ( $post-&gt;post_type == 'your_post_type' ) {<br><br>echo '&lt;div class=\"notice notice-warning is-dismissible\"&gt;<br><br>&lt;p&gt;This is a custom notice for your post type.&lt;\/p&gt;<br><br>&lt;\/div&gt;';<br><br>}<br><br>}<br><br>add_action( 'admin_notices', 'conditional_admin_notice' );<\/pre><h3 class=\"wp-block-heading\" id=\"h-adding-a-custom-sidebar-widget\">Adding a custom sidebar widget<\/h3><p>A <a href=\"\/ng\/tutorials\/wordpress-widgets\">widget is<\/a> a small block that performs a specific function, such as displaying recent posts, a search bar, or custom HTML. Using the <strong>widgets_init<\/strong> action hook, you can register and display your custom widget in your sidebar or any other widget area.<\/p><p>First, define a custom class that extends <strong>WP_Widget<\/strong> to add a custom sidebar widget. This class will contain your custom widget&rsquo;s logic, including how it&rsquo;s displayed and any form fields for customizing its content.<\/p><pre class=\"wp-block-preformatted\">class My_Custom_Widget extends WP_Widget {<br><br>\/\/ Constructor to set up the widget's name, description, etc.<br><br>public function __construct() {<br><br>parent::__construct(<br><br>'my_custom_widget', \/\/ Base ID<br><br>__( 'My Custom Widget', 'text_domain' ), \/\/ Widget name in the admin<br><br>array( 'description' =&gt; __( 'A custom widget that displays a message.', 'text_domain' ), ) \/\/ Widget description<br><br>);<br><br>}<br><br>\/\/ Output the content of the widget on the frontend<br><br>public function widget( $args, $instance ) {<br><br>echo $args['before_widget'];<br><br>echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];<br><br>echo '&lt;p&gt;' . __( 'Hello, this is my custom widget!', 'text_domain' ) . '&lt;\/p&gt;';<br><br>echo $args['after_widget'];<br><br>}<br><br>\/\/ Output the widget options form on the admin<br><br>public function form( $instance ) {<br><br>$title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'New title', 'text_domain' );<br><br>?&gt;<br><br>&lt;p&gt;<br><br>&lt;label for=\"&lt;?php echo esc_attr( $this-&gt;get_field_id( 'title' ) ); ?&gt;\"&gt;&lt;?php _e( 'Title:', 'text_domain' ); ?&gt;&lt;\/label&gt;<br><br>&lt;input class=\"widefat\" id=\"&lt;?php echo esc_attr( $this-&gt;get_field_id( 'title' ) ); ?&gt;\" name=\"&lt;?php echo esc_attr( $this-&gt;get_field_name( 'title' ) ); ?&gt;\" type=\"text\" value=\"&lt;?php echo esc_attr( $title ); ?&gt;\"&gt;<br><br>&lt;\/p&gt;<br><br>&lt;?php&nbsp;<br><br>}<br><br>\/\/ Process widget options to save<br><br>public function update( $new_instance, $old_instance ) {<br><br>$instance = array();<br><br>$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';<br><br>return $instance;<br><br>}<br><br>}<\/pre><p>In the above snippet, <strong>My_Custom_Widget<\/strong> extends the <strong>WP_Widget<\/strong> class and includes methods for displaying the widget (<strong>widget<\/strong>), generating the widget&rsquo;s admin form (<strong>form<\/strong>), and saving the widget&rsquo;s options (<strong>update<\/strong>).<\/p><p>After defining the custom class, register it using the <strong>widgets_init<\/strong> action hook. This is where <strong>add_action()<\/strong> comes into play:<\/p><pre class=\"wp-block-preformatted\">function register_my_custom_widget() {<br><br>register_widget( 'My_Custom_Widget' );<br><br>}<br><br>add_action( 'widgets_init', 'register_my_custom_widget' );<\/pre><p>By hooking your <strong>register_my_custom_widget<\/strong> function to <strong>widgets_init<\/strong>, WordPress will register your custom widget when it prepares the widget system. You can then add it to the sidebar or other widgetized area.<\/p><h2 class=\"wp-block-heading\" id=\"h-other-wordpress-action-functions\">Other WordPress action functions<\/h2><p>In addition to <strong>add_action()<\/strong>, several other functions in WordPress interact with action hooks. These functions enable you to execute custom code, remove actions, and check if specific actions have been registered.<\/p><p><strong>do_action()<\/strong><\/p><p>The <strong>do_action()<\/strong> function triggers an action hook. It lets you execute all the functions hooked to a particular action. You can use it within your custom code to create a new action that you or other developers can hook into, allowing for extensibility and modular code.<\/p><pre class=\"wp-block-preformatted\">do_action( 'my_custom_action' );<\/pre><p>In this example, the <strong>do_action()<\/strong> function triggers the <strong>my_custom_action<\/strong> hook.<\/p><p><strong>remove_action()<\/strong><\/p><p>In contrast, <strong>remove_action()<\/strong> unhooks a function from a specific action hook. This can be helpful when you need to override or stop a particular function from running, especially when dealing with third-party plugins or themes.<\/p><pre class=\"wp-block-preformatted\">remove_action( 'wp_head', 'wp_generator' );<\/pre><p>Here, you use <strong>remove_action()<\/strong> to unhook <strong>wp_generator<\/strong> from <strong>wp_head<\/strong>.<\/p><p><strong>has_action()<\/strong><\/p><p>Use the <strong>has_action()<\/strong> function to verify if an action hook has any functions attached to it before executing certain code, ensuring that the action you intend to modify is indeed hooked.<\/p><pre class=\"wp-block-preformatted\">if ( has_action( 'wp_footer', 'my_custom_footer' ) ) {<br><br>\/\/ The custom footer function is hooked, so do something<\/pre><p>In the above example, <strong>has_action()<\/strong> checks whether the <strong>my_custom_footer<\/strong> function is hooked to the <strong>wp_footer<\/strong> action. If it is, you can use a conditional statement to execute additional logic based on that condition.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>This article covered how the WordPress<strong> add_action()<\/strong> function enables you to extend and customize your website. From adding custom scripts and footer messages to creating unique sidebar widgets, you can quickly tailor your site&rsquo;s functionality without altering core files.<\/p><p>We&rsquo;ve also discussed other action-related functions like <strong>do_action()<\/strong>, <strong>remove_action()<\/strong>, and <strong>has_action()<\/strong>, giving you even more control over how and when WordPress executes your custom code. Mastering these tools lets you create a more dynamic and personalized WordPress website.<\/p><h2 class=\"wp-block-heading\" id=\"h-wordpress-add-action-faq\">WordPress add_action() FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1724661476448\"><h3 class=\"schema-faq-question\">What is the difference between add_action() and add_filter()?<\/h3> <p class=\"schema-faq-answer\"><strong>add_action()<\/strong> inserts custom functions into action hooks that execute at specific points, while <strong>add_filter()<\/strong> attaches functions to filter hooks that modify data before it is displayed. Both are important for extending WordPress functionality.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1724661482850\"><h3 class=\"schema-faq-question\">Is it safe to use add_action() in the functions.php file?<\/h3> <p class=\"schema-faq-answer\">Yes, it&rsquo;s safe to use <strong>add_action()<\/strong> in the <strong>functions.php<\/strong> file. However, consider creating a custom plugin for complex or reusable code to keep your WordPress code clean and maintainable.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1724661488701\"><h3 class=\"schema-faq-question\">What is the difference between do_action() and add_action()?<\/h3> <p class=\"schema-faq-answer\"><strong>add_action()<\/strong> registers a function to run when an action hook is triggered, while <strong>do_action()<\/strong> triggers that hook, executing all attached functions. Together, they allow for flexible and modular code execution in WordPress.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is a highly customizable platform that allows users to extend its functionality through various hooks and functions. One of the most used functions is add_action(), which lets you add custom behavior to your site without modifying WordPress core files. In this article, you&rsquo;ll learn how to use WordPress&rsquo;s add_action() function to connect your custom [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/wordpress-add_action\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":411,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to use WordPress add_action() + practical examples","rank_math_description":"WordPress add_action attaches an action hook to a function. Read this article to learn what WordPress actions are and how to use the add_action.","rank_math_focus_keyword":"wordpress add_action","footnotes":""},"categories":[22637],"tags":[],"class_list":["post-114738","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/wordpress-add_action","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/wordpress-add_action","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/wordpress-add_action","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/wordpress-add_action","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/wordpress-add_action","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/wordpress-add_action","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/wordpress-add_action","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/wordpress-add_action","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/114738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=114738"}],"version-history":[{"count":6,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/114738\/revisions"}],"predecessor-version":[{"id":143706,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/114738\/revisions\/143706"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=114738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=114738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=114738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}