Insert text to xenforo editor with redactor api - redactor

With document.ready event I want add a string = 'bla bla bla' to redactor editor in xenforo
i'm try
$('#ctrl_message_html').redactor('set', 'Your text goes here');
$('#ctrl_message_html').redactor('inserttext', 'Your text goes here');
but it don't have any effect...pls guide me how to insert it with xenfor redactor editor
thank you very much!

Related

How to remove text from WooCommerce customer_order_completed email via php?

I can't seem to figure out (without using a template) how to remove this text from the customer_completed_order email. :
'We have finished processing your order.'
I am hooking just below it with some new text to replace it:
add_action( 'woocommerce_email_before_order_table', 'fs_action_woocommerce_email_responder',20, 4);

Reset Password Email Template Wordpress

I have Requirement to change the reset password email template, i have checked the woocommerece email settings and it is on for the reset email from there, but issue is when user request to reset the password it is generating email from there, but using the email content form Wordpress core File
wp-include > user.php
attached it is the screenshot as well.
What i have to do it to remove following section
Regards,
All at ###SITENAME###
So how i can achieve it and if there is any possibilities to enable the Woocommerece template somehow so can directly copy template in my child theme and customize it there?
You can use password_change_email filter for customizing text.
add_filter( 'password_change_email', 'change_password_mail_message', 10, 3 );
function change_password_mail_message(
$pass_change_mail,
$user,
$userdata
) {
$new_message_txt = __( 'Your Text' );
$pass_change_mail[ 'message' ] = $new_message_txt;
return $pass_change_mail;
}

Display n characters of Text field from Contact Form 7

I'm not sure if this question was asked but I couldn't find the solution.
I want to display the first 2 characters from the Contact form 7 text field in the mail.
For example, a person types "TODAY" in the text field.
In the email, I would like to display on the first 2 characters which are "TO" in the mail section when the admin receive the email.
How can I achieve this?
You could do something like this
Add this script however you are adding scripts to your page, in a static .js file, or you can add this to the end of your contact form.
<script>
jQuery('input[name="your-name"]').blur(function () {
var s = jQuery(this).val().substr(0, 2);
if (jQuery('#name-value').length) {
jQuery('#name-value').val(s);
} else {
jQuery(this).after('<input name="name-value" id="name-value" type="hidden" value="' + s + '">');
}
});
</script>
Replace 'first-name' with whatever you are using here and replace 'name-value' with what you want to use for the email form.
Then in your admin email, use the form tag
[name-value] and it will show up in the email. Contact form 7 turns all form fields into tags by name.

how to change woocommerce mini cart button name to specific tag on header?

I want to change mini "cart" button name to "view Cart" in header widget, i have tried on google but not yet get.
Change WooCommerce "cart" button text for specific tag
Add the following code to your function.php file, and change your specific tag
add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('Order Total', 'New Text Goes Here', $translated);
return $translated;
}

How Can I Change Order Total Heading in get_order_item_totals (WooCommerce)?

I would like to change the "Order Total:" text on the Thank You (/order/received/) page.
I see that it is in the file /includes/abstracts/abstract-wc-order.php (function get_order_item_totals) but I'm not sure how I can override this file.
I also want to override the "Order Total:" text in the email that the admin receives when someone places an order but I assume that this will also be updated as it's the same content as on the Thank You page.
Does anyone know how to change this text?
Thanks in advance!
1) Add the following text into your functions.php file in your theme. This may not override the text in your email however.
add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('Order Total', 'New Text Goes Here', $translated);
return $translated;
}
2) You can edit the template of the emails by going to wp-content/plugins/woocommerce/templates/emails/. Before editing copy this file and paste it to wp-content/themes/yourthemename/woocommerce/emails/. More information on the template structure can be found here.

Resources