age_gate_logo

You are reading the documentation for Age Gate 2.x. Switch to the documentation for 3.x.

Description

Allows the logo set for Age Gate to customised.

This accepts two parameters:

  • $html: the generated markup
  • $image_id the id of the image selected

This could be used to retrieve responsive versions of your logo:

add_filter('age_gate_logo', 'my_logo_filter', 10, 2);

function my_logo_filter($html, $image_id){

  return '<img src="'. wp_get_attachment_url($image_id) .'" srcset="' . wp_get_attachment_image_srcset($image_id) . '" sizes="(max-width: 200px) 100px,
            (max-width: 480px) 150px, 800px">';

}

Note: that this filter is still called even if no logo is selected, though $image_id will be 0

Changelog

  • Added: 2.0.0