4 05, 2018

WordPress Send Email in Foreign Language – Japanese

buy provigil dubai Sending emails in Japanese language was a challenge for me. Any email, which had a subject in Japanese language failed and was not being sent at all. I tried encoding the email subject, but nothing worked. I tweaked things until i found a solution. I then re-defined the wordpress core wp_mail() function to allow sending emails with Japanese language in subject. My solution is given below (see modifications from line 337 and onwards in code below): [fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][php] //wp_mail redefined, to send japanese subject line in emails. function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { // Compact the input, apply the filters, and extract them back out /** * Filter the wp_mail() arguments. * * @since 2.2.0 * * @param array $args A compacted array of wp_mail() arguments, including the "to" email, * subject, message, headers, and attachments values. */ $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); if

14 06, 2012

Disable or Disallow Comments in WordPress

Riihimäki You can disable comments in wordpress easily. The trick is to go to Settings -> Discussion -> then uncheck option "Allow people to post comments on new articles" This setting applies to all new posts that will be published from now onwards. To disable comments from posts that have been published. Posts -> select all then click "Edit" under bulk actions and click apply >> choose "do not allow" next to comments and hit update posts. If you don't want the comment form to show on any post or pages then locate all occurrences of the code below and remove it. [php] <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?> [/php] I you don't want the text "Comments off" to be displayed then look for wp-icludes/comment-template.php and open it in a notepad. Change the line [php] function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) [/php] to [php] //change $none = 'Comments Off' to $none = '' function comments_popup_link( $zero = 'No Comments', $one = '1 Comment',