Skip to content
This repository was archived by the owner on Mar 31, 2022. It is now read-only.

Action Reference

Fabian Pimminger edited this page May 13, 2016 · 2 revisions

This is a list of action hooks available in the AFB Instant Articles Plugin.

For more information regarding filters and action hooks, see Plugin API @ Wordpress Codex


afbia_article_header

This action is called at the bottom of the <header> element in every instant article

You use this hook by having your function echo output or by having it perform background tasks. Your functions shouldn't return, and shouldn't take any parameters.

Parameters: None

Usage:

<?php add_action( 'afbia_article_header', 'your_function_name' ); ?>

afbia_article_body

This action is called at the bottom of the <body> element right before the <footer> in every instant article

You use this hook by having your function echo output or by having it perform background tasks. Your functions shouldn't return anything.

Parameters:

  • $post_id

Usage:

<?php add_action( 'afbia_article_body', 'your_function_name' ); ?>

Example:

function your_body_function($id) {
    echo '
    <figure class="op-tracker">
        <iframe>
            <!-- Include full analytics code here -->
        </iframe>
    </figure>
    ';
}
add_action( 'afbia_article_body', 'your_body_function', 10, 1);

afbia_article_footer

This action is called at the bottom of the <footer> element in every instant article

You use this hook by having your function echo output or by having it perform background tasks. Your functions shouldn't return, and shouldn't take any parameters.

Parameters: None

Usage:

<?php add_action( 'afbia_article_footer', 'your_function_name' ); ?>

Clone this wiki locally