Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for Mesh column titles #242

Open
strarsis opened this issue Jun 13, 2018 · 2 comments
Open

Add filter for Mesh column titles #242

strarsis opened this issue Jun 13, 2018 · 2 comments

Comments

@strarsis
Copy link
Contributor

strarsis commented Jun 13, 2018

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?

@aaronware
Copy link
Collaborator

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

@strarsis
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants