Hela koden.
https://pastebin.com/8Acup0b6
När email skickas så skickas extra "message" med i emailet.
Tror att exakta koden för message är.
Men beck-end skriver den inte ut "messsage".
Jag behöver att den skriver ut "message" back-end också. Jag ser nästan exakt samma sak back-end som i emailet förutom "message" som inte finns med back-end.
Typ så här.
https://pastebin.com/8Acup0b6
När email skickas så skickas extra "message" med i emailet.
Kod:
// Sends email notification (if feature is checked in Options)
function email_notification()
{
if ($this->get_option('email_notification') != '1')
{
return false;
}
$args = array(
'[post_title]' => $this->post['post_title'],
'[email]' => $this->post['report_post_email'],
'[name]' => $this->post['report_post_name'],
'[post_id]' => $this->post['report_post_id'],
'[date]' => date(get_option('date_format'), current_time('timestamp')),
'[time]' => date(get_option('time_format'), current_time('timestamp')),
'[ip]' => $this->get_user_ip(),
'[message]' => $this->post['report_post_msg'],
'[permalink]' => get_post_permalink($this->post['report_post_id'])
);
$subject = $this->get_option('email_subject');
$body = $this->get_option('email_body');
$email = ($this->get_option('email_address') != '') ? $this->get_option('email_address') : get_option('admin_email');
foreach ($args as $key => $value)
{
$body = str_replace($key, $value, $body);
}
return wp_mail($email, $subject, $body);
}
Tror att exakta koden för message är.
Kod:
'[message]' => $this->post['report_post_msg'],
Men beck-end skriver den inte ut "messsage".
Kod:
function column_post_title($item)
{
$new_status = ($item['post_status'] == 'publish') ? __('Unpublish', 'wp-report-post') : __('Publish', 'wp-report-post');
$actions = array(
'view' => sprintf('<a href="%s" title="%s" target="_blank">View</a>', get_post_permalink($item['post_id']), __('View post in new tab', 'wp-report-post')),
'edit' => sprintf('<a href="%s">%s</a>', get_edit_post_link($item['post_id']), __('Edit', 'wp-report-post')),
'delete' => sprintf('<a class="remodal-confirm-link" href="?page=%s&action=%s&post_id=%d" post-action="Delete" post-title="%s">%s</a>',$_REQUEST['page'], 'delete', $item['post_id'], esc_attr($item['post_title']), __('Delete', 'wp-report-post')),
'unpublish' => sprintf('<a href="#" class="report-post-unpublish-link" post-id="%d" id="unpublish-%d">%s</a>', $item['post_id'], $item['post_id'], $new_status),
'delete_rep'=> sprintf('<a class="remodal-confirm-link" href="?page=%s&action=%s&post_id=%d" post-action="%s" post-title="%s">%s</a>',$_REQUEST['page'], 'delete_rep', $item['post_id'], __('Delete Reports', 'wp-report-post'), esc_attr($item['post_title']), __('Delete Reports', 'wp-report-post')),
);
return sprintf('%1$s %2$s',
/*$1%s*/ sprintf('<a href="%s" title="%s" target="_blank">%s</a>', get_post_permalink($item['post_id']), __('View post in new tab', 'wp-report-post'), $item['post_title']),
/*$2%s*/ $this->row_actions($actions)
);
}
Jag behöver att den skriver ut "message" back-end också. Jag ser nästan exakt samma sak back-end som i emailet förutom "message" som inte finns med back-end.
Typ så här.
Kod:
function column_post_title($item)
{
$new_status = ($item['post_status'] == 'publish') ? __('Unpublish', 'wp-report-post') : __('Publish', 'wp-report-post');
$actions = array(
'view' => sprintf('<a href="%s" title="%s" target="_blank">View</a>', get_post_permalink($item['post_id']), __('View post in new tab', 'wp-report-post')),
'edit' => sprintf('<a href="%s">%s</a>', get_edit_post_link($item['post_id']), __('Edit', 'wp-report-post')),
'delete' => sprintf('<a class="remodal-confirm-link" href="?page=%s&action=%s&post_id=%d" post-action="Delete" post-title="%s">%s</a>',$_REQUEST['page'], 'delete', $item['post_id'], esc_attr($item['post_title']), __('Delete', 'wp-report-post')),
'unpublish' => sprintf('<a href="#" class="report-post-unpublish-link" post-id="%d" id="unpublish-%d">%s</a>', $item['post_id'], $item['post_id'], $new_status),
'delete_rep'=> sprintf('<a class="remodal-confirm-link" href="?page=%s&action=%s&post_id=%d" post-action="%s" post-title="%s">%s</a>',$_REQUEST['page'], 'delete_rep', $item['post_id'], __('Delete Reports', 'wp-report-post'), esc_attr($item['post_title']), __('Delete Reports', 'wp-report-post')),
);
//////////////////// HÄR ////////////////////////////
/*$2%s*/ $this->row_actions($actions)
);
}
__________________
Senast redigerad av Flach1337 2018-07-21 kl. 04:10.
Senast redigerad av Flach1337 2018-07-21 kl. 04:10.