[wp-trac] [WordPress Trac] #33113: Add is_template_part() functionality
WordPress Trac
noreply at wordpress.org
Mon Oct 26 19:12:51 UTC 2015
#33113: Add is_template_part() functionality
-------------------------+----------------------
Reporter: GunGeekATX | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Themes | Version:
Severity: normal | Resolution: wontfix
Keywords: | Focuses:
-------------------------+----------------------
Comment (by GunGeekATX):
Core does call {{{do_action( "get_template_part_{$slug}", $slug, $name
);}}}, but checking for that action as outlined above doesn't work.
I this case, I have a template `partials/blog_landing/author-link.php`
calling a filter:
{{{$link_text = apply_filters( 'blog-landing-author-link-text',
get_the_author() );}}}
Inside the function for that filter, when I call
{{{doing_action( 'get_template_part_partials/blog_landing/author');}}}, it
always returns `false`.
If I var_dump() the global `$wp_current_filter` variable being used by
core's doing_action() and doing_filter() functions, it only has one item
in the array, the `blog-landing-author-link-text` filter that is currently
running.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33113#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list