您可以将代码添加到init
动作挂钩和检查全局$pagenow
变量:
add_action( \'init\', \'wpse8170_check_from_var\' );
function wpse8170_check_from_var() {
global $pagenow;
if ( \'post.php\' != $pagenow || ! isset( $_GET[\'post\'] ) || ! isset( $_GET[\'from\'] ) || 1 != (int) $_GET[\'from\'] ) {
return;
}
update_post_meta( (int) $_GET[\'post\'], \'EDITED\', \'true\' );
}