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.../public_h.../clone/wp-conte.../plugins/themify-.../modules
File: module-gallery.php
<?php
[0] Fix | Delete
[1] Fix | Delete
defined('ABSPATH') || exit;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Module Name: Gallery
[5] Fix | Delete
* Description: Display WP Gallery Images
[6] Fix | Delete
*/
[7] Fix | Delete
class TB_Gallery_Module extends Themify_Builder_Component_Module {
[8] Fix | Delete
[9] Fix | Delete
public static function init():void {
[10] Fix | Delete
if(themify_is_ajax()){
[11] Fix | Delete
add_action('wp_ajax_tb_gallery_lightbox_data', array(__CLASS__, 'gallery_lightbox_data'));
[12] Fix | Delete
}
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
public static function get_module_name():string {
[16] Fix | Delete
return __('Gallery', 'themify');
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
public static function get_js_css():array {
[20] Fix | Delete
return array(
[21] Fix | Delete
'css' => 1,
[22] Fix | Delete
'js' => 1
[23] Fix | Delete
);
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
public static function gallery_lightbox_data():void{
[27] Fix | Delete
check_ajax_referer('tf_nonce', 'nonce');
[28] Fix | Delete
if (!empty($_POST['bid']) && !empty($_POST['url']) && is_numeric($_POST['bid']) && Themify_Access_Role::check_access_frontend($_POST['bid'])) {
[29] Fix | Delete
$post = get_post(themify_get_attachment_id_from_url(sanitize_url($_POST['url'])));
[30] Fix | Delete
$res=array();
[31] Fix | Delete
if(!empty($post)){
[32] Fix | Delete
$res=array(
[33] Fix | Delete
'title'=>$post->post_title,
[34] Fix | Delete
'caption'=>$post->post_excerpt
[35] Fix | Delete
);
[36] Fix | Delete
}
[37] Fix | Delete
wp_send_json_success($res);
[38] Fix | Delete
}
[39] Fix | Delete
wp_die();
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Render plain content for static content.
[46] Fix | Delete
*
[47] Fix | Delete
* @param array $module
[48] Fix | Delete
* @return string
[49] Fix | Delete
*/
[50] Fix | Delete
public static function get_static_content(array $module):string {
[51] Fix | Delete
$mod_settings= $module['mod_settings']+array(
[52] Fix | Delete
'mod_title_gallery' => '',
[53] Fix | Delete
'shortcode_gallery' => ''
[54] Fix | Delete
);
[55] Fix | Delete
$text = '' !== $mod_settings['mod_title_gallery'] ? sprintf('<h3>%s</h3>', $mod_settings['mod_title_gallery']) : '';
[56] Fix | Delete
return $text.$mod_settings['shortcode_gallery'];
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
public static function get_styling_image_fields() : array {
[60] Fix | Delete
return [
[61] Fix | Delete
'background_image' => ''
[62] Fix | Delete
];
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
public static function get_translatable_text_fields( $module ) : array {
[66] Fix | Delete
return [ 'mod_title_gallery' ];
[67] Fix | Delete
}
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
TB_Gallery_Module::init();
[71] Fix | Delete
[72] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function