AnsPress_Email_Hooks::ap_trash_answer( integer $post_id, object $_post )
Description #
Notify admin on trashing a answer.
Parameters #
- $post_idinteger (Required) Post ID.
- $_postobject (Required) Post object.
Source #
File: addons/free/email.php
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | public static function ap_trash_answer( $post_id , $_post ) { if ( ! ap_opt( 'email_admin_trash_answer' ) ) { return ; } $args = []; $current_user = wp_get_current_user(); $admin_emails = self::get_admin_emails( 'email_admin_trash_question' ); if ( ! empty ( $admin_emails ) ) { $args [ 'users' ] = $admin_emails ; } $args [ 'tags' ] = array ( '{user}' => ap_user_display_name( get_current_user_id() ), '{question_title}' => $_post ->post_title, '{question_link}' => wp_get_shortlink( $_post ->post_parent ), ); $email = new Email( 'trash_question' , $args ); $email ->send_emails(); } |
Expand full source code Collapse full source code View on GitHub: addons/free/email.php:569
Add your comment