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

strtotime not working

The current_time() function whenever passed a timestamp as a parameter will return a UNIX Timestamp which is already been run through strtotime(). By passing that variable to strtotime() you’re trying to timestamp a timestamp. Try this instead: $tomorrow_time = date( ‘Y-m-j’, $time_now );

Dynamic Banner Text based on Subdomain

You can put you code in functions.php where you define the string, for example: <?php function get_banner_text() { $url = $_SERVER[“REQUEST_URI”]; if (strpos($url, “bob.”)) { $banner_text = “Welcome to Agent Bob’s Portal!”; } else { $banner_text = “Default text here”; } return $banner_text; } ?> Afterwards for example in header.php of your theme you could … Read more

Change WooCommerce currency programmatically on AJAX request

This is how I solved it: /** * Force currency change */ add_filter( ‘wcml_client_currency’, function($current) { if(isset($_GET[‘currency’]) && $_GET[‘currency’]) return $_GET[‘currency’]; if(isset($_POST[‘currency’]) && $_POST[‘currency’]) return $_POST[‘currency’]; return $current; } ); And then in order for the above filter to be listened to, it’s important that you have added below code: add_action( ‘wp_ajax_quick_view_single_product’, __NAMESPACE__ . ‘\\quick_view_single_product’ … Read more