Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/sitepres.../inc
File: plugin-integration-nextgen.php
<?php
[0] Fix | Delete
/*
[1] Fix | Delete
* NextGen Gallery plugin integration.
[2] Fix | Delete
*
[3] Fix | Delete
* - Filters the_content
[4] Fix | Delete
* -- Adjusts gallery preview image URL from default to current language (2.0.66 <=)
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
class WPML_Plugin_Integration_Nexgen_Gallery
[8] Fix | Delete
{
[9] Fix | Delete
[10] Fix | Delete
function __construct(){
[11] Fix | Delete
if ( version_compare( NEXTGEN_GALLERY_PLUGIN_VERSION, '2.0.66', '<=' ) ) {
[12] Fix | Delete
add_filter( 'the_content', array('WPML_Plugin_Integration_Nexgen_Gallery', 'the_content_gallery_preview_images'), 1 );
[13] Fix | Delete
}
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* Filters post content and fixes gallery preview images URL.
[18] Fix | Delete
*
[19] Fix | Delete
* Adjust gallery preview image URL from default to current language.
[20] Fix | Delete
* Allows NextGen to match and replace preview images with gallery.
[21] Fix | Delete
* NextGen inserts image previews with default language URL.
[22] Fix | Delete
*
[23] Fix | Delete
* @global SitePress $sitepress
[24] Fix | Delete
* @param string $content
[25] Fix | Delete
* @return string
[26] Fix | Delete
*/
[27] Fix | Delete
public static function the_content_gallery_preview_images( $content ) {
[28] Fix | Delete
global $sitepress;
[29] Fix | Delete
if ( $sitepress->get_current_language() != $sitepress->get_default_language() ) {
[30] Fix | Delete
$default_url = preg_replace( '/(^http[s]?:\/\/)/', '',
[31] Fix | Delete
$sitepress->language_url( $sitepress->get_default_language() ) );
[32] Fix | Delete
$current_url = preg_replace( '/(^http[s]?:\/\/)/', '', home_url() );
[33] Fix | Delete
$preview_url = $default_url . 'nextgen-attach_to_post/preview';
[34] Fix | Delete
$alt_preview_url = $default_url . 'index.php/nextgen-attach_to_post/preview';
[35] Fix | Delete
if ( preg_match_all( "#<img(.*)http(s)?://({$preview_url}|{$alt_preview_url})/id--(\\d+)(.*)\\/>#mi", $content, $matches, PREG_SET_ORDER ) ) {
[36] Fix | Delete
foreach ( $matches as $match ) {
[37] Fix | Delete
$content = str_replace( $match[0], "<img{$match[1]}http{$match[2]}://{$current_url}nextgen-attach_to_post/preview/id--{$match[4]}\"{$match[5]}/>", $content );
[38] Fix | Delete
}
[39] Fix | Delete
}
[40] Fix | Delete
}
[41] Fix | Delete
return $content;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
$wpml_ngg = new WPML_Plugin_Integration_Nexgen_Gallery();
[47] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function