Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created May 1, 2013 18:52
Show Gist options
  • Save whyisjake/5497435 to your computer and use it in GitHub Desktop.
Save whyisjake/5497435 to your computer and use it in GitHub Desktop.
<?php
add_action( 'init', 'mf_allow_data_atts' );
function mf_allow_data_atts() {
global $allowedposttags;
$tags = array( 'div,a,li' );
$new_attributes = array( 'data' => array() );
foreach ( $tags as $tag ) {
if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) )
$allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment