2016-08-04 109 views

回答

1

您正在查找的動作掛鉤是the_post。這個鉤子在創建post對象後觸發。

簡單的例子:

<?php 
function some_post_action($post_object) { 
    // your function here, use $post_object->ID to access post id 
} 
add_action('the_post', 'some_post_action'); 
?>