Main menu

Filter file headers written to PO and POT files

This example sets the Report-Msgid-Bugs-To header which may differ according to which bundle is being translated.

function filter_po_headers( ArrayAccess $head ){
    if( 'foo' === $head['X-Domain'] ){
        $head['Report-Msgid-Bugs-To'] = 'Baz';
    }
}
add_filter('loco_po_headers','filter_po_headers',999,1);

The loco_pot_headers filter behaves in exactly the same way, but operates on saved POT files.

See also

Last updated by