Plugin Directory

Changeset 1303283

Timestamp:
12/08/2015 09:22:17 PM (9 years ago)
Author:
nickmomrik
Message:

Add card to allowedtags instead of rewriting the entire array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • card-converter/trunk/card-converter.php

    r1303223 r1303283  
    7777
    7878function mdv_card_converter_css() {
    79 //Adds CSS to head
    80 echo <<<END
     79Adds CSS to head
     80?>
    8181    <style type='text/css'>
    8282        .redcardsuit, .blackcardsuit, .nocardsuit, .invalidcard {
     
    9898        }
    9999    </style>
    100 END;
     100<?php
    101101}
    102102
    103 // Define custom tags to allow span tag
    104 define( 'CUSTOM_TAGS', true );
    105 $allowedtags = array(
    106     'a'          => array(
    107         'href'  => array(),
    108         'title' => array(),
    109         'rel'   => array(),
    110     ),
    111     'abbr'       => array( 'title' => array() ),
    112     'acronym'    => array( 'title' => array() ),
    113     'b'          => array(),
    114     'blockquote' => array( 'cite' => array() ),
    115     'card'       => array(),
    116     'code'       => array(),
    117     'em'         => array(),
    118     'i'          => array(),
    119     'span'       => array( 'class' => array() ),
    120     'strike'     => array(),
    121     'strong'     => array(),
    122 );
     103function mdv_allow_card_tag() {
     104    global $allowedtags, $allowedposttags;
     105
     106    define( 'CUSTOM_TAGS', true );
     107
     108    $allowedtags['card'] = array();
     109    $allowedposttags['card'] = array();
     110}
    123111
    124112add_filter( 'the_content', 'mdv_card_converter' );
     
    126114add_filter( 'comment_text', 'mdv_card_converter', 9 );
    127115add_action( 'wp_head', 'mdv_card_converter_css' );
     116
Note: See TracChangeset for help on using the changeset viewer.