在帖子类型的管理部分的编辑页面上运行哪些操作
这是do_action
和do_action_ref_array
呼叫,用于edit.php
(post)屏幕,无任何插件,默认主题已激活:
muplugins_loaded - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
registered_post_type - do_action
registered_post_type - do_action
registered_post_type - do_action
registered_post_type - do_action
registered_post_type - do_action
plugins_loaded - do_action
sanitize_comment_cookies - do_action
setup_theme - do_action
unload_textdomain - do_action
load_textdomain - do_action
load_textdomain - do_action
after_setup_theme - do_action
load_textdomain - do_action
load_textdomain - do_action
auth_cookie_valid - do_action
set_current_user - do_action
init - do_action
registered_post_type - do_action
registered_post_type - do_action
registered_post_type - do_action
registered_post_type - do_action
registered_post_type - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
registered_taxonomy - do_action
widgets_init - do_action
register_sidebar - do_action
register_sidebar - do_action
register_sidebar - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_register_sidebar_widget - do_action
wp_loaded - do_action
auth_cookie_valid - do_action
auth_redirect - do_action
wp_default_scripts - do_action_ref_array
_admin_menu - do_action
admin_menu - do_action
admin_init - do_action
wp_default_styles - do_action_ref_array
admin_bar_init - do_action
add_admin_bar_menus - do_action
current_screen - do_action
load-edit.php - do_action
parse_request - do_action_ref_array
send_headers - do_action_ref_array
parse_tax_query - do_action
parse_query - do_action_ref_array
pre_get_posts - do_action_ref_array
parse_tax_query - do_action
posts_selection - do_action
wp - do_action_ref_array
admin_xml_ns - do_action
admin_xml_ns - do_action
admin_enqueue_scripts - do_action
admin_print_styles-edit.php - do_action
admin_print_styles - do_action
admin_print_scripts-edit.php - do_action
admin_print_scripts - do_action
wp_print_scripts - do_action
admin_head-edit.php - do_action
admin_head - do_action
adminmenu - do_action
in_admin_header - do_action
admin_bar_menu - do_action_ref_array
wp_before_admin_bar_render - do_action
wp_after_admin_bar_render - do_action
admin_notices - do_action
all_admin_notices - do_action
restrict_manage_posts - do_action
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
the_post - do_action_ref_array
pre_get_users - do_action
pre_user_query - do_action_ref_array
pre_get_users - do_action
pre_user_query - do_action_ref_array
in_admin_footer - do_action
admin_footer - do_action
admin_print_footer_scripts - do_action
admin_footer-edit.php - do_action
shutdown - do_action
如果我们包括过滤器,即使我们排除
gettext
过滤器,我们过去
five thousand lines!!. 我把它贴出来了
here on Github 相反;-)
我需要在页面加载时运行一个函数,在执行查询后,获取将显示在编辑页面上的所有帖子。
我不确定您需要运行什么样的函数,但希望您能找到这些列表的钩子。
例如,您可以尝试wp
胡克,那是晚些时候发射的WP_Query
查询:
感谢@TheDeadMedic提醒我瞄准edit.php
的屏幕shop_order
;-)
以下是更新的代码段:
is_admin() && add_action( \'wp\', function( \\WP $wp )
{
if( \'edit-shop_order\' === get_current_screen()->id )
{
// ... your code here
}
} );
我添加了
is_admin()
检查,因为
wp
钩子也会在前端开火。
您也可以在此处查看我的答案,了解其他方法:
How to check if I'm on a custom post type archive in the admin area