Calling a function via a shortcode in javascript

I’m afraid the code you’ve shared is rather wonky and there isn’t just one thing that is backwards. Here are the first few things that came into my mind. add_filter( ‘learn-press/after-content-item-summary/lp_lesson’, ‘psb_comment_listener_func’); When you attach a callback function to a filter with add_filter, the callback should return a value. If the callback isn’t supposed to … Read more

Prefix user login_name and validate it is unique on Registration

The usual way to create a user goes with the register_new_user function. This function offers no filter for the user name. It just checks for uniqueness with username_exists. To actually create the user register_new_user then calls wp_create_user, which in turn calls wp_insert_user. The latter function contains the pre_user_login filter. Then it calls username_exists again, because … Read more

Live page errors should be hidden

In your wp-config.php look for the line reading: define( ‘WP_DEBUG’, false ); (This is set to false by default, if you’re troubleshooting it may be set to true on your install) After it, add: if( WP_DEBUG == true ) { /** Don’t display WP errors */ define( ‘WP_DEBUG_DISPLAY’, false ); /** Log errors to debug.log … Read more

AJAX request blocked by CORS policy

The problem was that the PHP AJAX function was redirecting to another page, which caused these issues. I decided to just generate a link instead of redirecting.

Updating wp-config.php but it doesnt seem to exist

There is one in the file directory up That is your wp-config.php, WordPress can look one folder up so that you can place the file in a folder that’s not served to the web. This is done as a security measure. it doesn’t provide any of the usual details wp-config.php is still a PHP file, … Read more