forked from crowdfavorite/wp-carrington-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compatibility.php
64 lines (52 loc) · 1.89 KB
/
compatibility.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
<?php
// This file is part of the Carrington Core Platform for WordPress
// http://crowdfavorite.com/wordpress/carrington-core/
//
// Copyright (c) 2008-2012 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
/**
* Outputs hidden fields for comment form with unique IDs, based on post ID, making it safe for AJAX pull.
*
*/
function cfct_comment_id_fields() {
global $id;
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
echo cfct_get_comment_id_fields($id, $replytoid);
}
function cfct_get_comment_id_fields($id, $replytoid) {
$out = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID_p$id' />\n";
$out .= "<input type='hidden' name='comment_parent' id='comment_parent_p$id' value='$replytoid' />\n";
return $out;
}
/**
* Filter the comment reply link to add a unique unique ID, based on post ID, making it safe for AJAX pull.
*
**/
function cfct_get_cancel_comment_reply_link($reply_link, $link, $text) {
global $post;
if ( !empty($text) ) { $text = __('Cancel', 'carrington'); }
$style = '';
if (!isset($_GET['replytocom'])) {
$style = ' style="display:none;"';
}
$reply_link = '<a rel="nofollow" id="cancel-comment-reply-link-p' . $post->ID . '" href="' . $link . '-p' . $post->ID . '"' . $style . '>' . $text . '</a>';
return $reply_link;
}
// For meeting wordpress.org requirements
/*
get_avatar();
the_tags();
register_sidebar('none');
bloginfo('description');
wp_head();
wp_footer();
*/