Attach pdf from dynamic url

You can try to do it in two ways. The first one, much more simple, is to save a temporary PDF file somewhere, for example in a uploads directory, use it as attachment and delete if after the call to wp_mail() function is made: function my_custom_save_post( $post_id, $post, $update ) { if( ! $update ) … Read more

How can I get list of emails of users who commented on a post?

global $wpdb, $post; $query = sprintf(“SELECT comment_author_email FROM {$wpdb->comments} JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID WHERE comment_post_ID = %d AND comment_approved = ‘1’”, $post->ID); $emails = $wpdb->get_col($query); $emails = array_unique($emails); // your e-mails print_r($emails); You can also use the built-in WP_Comment_Query (or get_comments), but it’s going to be a little slower…

Generate Email if No Posts Within Time Period

You’ll need to set up a cron job that checks once a day to see if the latest post is more than seven days old. So, some where in a plugin file. Schedule a new event. Then hook into that event. Grab the post date, turn it into a unix time stamp, and compare that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)