Remove the http protocol from images

The code you provided could cause issues with 3rd party URLs in hyperlinks not running https. You can fix this by including your home url, e.g: $content = str_replace( set_url_scheme( home_url(), ‘http’ ), set_url_scheme( home_url(), ‘relative’ ), $content); Next, you’re applying this when you’d like to display the content, which means you need to do … Read more

Limit author image size

WordPress automatically resizes uploads into different formats based on the settings on the Settings » Media page: You can set up all of your different default sizes here. Though keep in mind that plug-ins and themes can define their own custom image sizes … so I can’t guarantee perfect operability in all cases.

How to add an image for unit testing?

I’d take a look at how WordPress has constructed their attachment tests. You’ll find that tests/phpunit/tests/post/attachments.php they use this method: function _make_attachment( $upload, $parent_post_id = 0 ) { $type=””; if ( !empty($upload[‘type’]) ) { $type = $upload[‘type’]; } else { $mime = wp_check_filetype( $upload[‘file’] ); if ($mime) $type = $mime[‘type’]; } $attachment = array( ‘post_title’ … Read more

Automatically Add Caption in image

You can add programmatically caption, alt, description every time you upload image at backend. https://brutalbusiness.com/automatically-set-the-wordpress-image-title-alt-text-other-meta/ I tried myself this and worked nice as your expectation. This is for all your future upload images. Try this and let me know. /* Automatically set the image Title, Alt-Text, Caption & Description upon upload ————————————————————————————–*/ add_action( ‘add_attachment’, ‘my_set_image_meta_upon_image_upload’ … Read more

Responsive background images added inline

If you use Adaptive Images plugin for WordPress, you would just make one inline css for all viewport widths using the biggest image and then it does all the work on the server. You do nothing to your markup but in the Adaptive Images plugin settings you enter your breakpoints, so it will serve small … Read more

Ability to edit image via WYSIWYG

You maybe smoking something, but it doesn’t change the fact that you are right 😉 WP image management, (or should I say TinyMCE image management) is really sub par. ImagePro might be a good solution for you. Not only does it help replacing images in editor but also resizes them and displays a server-generated resized … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)