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

Filter Reference

Fabian Pimminger edited this page May 16, 2016 · 3 revisions

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

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


afbia_kicker

This filter is used to filter the content of the op-kicker element after it is set with the default content (= category).

You can use afbia_kicker to replace the kicker text or modify it.

Parameters:

  • $kicker
  • $post_id

Usage:

<?php add_filter( 'afbia_kicker', 'filter_function_name' ) ?>

Example:

function your_kicker_filter( $kicker, $post_id ) {
    $kicker =  "NEW KICKER TEXT";
    return $kicker;
}
add_filter( 'afbia_kicker', 'your_kicker_filter', 10, 2 );

afbia_content

This filter is used to filter the content of the instant article after it is retrieved from the database and before it is returned to the feed.

You can use afbia_content to replace the main article text or modify it.

Parameters:

  • $content

Usage:

<?php add_filter( 'afbia_content', 'your_function_name' ); ?>

afbia_author

This filter is used to filter the content of the address element after it is set with the default content (= author).

You can use afbia_author to replace the author or modify it.

Parameters:

  • $author
  • $post_id

Usage:

<?php add_filter( 'afbia_author', 'your_function_name' ); ?>

afbia_author_role

This filter is used to filter the title attriute of the address element after it is set with the default content.

You can use afbia_author_role to replace the author role or modify it.

Parameters:

  • $author_role
  • $post_id

Usage:

<?php add_filter( 'afbia_author_role', 'your_function_name' ); ?>