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
- Get the first image from post content (eg.: hotlinked images)
- 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’
- How to get gallery images?
- 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
- Unexpected width and srcset attributes for the_post_thumbnail();
- Get password when user registers and save it sha1 into database
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- 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)
- Creating multiple hooks for theme
- 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
- Why an arugment is missing in wp_get_attachment_image_attributes?
- Menu item added in wp_nav_menu_items filter is never highlighted
- How to make a local cache of mshots images
- Can’t login unless twentyfifteen theme is active
- Injecting a custom sql query into a page/theme
- Single-level menu option? Another way?
- How to change database values on theme update
- How do I Add images uploaded in the post to a default custom field
- Pass variable to hook. Its possible?
- attachment.php code or tutorial
- Change “Thumbnail”, “Medium” and “Large” image sizes using functions.php?
- What is the “correct” way to add hooks or similar PHP behavior to a blocktheme?
- image url relative path not working in css file
- Responsive Images – crop don’t seem to work
- Inserting images in multiple posts native gallery
- Can I get the ID of an inserted / linked image?
- Add attachment for all images in post
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Dynamic menu links after header title
- Gallery thumbnails very small
- What are the hooks in WordPress theme development?
- Custom image size vs CSS sizing
- In creating a theme, how can i allow a user to change an image outside post/page content?
- Change Responsive Images Maximum Width of 1600px
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- Change image size depending on page
- How to obfuscate theme directory URLs
- Remove link on full-size images
- 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?
- Add content after get_header
- 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?
- 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
- 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
- Can’t upload images on new theme
- image sizes – finding and removing
- Adding a Class to an Getting From Post Content
- 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
- 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?