View difference between Paste ID: ufRwkkBy and G04yqD4c
SHOW: | | - or go back to the newest paste.
1
<?php
2
/**
3
* Plugin Name: [redminka] Forzar terminos y condiciones
4
* Plugin URI: http://premium.wpmudev.org/forums/topic/accept-terms-of-service-in-ultimate-facebook-connect
5
* Description: Forzar aceptar los terminos y condiciones utilizando Ultimate-Facebook
6
* Version: 1.0
7
* Author: Gabriel
8
* Author URI: http://premium.wpmudev.org/forums
9
* License: GPL2
10
*/
11
12
function my_fb_add_tos_box ($fields) {
13
	$fields[] = array(
14
		"name" => "tos",
15-
		"description" => "Acepto los <a href=\"#\"> Términos y Condiciones </a>",
15+
		"description" => "Acepto los Términos y Condiciones",
16
		"type" => "checkbox",
17
		);
18
	return $fields;
19
	}
20
	add_filter('wdfb-registration_fields_array', 'my_fb_add_tos_box');
21
	
22
function my_fb_require_tos_box ($user_id, $he, $registration, $model) {
23
	if ($registration['tos']) return true;
24
	
25
	$model->delete_wp_user($user_id);
26
	wp_redirect(site_url("/my-tos-page"));
27
	die;
28
}
29
add_action("wdfb-user_registered-postprocess", "my_fb_require_tos_box", 10, 4);
30
?>