/var/www/hkosl.com/aga/wp-content/plugins/wp-super-cache/plugins/awaitingmoderation.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php

function awaitingmoderation_action$buffer ) {
    
$buffer str_replace__'Your comment is awaiting moderation.''wp-super-cache' ), ''$buffer );
    return 
$buffer;
}

function 
awaitingmoderation_actions() {
    global 
$cache_awaitingmoderation;
    if ( 
'1' === $cache_awaitingmoderation ) {
        
add_filter'wpsupercache_buffer''awaitingmoderation_action' );
    }
}
add_cacheaction'add_cacheaction''awaitingmoderation_actions' );

// Your comment is awaiting moderation.
function wp_supercache_awaitingmoderation_admin() {
    global 
$cache_awaitingmoderation$wp_cache_config_file$valid_nonce;

    
$cache_awaitingmoderation '' === $cache_awaitingmoderation '0' $cache_awaitingmoderation;

    if ( isset( 
$_POST['cache_awaitingmoderation'] ) && $valid_nonce ) {
        
$cache_awaitingmoderation = (int) $_POST['cache_awaitingmoderation'];
        
wp_cache_replace_line'^ *\$cache_awaitingmoderation'"\$cache_awaitingmoderation = '$cache_awaitingmoderation';"$wp_cache_config_file );
        
$changed true;
    } else {
        
$changed false;
    }
    
$id 'awaitingmoderation-section';
    
?>
        <fieldset id="<?php echo $id?>" class="options">
        <h4><?php _e'Awaiting Moderation''wp-super-cache' ); ?></h4>
        <form name="wp_manager" action="" method="post">
        <label><input type="radio" name="cache_awaitingmoderation" value="1" <?php if ( $cache_awaitingmoderation ) { echo 'checked="checked" '; } ?>/> <?php _e'Enabled''wp-super-cache' ); ?></label>
        <label><input type="radio" name="cache_awaitingmoderation" value="0" <?php if ( ! $cache_awaitingmoderation ) { echo 'checked="checked" '; } ?>/> <?php _e'Disabled''wp-super-cache' ); ?></label>
        <p><?php _e'Enables or disables plugin to Remove the text "Your comment is awaiting moderation." when someone leaves a moderated comment.''wp-super-cache' ); ?></p>
        <?php
        
if ( $changed ) {
            if ( 
$cache_awaitingmoderation ) {
                
$status __'enabled''wp-super-cache' );
            } else {
                
$status __'disabled''wp-super-cache' );
            }
            echo 
'<p><strong>' sprintf__'Awaiting Moderation is now %s''wp-super-cache' ), $status ) . '</strong></p>';
        }
        echo 
'<div class="submit"><input class="button-primary" ' SUBMITDISABLED 'type="submit" value="' __'Update''wp-super-cache' ) . '" /></div>';
        
wp_nonce_field'wp-cache' );
    
?>
    </form>
    </fieldset>
    <?php

}
add_cacheaction'cache_admin_page''wp_supercache_awaitingmoderation_admin' );

function 
wpsc_awaiting_moderation_list$list ) {
    
$list['awaitingmoderation'] = array(
        
'key'   => 'awaitingmoderation',
        
'url'   => '',
        
'title' => __'Awaiting Moderation''wp-super-cache' ),
        
'desc'  => __'Enables or disables plugin to Remove the text "Your comment is awaiting moderation." when someone leaves a moderated comment.''wp-super-cache' ),
    );
    return 
$list;
}
add_cacheaction'wpsc_filter_list''wpsc_awaiting_moderation_list' );