Exemple #1
0
 /**
  * Send an alert notifying that the state of a post was changed
  * from private to published. This will only applies for posts not pages.
  *
  * @param  integer $id The identifier of the post changed.
  * @return void
  */
 public static function hook_private_to_published($id = 0)
 {
     if ($data = get_post($id)) {
         $title = $data->post_title;
         $p_type = ucwords($data->post_type);
     } else {
         $title = 'Unknown';
         $p_type = 'Publication';
     }
     // Check whether the post-type is being ignored to send notifications.
     if (!SucuriScanOption::is_ignored_event($p_type)) {
         $message = sprintf('%s (private to published); identifier: %s; name: %s', $p_type, $id, $title);
         self::report_notice_event($message);
         self::notify_event('post_publication', $message);
     }
 }