您可以将优先级设置为999,以确保您是否要这样做:
add_action( \'after_setup_theme\', \'_my_action_add_image_sizes\', 999 );
但如果你真的想确定订单,试着
custom action
, 这里有一个小例子:
/**
* Execute the action with do_action.
*/
function read_theme_options() {
//all the logic you want to execute before adding image sizes here
do_action( \'my_action\' );//do the action
}
/**
* Register the action, you can add the functions you want to the action
*/
add_action( \'my_action\', \'_my_action_add_image_sizes\' );
function _my_action_add_image_sizes() {
//adding images here
}