WordPress action hook · part of WordPress core

print_media_templates

A WordPress core action that 3 plugins also fire themselves, running on 310+ sites between them.

“Prints the media manager custom media templates.”

How to use print_media_templates

It's an action: your callback runs at that point. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'print_media_templates', function() {
	// Your code runs here.
}, 10, 1 );

Argument names come from File Un-Attach's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

3 plugins that fire print_media_templates

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. File Un-Attach icon File Un-Attach300+ installs do_action( 'print_media_templates' ) inc/media-template.3.9.php:904
  2. Used Media Identifier icon Used Media Identifier10+ installs do_action( 'print_media_templates' ) admin/class-used-media-identifier-admin.php:1316
  3. Coyote icon CoyoteFewer than 10 installs do_action( 'print_media_templates' ) php/media-template.php:1312

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.