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/clone/wp-conte.../plugins/themify-.../modules
File: module-highlight.php
<?php
[0] Fix | Delete
[1] Fix | Delete
defined('ABSPATH') || exit;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Module Name: Highlight
[5] Fix | Delete
* Description: Display highlight custom post type
[6] Fix | Delete
*/
[7] Fix | Delete
class TB_Highlight_Module extends Themify_Builder_Component_Module {//deprecated
[8] Fix | Delete
const SLUG='highlight';
[9] Fix | Delete
public static function init():void {
[10] Fix | Delete
add_filter('themify_metabox/fields/themify-meta-boxes', array(__CLASS__, 'cpt_meta_boxes'), 100); // requires low priority so that it loads after theme's metaboxes
[11] Fix | Delete
if (!shortcode_exists('themify_highlight_posts')) {
[12] Fix | Delete
add_shortcode('themify_highlight_posts', array(__CLASS__, 'do_shortcode'));
[13] Fix | Delete
}
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
public static function get_module_name():string {
[17] Fix | Delete
add_filter( 'themify_builder_active_vars', [ __CLASS__, 'builder_active_enqueue' ] );
[18] Fix | Delete
return __('Highlight', 'themify');
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
public static function get_module_icon():string {
[22] Fix | Delete
return 'view-list-alt';
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
public static function get_js_css():array {
[26] Fix | Delete
return array(
[27] Fix | Delete
'css' => array('post' => 'post', self::SLUG => 1)
[28] Fix | Delete
);
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public static function get_json_file():array{
[32] Fix | Delete
return ['f'=>THEMIFY_BUILDER_URI.'/json/'.self::SLUG.'.json','v'=>THEMIFY_VERSION];
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
public static function builder_active_enqueue(array $vars ):array {
[36] Fix | Delete
$vars['addons'][THEMIFY_BUILDER_URI . '/js/editor/deprecated/'.self::SLUG.'.js']=THEMIFY_VERSION;
[37] Fix | Delete
return $vars;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
public static function get_metabox() {
[41] Fix | Delete
// Highlight Meta Box Options
[42] Fix | Delete
return array(
[43] Fix | Delete
// Featured Image Size
[44] Fix | Delete
Themify_Builder_Model::$featured_image_size,
[45] Fix | Delete
// Image Width
[46] Fix | Delete
Themify_Builder_Model::$image_width,
[47] Fix | Delete
// Image Height
[48] Fix | Delete
Themify_Builder_Model::$image_height,
[49] Fix | Delete
// External Link
[50] Fix | Delete
Themify_Builder_Model::$external_link,
[51] Fix | Delete
// Lightbox Link
[52] Fix | Delete
Themify_Builder_Model::$lightbox_link
[53] Fix | Delete
);
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
public static function do_shortcode($atts) {
[57] Fix | Delete
$atts = shortcode_atts(array(
[58] Fix | Delete
'id' => '',
[59] Fix | Delete
'title' => 'yes', // no
[60] Fix | Delete
'image' => 'yes', // no
[61] Fix | Delete
'image_w' => 68,
[62] Fix | Delete
'image_h' => 68,
[63] Fix | Delete
'display' => 'content', // excerpt, none
[64] Fix | Delete
'more_link' => false, // true goes to post type archive, and admits custom link
[65] Fix | Delete
'more_text' => __('More &rarr;', 'themify'),
[66] Fix | Delete
'limit' => 6,
[67] Fix | Delete
'category' => 0, // integer category ID
[68] Fix | Delete
'order' => 'DESC', // ASC
[69] Fix | Delete
'orderby' => 'date', // title, rand
[70] Fix | Delete
'style' => 'grid3', // grid4, grid2, list-post
[71] Fix | Delete
'section_link' => false // true goes to post type archive, and admits custom link
[72] Fix | Delete
), $atts);
[73] Fix | Delete
[74] Fix | Delete
$module = array(
[75] Fix | Delete
'module_ID' => self::SLUG.'-' . rand(0, 10000),
[76] Fix | Delete
'mod_name' => self::SLUG,
[77] Fix | Delete
'mod_settings' => array(
[78] Fix | Delete
'mod_title_highlight' => '',
[79] Fix | Delete
'layout_highlight' => $atts['style'],
[80] Fix | Delete
'category_highlight' => $atts['category'],
[81] Fix | Delete
'post_per_page_highlight' => $atts['limit'],
[82] Fix | Delete
'offset_highlight' => '',
[83] Fix | Delete
'order_highlight' => $atts['order'],
[84] Fix | Delete
'orderby_highlight' => $atts['orderby'],
[85] Fix | Delete
'display_highlight' => $atts['display'],
[86] Fix | Delete
'hide_feat_img_highlight' => $atts['image'] === 'yes' ? 'no' : 'yes',
[87] Fix | Delete
'image_size_highlight' => '',
[88] Fix | Delete
'img_width_highlight' => $atts['image_w'],
[89] Fix | Delete
'img_height_highlight' => $atts['image_h'],
[90] Fix | Delete
'hide_post_title_highlight' => $atts['title'] === 'yes' ? 'no' : 'yes',
[91] Fix | Delete
'hide_post_date_highlight' => '',
[92] Fix | Delete
'hide_post_meta_highlight' => '',
[93] Fix | Delete
'hide_page_nav_highlight' => 'yes',
[94] Fix | Delete
'animation_effect' => '',
[95] Fix | Delete
'css_highlight' => ''
[96] Fix | Delete
)
[97] Fix | Delete
);
[98] Fix | Delete
[99] Fix | Delete
return self::retrieve_template('template-blog.php', $module, THEMIFY_BUILDER_TEMPLATES_DIR, '', false);
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
[103] Fix | Delete
[104] Fix | Delete
/**
[105] Fix | Delete
* Render plain content for static content.
[106] Fix | Delete
*
[107] Fix | Delete
* @param array $module
[108] Fix | Delete
* @return string
[109] Fix | Delete
*/
[110] Fix | Delete
public static function get_static_content(array $module):string {
[111] Fix | Delete
return ''; // no static content for dynamic content
[112] Fix | Delete
}
[113] Fix | Delete
[114] Fix | Delete
public static function get_translatable_text_fields( $module ) : array {
[115] Fix | Delete
return [ 'mod_title_highlight' ];
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
TB_Highlight_Module::init();
[119] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function