how can I disallow special characters, space, capital letter, dot in user name on registration?

please try below function for disallow special characters, space, capital letter, dot in user name on registration //add a filter to invalidate a username with spaces,special characters, capital letter, dot add_filter(‘validate_username’,’restrict_space_in_username’,10,2); function restrict_space_in_username($valid,$user_name){ //check if there is an space if ( preg_match(‘/\s[!@#$%^&*()+=\-\[\]\’;,.\/{}|”:<>?~\\\\][A-Z](.)/’,$user_name) ) return false;//if myes, then we say it is an error return $valid;//otherwise … Read more

Can we use corePHP code in wordpress?

Yes, you can use ‘normal PHP’. It is not necessary to use object-oriented PHP. Also, WordPress is not all OOP, a lot of it is just functions and functional based programming.

How to do a MySql query in WordPress?

You can write your own MySQL queries by getting the global $wpdb variable and preparing a SQL statement and then getting the results. global $wpdb; $prepared_query = $wpdb->prepare( ‘SELECT * FROM [your_table] WHERE LAST_INSERT_ID();’ ); $results = $wpdb->get_results( $prepared_query ); Please, be very careful when using this, if you do it incorrectly, it could be … Read more

Get meta_query value by user meta array

This should be better for what you’re looking for, the only issue might be how the meta gets returned, as an actual array, or as a string that needs to be turned into an array. $args = array( ‘post_type’ => ‘pictures’, ‘orderby’ => ‘post_modified’, ‘order’ => ‘DESC’ // post_status is unnecessary because default is ‘publish’ … Read more

Creating Log-In Page for backend server

VICTORY. At least…no 404 anymore. I haven’t actually tried to use the script yet, too excited. Thanks for the direction, Nath! Here is what I did. I went to my theme and created a subfolder titled, “js.” In the same theme, I edited header.php to include the following just below : (The part in bold, … Read more

Cannot pass variable to page definition

You called: add_submenu_page( ‘tools.php’, ‘STL Update’, ‘STL Update’, ‘manage_options’, ‘update_live’, [‘stl_page’, ‘stagingSite’ => $stagingSite]); Note that the 6th parameter you passed was [‘stl_page’, ‘stagingSite’ => $stagingSite] which is not a callable type, and a callable is expected. callable can be: ‘function_name’ [ $object, ‘method_name’ ] [ ‘class’, ‘static_method_name’ ] function() { /* I’m a lambda/closure/anonymous … Read more