Submit form to db

You are serializing your form data before posting it to your PHP function, but you do not unserialize it at the other end. Therefore your check for $_POST[‘attend’] == ‘yes’will always fail. Try the following (untested). function eventAttend() { $fields = array( ); parse_str( $_POST[‘data’], $fields ); if($fields[‘attend’] == ‘yes’) { global $wpdb; $wpdb->insert(‘wp_event_attendants’, array( … Read more

How to validate inputs with filter in register_setting callback

First of all I would recommend you to rename your function to wpPartSanitize_settings, because this function doesn’t validate anything. As it doesn’t validate anything, then you aren’t able to “inform” administrator that one input is invalid. Nevertheless, to create your hook for wpPartValidate_settings filter, just do it like this: add_filter( ‘wpPartValidate_settings’, ‘wpse8170_sanitize_settings’, 10, 2 ); … Read more

Listing wordpress users with a search function

This worked for me. $user_query = new WP_User_Query( array( ‘search’ => ‘*example.net*’, ‘search_columns’ => array(‘user_url’) )); $authors = $user_query->get_results(); The wild card to be used in the search string is ‘*’ and not ‘%’. Also you have to include the ‘search_columns’ parameter with the following possible values search_columns = array( ‘user_nicename’, ‘user_login’, ‘user_email’, ‘user_url’ ) … Read more