如何检查Idis_single()
插件中的外部循环?
当我尝试时,总是会遇到致命错误代码
add_action(\'transition_post_status\', \'pmc_update_notification\',10,3);
function pmc_update_notification($new_status, $old_status, $post) {
if ( $old_status == \'publish\' && $new_status == \'publish\' ) {
$post_id = get_the_ID($post);
if (is_single($post_id)){
$post_title = get_the_title($post);
$post_url = get_permalink($post);
$message = __(\'Post updated\',\'pmc\').":\\n";
$message .= $post_title . ": " . $post_url;
// Send notification
pmc_send($message);
}
}
}