Last active
July 8, 2019 21:34
-
-
Save morgyface/c92773b47bb0fd5ec3107714fa876af7 to your computer and use it in GitHub Desktop.
WordPress | Function | Setting reserved image sizes on theme activation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Setting reserved image sizes on theme activation | |
| add_action( 'after_switch_theme', 'enforce_image_size_options' ); | |
| function enforce_image_size_options() { | |
| update_option( 'thumbnail_size_w', 160 ); | |
| update_option( 'thumbnail_size_h', 160 ); | |
| update_option( 'thumbnail_crop', 1 ); | |
| update_option( 'medium_size_w', 660 ); | |
| update_option( 'medium_size_h', 440 ); | |
| update_option( 'medium_crop', 1 ); | |
| update_option( 'large_size_w', 1920 ); | |
| update_option( 'large_size_h', 1920 ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment