Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Trouble knowing the current template?
- add_action('admin_bar_menu', function ($adminBar) {
- global $template;
- $templateName = basename($template);
- $adminBar->add_menu([
- 'id' => 'template-name',
- 'parent' => 'top-secondary',
- 'title' => 'Template: ' . $templateName,
- 'href' => '#',
- 'meta' => [
- 'title' => __('Template name')
- ]
- ]);
- });
Add Comment
Please, Sign In to add comment