aioseop_title_format

Need help with this?
Purchase All in One SEO Pack Pro to get dedicated support from us.

Buy Now

The All in One SEO Pack aioseop_title_format hook.

Description

$new_title = apply_filters( ‘aioseop_title_format’, $new_title );

This filter can be used to create a custom Title Format macro that calls a function.


Parameters (4)

0.$new_title (string)
passes on the current title which can then be filtered and returned.

Usage

add_filter( 'aioseop_title_format', 'my_custom_title_format', 10, 1 );

function my_custom_title_format( $title ){
     return str_replace( '%custom_template_tag%', 'My title text', $title );
}

Example with a function:

add_filter( 'aioseop_title_format', 'my_custom_title_format', 10, 1 );

function my_custom_title_format( $title ){
     return str_replace( '%custom_template_tag%', my_replacement_function( $title ), $title );
}

function my_replacement_function( $title ){
     // Complex custom code here to calculate replacement text.
     return 'My title text';
}

Defined (1)

The filter is defined in the following location(s).

/modules/aioseop-class.php (3 occurences)

This hook was added in version 3.0 of All in One SEO Pack.

For instructions on how to use this code, please refer to our FAQ here.

  • Was this helpful ?
  • YesNo
[i]
[i]
Skip to toolbar