How can I designate a comment box in WordPress to use a particular plugin
I have a plugin installed on my wordpress blog that takes the email address and message and creates a new user on my other CMS platform. Problem is this effects all comment boxes. I want to re-work this plugin to check if its on a particular page if so some values would be different. If not then proceed like usual.
function ifcj_createUser_SFI($comment_id) {
# determine commenters email
global $wpdb;
$sql = "SELECT comment_author_email FROM $wpdb->comments WHERE comment_ID = $comment_id";
$userEmail = $wpdb->get_var($sql);
if ( $userEmail == NULL ) {
return false;
}
# pull in class file
require( ABSPATH . 'class.convio_api.php');
# create instance and connection with convio, ALWAYS REQUIRED
$c = new ConvioAPI('site_id=xxx&api_key=xxxxxx&login_name=xxx@xxx.org&login_password=xxxxx');
# add user to groups/interes开发者_Python百科ts (this can be done when creating the user also)
$c->createUpdateUser('primary_email='.$userEmail.'&add_group_ids=73663&add_interest_ids=3761');
return true;
}
add_action('comment_post','ifcj_createUser_SFI',0,1);
Thanks in advance.
Use conditional tags: http://codex.wordpress.org/Conditional_Tags
Here is how you would test for a certain page: http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
Like:
if ( is_page( '2' ) ) {
return false;
}
精彩评论