admin管理员组

文章数量:1122832

I got the example straight out of the docs. brand new wp install, no plugins, no nuthin. It doesnt dump and it doesnt die().

functions.php:

function wpdocs_disable_upload_sizes( $sizes, $image_meta ) {

    var_dump($sizes);
    die('now im ded');

    return $sizes;
}   
add_filter( 'intermediate_image_sizes_advanced', 'wpdocs_disable_upload_sizes', 10, 2 );

I got the example straight out of the docs. brand new wp install, no plugins, no nuthin. It doesnt dump and it doesnt die().

functions.php:

function wpdocs_disable_upload_sizes( $sizes, $image_meta ) {

    var_dump($sizes);
    die('now im ded');

    return $sizes;
}   
add_filter( 'intermediate_image_sizes_advanced', 'wpdocs_disable_upload_sizes', 10, 2 );
Share Improve this question edited Jul 20, 2024 at 8:14 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Jul 20, 2024 at 2:48 Doug CassidyDoug Cassidy 5787 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Well, that sucked. Turns out those filters only run when you upload a media. So, if you want to see the $sizes, you need to upload something.

本文标签: imagesNeither intermediateimagesizesadvanced or intermediateimagesizes filter is firing