My guess is that there are spaces at the end of the option names:
update_option('image_default_size ', 'post_size');
update_option('image_default_align ', 'right');
it should be:
update_option('image_default_size', 'post_size');
update_option('image_default_align', 'right');
Related Posts:
- WordPress Theme Preview Image
- get_template_part vs action hooks in themes
- Theme Activate Hook
- The the_post_thumbnail without srcset?
- Get the first image from post content (eg.: hotlinked images)
- after_setup_theme always runs
- Add custom classes to anchor in wp_nav_menu
- How to remove the Theme Customization Button from the dashboard and themes options page?
- How to modify an image block in Gutenberg WordPress 5?
- How can I set image sizes and still have responsive images using the srcset attribute?
- Add default Backgrounds
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- Getting instance variable in scope of ‘wp_enqueue_scripts’
- wp_get_attachment_image_attributes not working for me
- Specify image dimensions
- How to get gallery images?
- Display a different theme for not logged-in users
- What can I hook into after_setup_theme?
- add_image_size is scaling, even though crop is set to true
- Featured Image in 4.4 should be larger on mobile device
- Identifying the priority of style.css so I can make a small CSS file load last
- How to use the responsive images feature from WP 4.4 in your themes
- Confused about image sizing business in WordPress
- Unexpected width and srcset attributes for the_post_thumbnail();
- Get password when user registers and save it sha1 into database
- How do I get gallery thumbnail URL and change the default thumbnail size?
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- Responsive class to all the images in the content
- Passing variable in hooks and filter
- How wordpress handle upload images and how to use them in the code
- Replace Home with image link inside custom header menu
- Featured Image Size
- wp_enqueue_scripts not called on search page?
- How to set dimensions of the post thumbnails (featured images)
- Cannot get full thumbnail size using the_post_thumbnail
- Creating multiple hooks for theme
- wp_get_attachment_image_src() width and height boolean
- How to float an image in Gutenberg
- A mystery 300px image size
- How to add theme support?
- Should I use function_exists() and/or add_action() in theme development?
- Custom Field returning Numerical Value for Image rather than URL
- Highlight “Show all” item in wp_list_categories
- Why an arugment is missing in wp_get_attachment_image_attributes?
- How to change footer credit text in Twenty Twenty One theme with a hook?
- how to retrieve the image title for image Post Format
- Modify available templates (in dropdown)
- Difference between “comment_form_default_fields” AND “comment_form_fields”
- Why is switching between themes breaking my child theme?
- Theme logo metadata into template file
- Is There A WordPress Hook for Accessing Attachments for A Particular Page?
- WordPress creating images if uploaded image is greater than 960px on one side?
- pre_get_comments or the_content filter
- How to fix WordPress images not showing up in local hosted XAMPP server?
- Add content after get_header
- Change Image Sizes for Mobile Theme
- Stop WordPress from showing images on non post pages
- How to make excerpt image be full size instead of thumbnail?
- How to add cropped custom header image?
- Is there a way to serve different resolution images to different devices?
- How can I scale down the width of images in bulk that are embedded in posts throughout the site?
- Add image URL automatically to custom field?
- How can I remove image taxonomy pages from my theme and from Google?
- Dynamic Image Links Depending on Excerpt/’Single Post’ View
- Designing a custom archive.php inspired by the Autofocus theme
- ACF get_sub_field ALT TAG in the repeater doesn’t show
- WordPress Animation Adjustments
- theme directory fallback image outputs url and not the image
- Post Featured Image Custom Sizing?
- Image cropping isn’t working correctly when using Offload Media
- WordPress wp_get_current_user returning blank values until refresh
- Put CSS Content inside tag for WordPress
- How to add an image to a theme page template in code?
- Responsive Images with art direction
- Customizer Image-Picker Preview Not Working
- How to hook into wordpress upgrade procedure for a custom theme
- Alter theme pages on language switch
- Uncaught Reference error in Retina.js
- Can’t upload images on new theme
- Images use & location, on new wordpress theme
- image sizes – finding and removing
- Adding a Class to an Getting From Post Content
- what is do_action(); in wordpress? [duplicate]
- Create image with imagepng() (fails at header)
- TinyMCE strips content while pasting. Possibly a bug
- How do I keep images in posts below a certain size without editing the post?
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- the_post_thumbnail fetches wrong image
- Custom image size doesn’t work
- Retina ready for uploaded images which are cropped
- Add rel to all images in a post
- How can I add a single image from a gallery into the page header?
- Isotope overlapping .items because of featured images – HELP! [closed]
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- I want to resize post featured image without cropping image. How?
- Add text when displying attribute with a hook on single product page
- Convert base64 string to WordPress attachment uploads multiple images instead of a single one
- WP “optimizing” PNGs into thumbnails 5X larger than originals – FIX
- optimized PNGs 5X larger than originals