我很熟悉how to set custom messages for post updates 使用post_updated_messages
行动挂钩。这个问题略有不同。
我有一个功能/动作挂钩post_updated
:
function my_custom_function($post_id) {
$response = ping_other_service_and_get_confirmation($post_id);
syslog(LOG_INFO, \'Response:\' . $response[\'body\']);
return $response[\'body\'];
}
add_action( \'post_updated\', \'my_custom_function\');
假设ping_other_service_and_get_confirmation()
函数ping其他一些web服务,让它知道帖子已经更新,并以字符串形式返回确认消息。现在,我正在将该字符串记录到系统日志中,这对于开发来说很好,但我需要在post updates消息中使用该字符串,以便客户端能够看到确认。我该怎么做?有可能吗?