Just call this function in the init
action. This action is fired for both frontend and backend. So it should look like this:
add_action( 'init', 'wpse4378_add_new_image_size' );
function wpse4378_add_new_image_size() {
add_image_size( 'wp_small', 60, 75, true ); //mobile
}
Related Posts:
- How can I add an image upload field directly to a custom write panel?
- How to catch images with blank dimensions?
- How to find attachment ID for first image in a post
- Having Problem On Getting WP Post Gallery Images URL
- Set first image (external) as featured image / thumbnail
- Hook event for upload image in the menu
- How to get an image transferred via FTP or script to appear in Media Manager?
- Add media and attach images to pages
- Is there a better way to implement responsive images than what WordPress uses by default?
- Save image as featured image
- How to show large image in checkout page using WP Ecommerce plugin [closed]
- Hook to get image filename when it is uploaded
- Resizing Images for a Gallery-Plugin?
- How to serve different thumbnails/images depending on users browser/platform
- How to Upload Images From a Folder (Not WP_Uploads)
- How to export post meta with images in wordpress
- Get attachments from a post
- Putting a resized image into media library with wp_get_image_editor(
- Display list of uploaded images, filtered by user under a specific user group
- Upload multiple images and insert them into custom html code
- Which is the better way to store images for the plugin?
- Uploaded attachment not set as featured image
- How do I change the image from the default mysteryman in the WP Profile page
- Hook after attachment added and cropped
- Conditional Generation of Image Sizes using add_image_size
- how to change image of jquery slider plugin
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- Cleaning a filename after image sideloading a url that contains `%20`
- How to list all images used on a specific page?
- Screenshots on plugin page taken old [closed]
- Resize not resizing images with Capitial extension like JPG
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- The URL of images on my website changed after being set as featured image
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- WordPress Favicon not Working For Images/Videos/PDFs
- Adding the image selector/uploader to an admin back page
- WordPress discards PNG file when uploading plugin file
- Hook for validating and rejecting frontend image upload
- WordPress Iframe for blog image
- Replace the WordPress Media Library Uploader
- Caption Shortcode: what filter to change the image size?
- Filter the_content() to add custom figure tags
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- Images not displaying on live server
- Using “add_image_size” to register custom image sizes inside plugins not working
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Displaying an Uploaded Image as a Custom Avatar in WordPress
- Add a custom image source
- Upload to a specific media folder created by FileBird Lite
- Set srcset on a block image
- How should you hook a session_start() when authoring a plugin?
- How to properly modify get_userdata in plugin to get roles to update in database
- Create a plugin to change the action to which a function is hooked
- Why is the reset password key missing in the reset password email?
- Why do I need to check if wp_nonce_field() exists before using it
- How to associate an existing user to a site in a multisite setup programmatically
- How can I get a list of CPT inside a plugin file?
- Serve text/html from wp-json API via WPEngine, headers not being set properly
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Add a new confirmation page before saving
- Plugin is not generating title tags on any pages or posts
- Plugin Development/ Stop CSS clashes.
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Create page (not the post type) dynamically
- Translate javascript with WordPress built-in localization API for static strings
- Updating transient value frequently
- How to add a route?
- using admin functions on frontend
- Auto hyper link text matching slugs/pages
- Action / Hook when a new plugin is added
- Change cannonical URL after changing url with add_rewrite_rule()
- Performing ajax request in wordpress
- How to create save function for custom Gutenberg style block?
- Ajax calling in a function goes into abspath loop
- How to enable or disable check boxes in custom post type
- How to destroy or dispose wordpress uploder/manager?
- Plugin admin list pages as submenu
- Call do_action() within WordPress cronjob
- Why isn’t my readme.txt file being read
- How to update WordPress Plugins in your own maintance application?
- register_setting registered with incorrect data type
- Custom Nav Walker $item->url producing malformed hyperlinks
- Extend Plugin that creates an endpoint for GET request to also accepts POST requests
- Personalized URL for non-logged in WordPress
- WordPress Breadcrumb Taxonomy Display
- Adding custom avatar field to comments
- i want to auto create pages with shortcode when plugin is activated and delete when deactivated
- WordPress plugin options page not saving options, no errors
- WordPress database error: [Table ‘bitnami_wordpress.questions’ doesn’t exist]
- How to manage different tier plugin subscriptions to users
- Plugin submission denied for “Calling file locations poorly” when using WP_PLUGIN_DIR constant
- Do plugin auto-updates also run for a lower version?
- wordpress wp_editor() does not support tag
- Insert meta-description into Yoast-SEO input-field via JavaScript
- Loading all PHP files all the time or only when they needed in Custom Plugin Development [closed]
- Showing Home option in dropdown when there is no Home page exist
- REST API error in block editor for custom templates
- Execute callback after REST API request completes + Response is sent
- High-Performance Order Storage conflict action `manage_shop_order_posts_custom_column`