Skip to content

Instantly share code, notes, and snippets.

@dwanjuki
Last active June 13, 2023 14:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwanjuki/9f021e60064fae888ef54a287532c5a1 to your computer and use it in GitHub Desktop.
Save dwanjuki/9f021e60064fae888ef54a287532c5a1 to your computer and use it in GitHub Desktop.
Example to allow use of additional HTML tags in the Advanced Levels Shortcode
<?php
/*
* Example to allow use of additional HTML tags in the Advanced Levels Shortcode
*
* This example will allow H1 tags, class attributes on H1 tags, and H2 tags
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmproal_allow_html_tags( $allowed_html ) {
$html = array(
'h1' => array(
'class' => array(),
),
'h2' => array(),
);
$allowed_html = array_merge( $allowed_html, $html );
return $allowed_html;
}
add_filter( 'pmproal_allowed_html', 'my_pmproal_allow_html_tags' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment