提供一个过滤器:
$my_item = apply_filters(
\'plugin_name_item_args\',
array(
\'post_title\' => $item->get_title(),
\'post_content\' => \'\',
\'post_status\' => \'publish\',
\'post_excerpt\' => $item->get_description(),
\'post_type\' => \'post\'
),
$item # pass the $item object to the filter
);
插件现在可以通过以下方式更改这些值:
add_filter( \'plugin_name_item_args\', \'another_plugin_filter\', 10, 2 );
function another_plugin_filter( $args, $item )
{
$args[\'post_type\'] = \'page\';
return $args
}