Skip to content

Instantly share code, notes, and snippets.

@paulgibbs
Forked from mjangda/allow-ids.php
Created March 7, 2013 08:28
Show Gist options
  • Save paulgibbs/5106454 to your computer and use it in GitHub Desktop.
Save paulgibbs/5106454 to your computer and use it in GitHub Desktop.
<?php
function x_allow_ids_on_tags() {
global $allowedposttags;
$tags = array( 'section', 'article' );
$new_attributes = array( 'id' => array() );
foreach ( $tags as $tag ) {
if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) )
$allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes );
}
}
// Do it, to it!
add_action( 'init', 'x_allow_ids_on_tags' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment