-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader.php
45 lines (37 loc) · 1006 Bytes
/
loader.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/*
Plugin Name: Comment Quote
Description: Quote comments with this nifty plugin!
Author: r-a-y
Author URI: http://profiles.wordpress.org/r-a-y
Version: 0.1
License: GPLv2 or later
*/
add_filter( 'wp_list_comments_args', function( $retval ) {
if ( ! class_exists( 'Comment_Quote' ) ) {
require_once __DIR__ . '/comment-quote.php';
Comment_Quote::init();
}
return $retval;
}, 0 );
add_filter( 'preprocess_comment', function( $retval ) {
global $allowedtags;
$allowedtags['blockquote']['class'] = true;
$allowedtags['em']['class'] = true;
$allowedtags['p'] = [];
return $retval;
}, -999 );
/**
* Enqueue CSS.
*
* Feel free to disable with the 'comment_quote_enable_css' filter and roll your
* own in your theme's stylesheet.
*/
add_action( 'wp_enqueue_scripts', function() {
if ( ! apply_filters( 'comment_quote_enable_css', true ) )
return;
if ( ! is_singular() ) {
return;
}
wp_enqueue_style( 'comment-quote', plugins_url( basename( __DIR__ ) ) . '/style.css' );
} );