function upload_image_ajax() {
var form_data = new FormData(); // Creating object of FormData class
var file_data = $('#news_feed_img').prop("files")[0]; // Getting the properties of file from file field
form_data.append("file", file_data) // Appending parameter named file with properties of file_field to
form_data.append('newsfeed_id', '1');
form_data.append('action', 'delete');
$.ajax({
url: "method/someclass.php",
type: "post",
dataType: 'text',
processData: false,
contentType: false,
data: form_data,
success: function (text) {
if (text == "success") {
return true;
} else {
alert("Something Went Wrong Please Try Again");
return true;
}
},
error: function () {
alert("An error occured, please try again.");
}
});
}
Upload Images With data Using Ajax
Remove PHP Extension from URL Using Htaccess URL Rewrite Rule
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
In this above code we have used the Rewrite Rule and removed the .php extension from all the URL which fulfill the rule.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
In this above code we have used the Rewrite Rule and removed the .php extension from all the URL which fulfill the rule.
Change the "Proceed to PayPal" button text in the WooCommerce checkout screen
/* Change the "Proceed to PayPal" button text in the WooCommerce checkout screen
* Add this to your theme's functions.php file
*/
add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 );
function custom_paypal_button_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Proceed to PayPal' :
$translated_text = __( 'Proceed to Payment', 'woocommerce' );
break;
}
return $translated_text;
}
* Add this to your theme's functions.php file
*/
add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 );
function custom_paypal_button_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Proceed to PayPal' :
$translated_text = __( 'Proceed to Payment', 'woocommerce' );
break;
}
return $translated_text;
}
Subscribe to:
Posts (Atom)