Skip to content

Instantly share code, notes, and snippets.

@danielbachhuber
Forked from mjangda/allow-ids.php
Last active December 10, 2015 16:08
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 danielbachhuber/4458485 to your computer and use it in GitHub Desktop.
Save danielbachhuber/4458485 to your computer and use it in GitHub Desktop.
<?php
add_action( 'admin_init', 'x_allow_ids_on_tags' );
function x_allow_ids_on_tags() {
global $allowedposttags;
$tags = array( 'div' );
$new_attributes = array( 'contenteditable' => 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