How to return html as a string from php for WordPress

You are missing multiple single quotes around $a[url], so after src=”https://wordpress.stackexchange.com/questions/350229/ there should be a” and after $a[url] there should be another single quote, and you also need to quote the array key, so the whole return line should be return ‘<audio class=”listen” preload=”none” data-size=”250″ src=”‘ . $a[‘url’] . ‘”></audio></div></div>’;

How to access this jQuery/AJAX data in a PHP file/WordPress plugin

WordPress provides a way to access PHP variable into .js file using the wp_localize_script so if your follow that it’s standard practice (standard practices are always advisable). Your next question is my-ajax.php and plugin URL. All ajax in WordPress process through admin-ajax.php (Standard one) that file could be found in wp-admin so wp_localize_script should be … Read more

Problem with my Login Plugin

You have a number of problems that have to be corrected for this to work. Shortcodes should return content – not echo/print it to the screen. You should sanitize your retrieved $_POST values before use. You can’t query the db for a plain text password. Passwords are hashed. Don’t do your form processing outside of … Read more