Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 782 Bytes

body_tag_attributes.rst

File metadata and controls

50 lines (32 loc) · 782 Bytes

body_tag_attributes

Usage

Filters the tags applied to the <body> element of the page

Value

array $attributes

Attributes to add to or alter

Arguments

None

Examples

class MyPlugin extends Omeka_Plugin_AbstractPlugin
{
    protected $_filters = array('body_tag_attributes');

    public function filterBodyTagAttributes($attributes)
    {
        //add a class when users are logged in

        if(current_user()) {
            $attributes['class'] = trim("logged-in " . $attributes['class']);

        }
        return $attributes;        
    }
}