How to increase password requirements for registration [closed]

Use a hook that fires later and add the $bp global to the function. Try this: function bp_password_beefing() { global $bp; if ( !empty( $_POST[‘signup_password’] ) ) if ( strlen( $_POST[‘signup_password’] ) < 6 ) $bp->signup->errors[‘signup_password’] = __( ‘Your password needs to be at least 6 characters’, ‘buddypress’ ); } add_action( ‘bp_signup_validate’, ‘bp_password_beefing’);

add_action for lost_password or modify wp-login.php?action=lostpassword

got a working solution, but wordpress first validate the username or email address then my validation takes place.. I have used allow_password_reset filter instead of lostpassword_post action: add_filter( ‘allow_password_reset’, ‘my_password_reset_helper’ ); function my_password_reset_helper($true) { if (isset($_POST[‘g-recaptcha-response’])) { $array = array(‘response’ => $_POST[‘g-recaptcha-response’], ‘userip’ => $_SERVER[‘REMOTE_ADDR’], ‘secret’ => ‘asddfer345gfdg4veg45y34635345’); $result = gcaptcha($array); if (!$result) { return … Read more

How to detect when a user changes their name?

The hook you’re looking for is insert_user_meta. add_filter( ‘insert_user_meta’, function( $meta, $user, $update ) { if( true !== $update ) return $meta; $old_meta = get_user_meta( $user->ID ); if( $old_meta[ ‘first_name’ ] !== $meta[ ‘first_name’ ] ) { //* Do something } return $meta; }, 10, 3 );

admin_notices not working in post editor

So it looks like there is some page redirecting going on in the post updating process, hence why I can’t even access a $GLOBALS variable. The only alternative I found to use was to use a session variable. Something like: add_filter( ‘pre_insert_term’, ‘pre_insert_term_action’, 10, 2 ); add_action( ‘admin_notices’, ‘show_example_error’ ); function pre_insert_term_action( $term, $taxonomy ) … Read more

hooks & filters and variables

If you want to return the data, the best solution is to use apply_filters() and instruct the callback to always return: $output = apply_filters( ‘hook_data_handle_’.$args[‘UID’], $args, $options ); if ( $args[‘echo’] ) echo $output; else return $output; A less elegant solution would be to use output buffering.

How to get post ID in post_updated action hook?

You should be able to get the ID of the post through the $_POST variable. EDIT: Maybe you should try doing this on the save_post action, like so, but save_post sometimes runs on other instances (ie. Autosave Drafts), so you’ll want to do some more verifying. save_post will also return the ID as one of … Read more

Searching a hook which triggers when deleting a post to get all comments

There are few other hooks to manipulated the trashed comment. ‘save_post’: called after post is saved. You can check status of the post and manipulate its comment accordingly. ‘trashed_comment’: called after comment is moved to trash status. ‘transition_comment_status’: called whenever comment status is changed. There are probably few others too. But, it depends what you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)