WordPress remove EXIF Data from specific Thumb

Assuming you are using ImageMagick (the WP standard) as your library there is a filter called image_strip_meta which controls whether the EXIF data must be preserved. Normally you would just use a boolean to do an overall setting, but you could easily make that a function like this: add_filter (‘image_strip_meta’,’wpse239481_conditional_strip’) function wpse239481_conditional_strip { if (…condition … Read more

Admin Media grid view images won’t load

Problem is now solved. Thanks to user “blobfolio” here: It sounds like you may have corrupted the image metadata. Have you tried running a plugin like https://wordpress.org/plugins/force-regenerate-thumbnails/ to regenerate the images/meta? Solution: So the solution is to force regenerate all the thumbnails. For example using the plugin mentioned above in the quote.

Is it possible to generate a page without create in the admin?

You can create pages via techniques similar to this https://clicknathan.com/web-design/automatically-create-pages-wordpress/ . That might give you the basics of the code needed to create a page dynamically. The question is ‘when’ you will do this. You will need to tie your code into some action that corresponds to the ‘when’ you want the page to be … Read more

Handling error states with admin_post

You can use set_transient with the user_id if you are relying on users being logged in, otherwise, cookie would probably be better. For logged in users, you can have the user_id get set within the name of the transient. An example here: function form_post() { $user_info = wp_get_current_user(); $user_id = $user_info->exists() && !empty($user_info->ID) ? $user_info->ID … Read more

add_meta_boxes action with refresh on save

So I managed to cobble something together with a bit of javascript… It’s hacky but somewhat elegant I think. add_action(‘admin_init’, function () { if ( current_user_can(“send_notifications”) ) { $post_types = [“post”, “go_live”]; foreach ($post_types as $post_type) { add_meta_box( ‘cabtv_notif_on_post’, ‘Notifications’, function ($post) { wp_nonce_field( ‘cabtv_notif_metabox’, ‘cabtv_notif_metabox’ ); $sent = (bool) get_post_meta( $post->ID, ‘cabtv_notifications_sent’, true ); … Read more