New answers tagged

0

I have written a function that will convert the qtranslate-x string into array of language and based on that you can use a particular language. /** * This function breaks q-translate string into array per language. * * @param - {string}$content - the q-translate string Eg : [:en]Title in English[:fr]Title in French * @return {array/bool} $lang - an ...


0

Although the hooks are passing you the ID of the changed object in the parameter $object_id, you aren't using it and are calling get_the_ID instead which will give you the ID of the current loop item. Try changing your uses of $post_id to $object_id instead.


0

it is already in WP-CORE! now wordpress already allows to register EMAIL as username. but if you are talking about already registered users, then try the listed answers.


0

For comment approved, you can review this question Approve comment hook? For comment submitted, you can hook into the comment_post hook, like function show_message_function( $comment_ID, $comment_approved ) { if( 0 === $comment_approved ){ //function logic goes here } } add_action( 'comment_post', 'show_message_function', 10, 2 ); Code ...


0

I personally wouldn't use the wp_mail-function, nor the php mail-function. Both of them don't give you much control over your email. If you want to send HTML emails it's a good idea to send a plain text mail with it, so that users that are unable to read HTML emails can read your message too. Have a look on phpmailer that's a very good email sending class ...


1

Try this one. add_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' ); $to = 'sendto@example.com'; $subject = 'The subject'; $body = 'The email body content'; $headers = array('Content-Type: text/html; charset=UTF-8'); wp_mail( $to, $subject, $body , $headers); // Reset content-type to avoid conflicts -- ...


-1

Add SPF record to your DNS so emails from your server IP are classified as legitimate Edit. Do the above with what you said. "Would setting up a domain specific email address and changing the site owner email to ***@thedomain.com help keep these messages from going into spam folders?" This will be fine as it will be the smtp server on your Web server ...


0

I would explore the use of scheduled events in WorPdress, known as wp-cron. Here is a example for that (not tested, just written here as proof of concept): // 1.- Register custom escheduled event on plugin activiation register_activation_hook( __FILE__, 'cyb_plugin_activation' ); function cyb_plugin_activation() { if( ! wp_next_scheduled( '...



Top 50 recent answers are included