-1
A
回答
0
可以使用get_current_screen()
功能(Link to codex)來檢查,你是一個後編輯頁面上,然後讓帖子ID具有全球$post
變量。
例子:
add_action('admin_notices', 'screen_info');
function screen_info() {
$screen = get_current_screen();
if(is_admin() && $screen->id == 'post') {
global $post;
$post_id = get_the_ID();
// your code here
}
}
+0
謝謝。我發現我可以使用'add_meta_box',它按預期工作。不過謝謝!週末愉快。 –
相關問題
- 1. 收到帖子數據後觸發setinterval
- 2. 在發佈帖子後自動將帖子標題添加到帖子內容中?
- 3. 稍後發佈帖子
- 4. 添加帖子頁slug到單後發帖永久結構
- 5. 剛剛發佈帖子後添加元字段
- 6. 禁止鏈接到已發佈帖子上的發佈帖子
- 7. 更新後:發送帖子的ID添加到functions.php
- 8. 如何發送到谷歌後添加新帖子
- 9. Windows手機發布帖子帖子,帖子帖子
- 10. Java - 在發佈帖子後讀取cookie
- 11. human_time發佈帖子內的帖子
- 12. ExtJS將附加數據添加到表單的帖子中
- 13. 發佈後向CoreData數據存儲區添加數據
- 14. Django:發佈和取消發佈帖子
- 15. wordpress php添加帖子類別作爲類發佈項目
- 16. 發佈WordPress的博客帖子到Facebook
- 17. 發送帖子屬性和XML數據與發佈請求?
- 18. Jquery $ .ajax未發佈帖子
- 19. Angular2不發佈帖子
- 20. WordPress:按月發佈帖子?
- 21. Python將數據添加到帖子主體
- 22. jQuery不會在WordPress後臺運行,直到發佈帖子
- 23. WordPress:作者發佈的帖子數量
- 24. 添加到網站時,立即在Facebook上發佈帖子。 Facebook API
- 25. 發佈Wordpress帖子時,如何將照片發佈到Facebook?
- 26. 如何發佈帖子位置期望數組中的數據?
- 27. 在POST帖子中添加帖子到Facebook圖表API
- 28. 如何添加手動相關的帖子到帖子?
- 29. mvc在帖子發佈後顯示文本並將數據保存爲表格
- 30. 添加更多的數據Dropzone.js發佈
爲什麼投下來? –