How to get a list of all the possible thumbnail sizes set within a theme
Found it here. The answer is: global $_wp_additional_image_sizes; print ‘<pre>’; print_r( $_wp_additional_image_sizes ); print ‘</pre>’;
Found it here. The answer is: global $_wp_additional_image_sizes; print ‘<pre>’; print_r( $_wp_additional_image_sizes ); print ‘</pre>’;
Thanks all! The image_send_to_editor filter was the one I was looking for… thanks @t31os for pointing it out. Here’s my functions now. add_filter( ‘post_thumbnail_html’, ‘remove_thumbnail_dimensions’, 10 ); add_filter( ‘image_send_to_editor’, ‘remove_thumbnail_dimensions’, 10 ); function remove_thumbnail_dimensions( $html ) { $html = preg_replace( ‘/(width|height)=\”\d*\”\s/’, “”, $html ); return $html; } This removes inline dimension attributes from images retrieved … Read more
Here are few things you could try to remove the responsive image support in 4.4: /** * Disable responsive image support (test!) */ // Clean the up the image from wp_get_attachment_image() add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if( isset( $attr[‘sizes’] ) ) unset( $attr[‘sizes’] ); if( isset( $attr[‘srcset’] ) ) unset( $attr[‘srcset’] ); return $attr; … Read more
You could always filter the media list using a pre_get_posts filter that first determines the page, and the capabilities of the user, and sets the author parameter when certain conditions are met.. Example add_action(‘pre_get_posts’,’users_own_attachments’); function users_own_attachments( $wp_query_obj ) { global $current_user, $pagenow; $is_attachment_request = ($wp_query_obj->get(‘post_type’)==’attachment’); if( !$is_attachment_request ) return; if( !is_a( $current_user, ‘WP_User’) ) return; … Read more
If you had for example, <img src=”https://wordpress.stackexchange.com/questions/228932/rdp_banner.jpg” id=”logoimage”> You could just do… add_action(‘init’,’checkvisitcookie’); function checkvisitcookie() { if (isset($_COOKIE[‘firsttimevisit’])) {return;} setCookie(‘firsttimevisit’,’1′,100*365*24*60*60); add_action(‘wp_footer’,’fadelogoout’); } function fadelogoout() { echo “<script> jQuery(document).ready(function() { setTimeout(function() { jQuery(‘#logoimage’).fadeOut(); }, 5000); }); </script>”; } Just to make it almost relevant to WordPress 😉