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-portfolio.php
<?php
[0] Fix | Delete
[1] Fix | Delete
defined('ABSPATH') || exit;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Module Name: Portfolio
[5] Fix | Delete
* Description: Display portfolio custom post type
[6] Fix | Delete
*/
[7] Fix | Delete
class TB_Portfolio_Module extends Themify_Builder_Component_Module {//deprecated
[8] Fix | Delete
const SLUG='portfolio';
[9] Fix | Delete
public static function init():void {
[10] Fix | Delete
///////////////////////////////////////
[11] Fix | Delete
// Load Post Type
[12] Fix | Delete
///////////////////////////////////////
[13] Fix | Delete
include_once ABSPATH . 'wp-admin/includes/plugin.php';
[14] Fix | Delete
if (!Themify_Builder_Model::is_plugin_active('themify-portfolio-post/themify-portfolio-post.php')) {
[15] 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
[16] Fix | Delete
if (!shortcode_exists('themify_portfolio_posts')) {
[17] Fix | Delete
add_shortcode('themify_portfolio_posts', array(__CLASS__, 'do_shortcode'));
[18] Fix | Delete
}
[19] Fix | Delete
}
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
public static function is_available():bool{
[23] Fix | Delete
return Themify_Builder_Model::is_cpt_active(self::SLUG);
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
public static function get_module_name():string {
[27] Fix | Delete
add_filter( 'themify_builder_active_vars', [ __CLASS__, 'builder_active_enqueue' ] );
[28] Fix | Delete
return __('Portfolio', 'themify');
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public static function get_module_icon():string {
[32] Fix | Delete
return 'briefcase';
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
public static function get_js_css():array {
[36] Fix | Delete
return array(
[37] Fix | Delete
'css' => array('post' => 'post')
[38] Fix | Delete
);
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
public static function get_json_file():array{
[42] Fix | Delete
return ['f'=>THEMIFY_BUILDER_URI.'/json/'.self::SLUG.'.json','v'=>THEMIFY_VERSION];
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
[46] Fix | Delete
public static function builder_active_enqueue(array $vars ):array {
[47] Fix | Delete
$vars['addons'][THEMIFY_BUILDER_URI . '/js/editor/deprecated/'.self::SLUG.'.js']=THEMIFY_VERSION;
[48] Fix | Delete
return $vars;
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
public static function get_metabox() {
[52] Fix | Delete
/** Portfolio Meta Box Options */
[53] Fix | Delete
return array(
[54] Fix | Delete
// Featured Image Size
[55] Fix | Delete
Themify_Builder_Model::$featured_image_size,
[56] Fix | Delete
// Image Width
[57] Fix | Delete
Themify_Builder_Model::$image_width,
[58] Fix | Delete
// Image Height
[59] Fix | Delete
Themify_Builder_Model::$image_height,
[60] Fix | Delete
// Hide Title
[61] Fix | Delete
array(
[62] Fix | Delete
'name' => 'hide_post_title',
[63] Fix | Delete
'title' => __('Hide Post Title', 'themify'),
[64] Fix | Delete
'description' => '',
[65] Fix | Delete
'type' => 'dropdown',
[66] Fix | Delete
'meta' => array(
[67] Fix | Delete
array('value' => 'default', 'name' => '', 'selected' => true),
[68] Fix | Delete
array('value' => 'yes', 'name' => __('Yes', 'themify')),
[69] Fix | Delete
array('value' => 'no', 'name' => __('No', 'themify'))
[70] Fix | Delete
)
[71] Fix | Delete
),
[72] Fix | Delete
// Unlink Post Title
[73] Fix | Delete
array(
[74] Fix | Delete
'name' => 'unlink_post_title',
[75] Fix | Delete
'title' => __('Unlink Post Title', 'themify'),
[76] Fix | Delete
'description' => __('Unlink post title (it will display the post title without link)', 'themify'),
[77] Fix | Delete
'type' => 'dropdown',
[78] Fix | Delete
'meta' => array(
[79] Fix | Delete
array('value' => 'default', 'name' => '', 'selected' => true),
[80] Fix | Delete
array('value' => 'yes', 'name' => __('Yes', 'themify')),
[81] Fix | Delete
array('value' => 'no', 'name' => __('No', 'themify'))
[82] Fix | Delete
)
[83] Fix | Delete
),
[84] Fix | Delete
// Hide Post Date
[85] Fix | Delete
array(
[86] Fix | Delete
'name' => 'hide_post_date',
[87] Fix | Delete
'title' => __('Hide Post Date', 'themify'),
[88] Fix | Delete
'description' => '',
[89] Fix | Delete
'type' => 'dropdown',
[90] Fix | Delete
'meta' => array(
[91] Fix | Delete
array('value' => 'default', 'name' => '', 'selected' => true),
[92] Fix | Delete
array('value' => 'yes', 'name' => __('Yes', 'themify')),
[93] Fix | Delete
array('value' => 'no', 'name' => __('No', 'themify'))
[94] Fix | Delete
)
[95] Fix | Delete
),
[96] Fix | Delete
// Hide Post Meta
[97] Fix | Delete
array(
[98] Fix | Delete
'name' => 'hide_post_meta',
[99] Fix | Delete
'title' => __('Hide Post Meta', 'themify'),
[100] Fix | Delete
'description' => '',
[101] Fix | Delete
'type' => 'dropdown',
[102] Fix | Delete
'meta' => array(
[103] Fix | Delete
array('value' => 'default', 'name' => '', 'selected' => true),
[104] Fix | Delete
array('value' => 'yes', 'name' => __('Yes', 'themify')),
[105] Fix | Delete
array('value' => 'no', 'name' => __('No', 'themify'))
[106] Fix | Delete
)
[107] Fix | Delete
),
[108] Fix | Delete
// Hide Post Image
[109] Fix | Delete
array(
[110] Fix | Delete
'name' => 'hide_post_image',
[111] Fix | Delete
'title' => __('Hide Featured Image', 'themify'),
[112] Fix | Delete
'description' => '',
[113] Fix | Delete
'type' => 'dropdown',
[114] Fix | Delete
'meta' => array(
[115] Fix | Delete
array('value' => 'default', 'name' => '', 'selected' => true),
[116] Fix | Delete
array('value' => 'yes', 'name' => __('Yes', 'themify')),
[117] Fix | Delete
array('value' => 'no', 'name' => __('No', 'themify'))
[118] Fix | Delete
)
[119] Fix | Delete
),
[120] Fix | Delete
// Unlink Post Image
[121] Fix | Delete
array(
[122] Fix | Delete
'name' => 'unlink_post_image',
[123] Fix | Delete
'title' => __('Unlink Featured Image', 'themify'),
[124] Fix | Delete
'description' => __('Display the Featured Image without link', 'themify'),
[125] Fix | Delete
'type' => 'dropdown',
[126] Fix | Delete
'meta' => array(
[127] Fix | Delete
array('value' => 'default', 'name' => '', 'selected' => true),
[128] Fix | Delete
array('value' => 'yes', 'name' => __('Yes', 'themify')),
[129] Fix | Delete
array('value' => 'no', 'name' => __('No', 'themify'))
[130] Fix | Delete
)
[131] Fix | Delete
),
[132] Fix | Delete
// External Link
[133] Fix | Delete
Themify_Builder_Model::$external_link,
[134] Fix | Delete
// Lightbox Link
[135] Fix | Delete
Themify_Builder_Model::$lightbox_link
[136] Fix | Delete
);
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
public static function do_shortcode($atts) {
[140] Fix | Delete
[141] Fix | Delete
$atts = shortcode_atts(array(
[142] Fix | Delete
'id' => '',
[143] Fix | Delete
'title' => 'yes',
[144] Fix | Delete
'unlink_title' => 'no',
[145] Fix | Delete
'image' => 'yes', // no
[146] Fix | Delete
'image_w' => '',
[147] Fix | Delete
'image_h' => '',
[148] Fix | Delete
'display' => 'none', // excerpt, content
[149] Fix | Delete
'post_meta' => 'yes', // yes
[150] Fix | Delete
'post_date' => 'yes', // yes
[151] Fix | Delete
'more_link' => false, // true goes to post type archive, and admits custom link
[152] Fix | Delete
'more_text' => __('More &rarr;', 'themify'),
[153] Fix | Delete
'limit' => 4,
[154] Fix | Delete
'category' => 0, // integer category ID
[155] Fix | Delete
'order' => 'DESC', // ASC
[156] Fix | Delete
'orderby' => 'date', // title, rand
[157] Fix | Delete
'style' => '', // grid3, grid2
[158] Fix | Delete
'sorting' => 'no', // yes
[159] Fix | Delete
'page_nav' => 'no', // yes
[160] Fix | Delete
'paged' => '0', // internal use for pagination, dev: previously was 1
[161] Fix | Delete
// slider parameters
[162] Fix | Delete
'autoplay' => '',
[163] Fix | Delete
'effect' => '',
[164] Fix | Delete
'timeout' => '',
[165] Fix | Delete
'speed' => ''
[166] Fix | Delete
), $atts);
[167] Fix | Delete
[168] Fix | Delete
$module = array(
[169] Fix | Delete
'module_ID' => self::SLUG.'-' . rand(0, 10000),
[170] Fix | Delete
'mod_name' => self::SLUG,
[171] Fix | Delete
'mod_settings' => array(
[172] Fix | Delete
'mod_title_portfolio' => '',
[173] Fix | Delete
'layout_portfolio' => $atts['style'],
[174] Fix | Delete
'category_portfolio' => $atts['category'],
[175] Fix | Delete
'post_per_page_portfolio' => $atts['limit'],
[176] Fix | Delete
'offset_portfolio' => '',
[177] Fix | Delete
'order_portfolio' => $atts['order'],
[178] Fix | Delete
'orderby_portfolio' => $atts['orderby'],
[179] Fix | Delete
'display_portfolio' => $atts['display'],
[180] Fix | Delete
'hide_feat_img_portfolio' => $atts['image'] === 'yes' ? 'no' : 'yes',
[181] Fix | Delete
'image_size_portfolio' => '',
[182] Fix | Delete
'img_width_portfolio' => $atts['image_w'],
[183] Fix | Delete
'img_height_portfolio' => $atts['image_h'],
[184] Fix | Delete
'unlink_feat_img_portfolio' => 'no',
[185] Fix | Delete
'hide_post_title_portfolio' => $atts['title'] === 'yes' ? 'no' : 'yes',
[186] Fix | Delete
'unlink_post_title_portfolio' => $atts['unlink_title'],
[187] Fix | Delete
'hide_post_date_portfolio' => $atts['post_date'] === 'yes' ? 'no' : 'yes',
[188] Fix | Delete
'hide_post_meta_portfolio' => $atts['post_meta'] === 'yes' ? 'no' : 'yes',
[189] Fix | Delete
'hide_page_nav_portfolio' => $atts['page_nav'] === 'no' ? 'yes' : 'no',
[190] Fix | Delete
'animation_effect' => '',
[191] Fix | Delete
'css_portfolio' => ''
[192] Fix | Delete
)
[193] Fix | Delete
);
[194] Fix | Delete
[195] Fix | Delete
return self::retrieve_template('template-blog.php', $module, THEMIFY_BUILDER_TEMPLATES_DIR, '', false);
[196] Fix | Delete
}
[197] Fix | Delete
[198] Fix | Delete
/**
[199] Fix | Delete
* Render plain content for static content.
[200] Fix | Delete
*
[201] Fix | Delete
* @param array $module
[202] Fix | Delete
* @return string
[203] Fix | Delete
*/
[204] Fix | Delete
public static function get_static_content(array $module):string {
[205] Fix | Delete
return ''; // no static content for dynamic content
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
public static function get_translatable_text_fields( $module ) : array {
[209] Fix | Delete
return [ 'mod_title_portfolio' ];
[210] Fix | Delete
}
[211] Fix | Delete
}
[212] Fix | Delete
[213] Fix | Delete
[214] Fix | Delete
TB_Portfolio_Module::init(); //deprecated
[215] Fix | Delete
[216] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function