Filters

Here’s a list of the developer filters for MightyShare. Useful to fully customize MightyShare using functions.php or adding code snippets to your site.

mightyshare_filter_post

Using the mightyshare_filter_post filter you can overwrite any aspect of a MightyShare render. This is great if you have a large site and want to programmatically control all aspects of MightyShare.

Below is an example of different variables and how you can overwrite them.

Function mightyshare_filter_post_example( $post ) {
		//Overwrite the page's template used
		$post['template'] = 'mighty-2';

		//Overwrite the page's title used to render
		$post['title'] = 'My new title!';

		//Overwrite the page's background used to render
		$post['background'] = 'https://your-image-url.jpg';

		//Force the plugin to return a MightyShare image
		$post['is_enabled'] = false;

		return $post;
}
add_filter( 'mightyshare_filter_post', 'mightyshare_filter_post_example', 10, 3 );
Was this article helpful?