mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
9e53314c3a
- new code structure, optimized for next development; - created spl_autoloader for remove includes; - UM classes with namespaces; - deprecated global $ultimatemember; variable (use UM() instead); - new UM/WP roles logic; - new settings class and logic (deprecated Redux framework, deprecated some old options, added some new options); - new dependencies class for extensions; - WP native styles for backend fields; - new upgrades and license activations for extensions; - new logic form backend forms and fields; - created uninstall.php file for delete permanently all UM settings; - optimized registration/upgrade profile process; Deprecated Hooks: um_new_user_registration_plain um_user_registration_extra_hook um_add_user_frontend um_post_registration_global_hook um_admin_extend_directory_options_general (was action...will be filter)
55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
|
|
|
/***
|
|
*** @adds a form identifier to form
|
|
***/
|
|
add_action('um_after_form_fields', 'um_add_form_identifier');
|
|
function um_add_form_identifier($args){ ?>
|
|
|
|
<input type="hidden" name="form_id" id="form_id" value="<?php echo $args['form_id']; ?>" />
|
|
|
|
<?php
|
|
}
|
|
|
|
/***
|
|
*** @adds a spam timestamp
|
|
***/
|
|
add_action('um_after_form_fields', 'um_add_security_checks');
|
|
add_action('um_account_page_hidden_fields', 'um_add_security_checks');
|
|
function um_add_security_checks($args){
|
|
if ( is_admin() ) return;
|
|
|
|
echo '<input type="hidden" name="timestamp" id="timestamp" value="'. current_time( 'timestamp' ) .'" />';
|
|
|
|
?>
|
|
|
|
<p class="<?php echo UM()->honeypot; ?>_name">
|
|
<label for="<?php echo UM()->honeypot; ?>"><?php _e( 'Only fill in if you are not human' ); ?></label>
|
|
<input type="text" name="<?php echo UM()->honeypot; ?>" id="<?php echo UM()->honeypot; ?>" class="input" value="" size="25" autocomplete="off" />
|
|
</p>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
/***
|
|
*** @makes the honeypot invisible
|
|
***/
|
|
add_action('wp_head', 'um_add_form_honeypot_css');
|
|
function um_add_form_honeypot_css() { ?>
|
|
|
|
<style type="text/css">.<?php echo UM()->honeypot; ?>_name { display: none !important; }</style>
|
|
|
|
<?php }
|
|
|
|
/***
|
|
*** @empty the honeypot value
|
|
***/
|
|
add_action('wp_footer', 'um_add_form_honeypot_js', 99999999999999999 );
|
|
function um_add_form_honeypot_js() { ?>
|
|
|
|
<script type="text/javascript">jQuery( '#<?php echo UM()->honeypot; ?>' ).val( '' );</script>
|
|
|
|
<?php
|
|
}
|