嘿傢伙, 也許你們有一些編程WordPress插件的經驗。我有一個可能相當明顯的問題,但我在網上找不到任何東西。wordpress插件:在插件中查詢post-ID?
<?php
/*
Plugin Name: test
*/
function test($content) {
echo $post_id;
return $content;
}
add_filter('the_content', 'test');
?>
我有一個simpel插件,它應該回顯其內容中每個帖子的唯一ID。 因此,在我的每個帖子有10個職位的首頁應該有它的ID呼應。
任何想法如何實現?謝謝!
解決方案:http://stackoverflow.com/questions/10978524/get-the-post-id-in-wordpress-plugin/18947526#18947526 – ekussberg 2013-09-22 18:49:20