Tag Info

New answers tagged

0

I will say, I don't exactly understand your words "when a front-end sets a date"... I'm assuming wp-admin setup. Go find a post expiration plugin. There seem to be more than a couple of these out there. The plugin I've used ws "Post Expirator" Awesome tool. You can create a start posting and stop posting date when the post is created. I used it on a ...


0

Checkout Deletion I guess you are using Woocommerce even though you did not mention it. I didn't understand why you want to delete the checkout page, but to do so, just go to Pages under the WordPress admin dashboard, and delete the checkout page. Contact Form Installation To add a contact form to your WordPress site, just install the Contact Form 7 ...


0

Reading and writing to a file is going to be dicey. You are going to be fighting with file permissions if you save anywhere but the wp-content/uploads directory (and it looks like you want to save to the plugins directory). If you have sufficient control of the server, you may get this to work by editing permissions in the plugins directory, but I wouldn't. ...


2

You can do that using Javascript, by creating new DOM elements. You can use this Try it yourself functionality from W3Schools Copy and paste this code into Try it yourself and see how it works, it just adds a new paragraph: <!DOCTYPE html> <html> <body> <div id="div1"> <p id="p1">This is a paragraph.</p> <p ...


0

Add unique field in your form. Eg: <input type="hidden" name="wdm_action" value="1"> Put your 'customer-details.php' file code in below function:- add_action('template_redirect','wdm_customer_details'){ //check if that field present in the form, if yes then perform the action if(isset($_POST['wdm_action'] && $_POST['wdm_action'] != ''){ ...


0

you just define action method in function file and leave form action blank use hook init by add_action('init',formaction); function formaction(){ if($_post['submit']=='1'){ //form submit code here } }


1

"create a plugin" isn't really a separate option, you'd still need to intercept requests somehow. I've used the init method, and it's a viable option. Checking isset on a POST var before kicking off your processing logic is extremely fast, I doubt you could even reliably measure the impact in the sea of other things going on in the load process. The other ...


1

Use a PHP function to do this: https://php.net/strip_tags example: echo strip_tags("<div>my text</div>");


0

If it's only <div></div> I would do a preg_replace, like this: $string = preg_replace ( '|</?[^>]*>|i', '', $string ); This removes only the tags, not the text between the Tags. I understood this is what you wanted.


2

I think the easiest way is adding the form via the Shortcode API. The code would look like this: function myform_handler( $atts ){ if (isset(@$_REQUEST['submit'])) { //Do something } else { $return = '<form action="" method="post"> <input type="text" name="myfield"> <input ...


0

Thanks to @websupporter I managed to find a solution to my problem. I have used this inside my Ajax function: success: function(data){ jQuery(data).find('.message').appendTo('#login-error'); } And in the php code I have done this: ... if(empty($username)) { echo "<span class='message error'>Please enter username.</span>"; exit(); ...


0

How can I show these errors inside the Ajax success or error functions? The jQuery error is triggered, when the request itself fails, for example timeout and others. See the jQuery documentation. The error messages, which are produced by PHP appear only on request success. To display these, you could do for example: success: ...



Top 50 recent answers are included