Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
bootstrap whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
szk11001 committed Aug 20, 2014
1 parent fa18fe4 commit 1717b2c
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
<?php
/**
* cornerstone functions and definitions
Expand Down Expand Up @@ -188,4 +187,46 @@ function load_custom_wp_admin_style($hook) {
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );

add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-thumbnails' );

//Bootstrap whitelist
function add_allowed_tags($tags) {
$newtags = array(
'div',
'ul',
'li',
'button',
'a');
$newattrs = array(
'data-toggle' => true,
'data-dismiss' => true,
'data-target' => true,
'data-spy' => true,
'data-loading-text' => true,
'data-parent' => true,
'data-slide' => true,
'data-slide-to' => true,
'data-provide' => true,
'data-interval' => true,
'data-pause' => true,
'data-animation' => true,
'data-html' => true,
'data-placement' => true,
'data-selector' => true,
'data-title' => true,
'data-trigger' => true,
'data-delay' => true,
'data-container' => true);

foreach($newtags as $newtag){
if( isset($tags[$newtag]) && is_array($tags[$newtag])){
$tags[$newtag] = array_merge($tags[$newtag], $newattrs);
}
else{
$tags[$newtag] = $newattrs;
}
}

return $tags;
}
add_filter('wp_kses_allowed_html', 'add_allowed_tags');

0 comments on commit 1717b2c

Please sign in to comment.