我在寻找相似的答案。我不完全确定事件日历是如何实现的,但是从Business Directly Plugin类似的经验来讲,你可以通过钩住你自己的方法从主题的functions.php文件中覆盖钩子。
这里是一个除了我写了覆盖钩“wpbdm_show加上市形式”:
/*
* Fix the horrible output of wpbusdirman_displaypostform() from wpbusdirman.php
*
* This is done by overriding the wpbdm_show-add-listing-form hook with my own function
*/
add_filter('wpbdm_show-add-listing-form', 'alternative_wpbusdirman_displaypostform', 10, 4);
// Ensure that the method signature is the same (same order of vars, same
function alternative_wpbusdirman_displaypostform($makeactive = 1, $wpbusdirmanerrors = '', $neworedit = 'new', $wpbdmlistingid = '')
{
// This assumes that the Business Directory Plugin is installed
if (!function_exists("wpbusdirman_displaypostform"))
{
// If the funct doesn't exist then it probably isn't installed
return '';
}
// Call the method and regex parse out the bits we don't want
$original_output = wpbusdirman_displaypostform($makeactive, $wpbusdirmanerrors, $neworedit, $wpbdmlistingid);
// Do some fixing of the output. In this example we do nothing and just return what we received.
return $original_output . " WE EDITED IT!";
}