mesh
mesh copied to clipboard
Add filter for Mesh column titles
It would be great if the title markup for Mesh columns can be filtered.
<h3 class="entry-subtitle">
<?php echo apply_filters( 'the_title', esc_html( $block->post_title ) ); ?>
</h3>
Additional actions can also be helpful:
<?php do_action( 'mesh_column_before', $block_increment ); ?>
[...]
<?php do_action( 'mesh_column_after', $block_increment ); ?>
Edit: And for the section title, too:
<div class="<?php echo esc_attr( mesh_get_title_class() ); ?>">
<h2 class="entry-title"><?php echo apply_filters( 'the_title', the_title() ); ?></h2>
</div>
Edit: It seems to be better to use the_title instead a mesh-specific filter. Or use both?
Good idea. Might be better to make a mesh specific filter first so it can be explicitly targeted. We can also apply the_title filter as well. technically all blocks/columns are posts as well so they adhere to the_title filter. As you have seen you can also simply create a new template if you needed vs filtering. Or you could override the default template with your own as long as you use the same name. It accomplishes the same goal with out adding more and more filters
@aaronware: Yes, I copied the 2-columns Mesh template and use it in theme with apply_filters added.
Ideally this could be even avoided by using an inbuilt filter.