This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replace_vc_gitem_post_image_background($output){ | |
// Get the URL to replace in string background-image: url('https://yoursite.com/wp-content/plugins/js_composer/assets/vc/vc_gitem_image.png') !important; | |
$url = get_site_url(null, '/wp-content/plugins/js_composer/assets/vc/vc_gitem_image.png'); | |
// Full http(s) path to image | |
$new_url = 'full-uri-to-new-image.ext'; // 1024x1024 image | |
// String Replace | |
$new_output = str_replace($url, $new_url, $output); | |
// Return new string | |
return $new_output; | |
} |