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.../wp-conte.../plugins/themify-...
File: themify-builder.php
<?php
[0] Fix | Delete
/*
[1] Fix | Delete
Plugin Name: Themify Builder
[2] Fix | Delete
Plugin URI: https://themify.me/builder
[3] Fix | Delete
Description: Build responsive layouts that work for any device using intuitive "what you see is what you get" drag & drop framework, with live edits and previews.
[4] Fix | Delete
Version: 7.6.0
[5] Fix | Delete
Author: Themify
[6] Fix | Delete
Author URI: https://themify.me
[7] Fix | Delete
Text Domain: themify
[8] Fix | Delete
Requires PHP: 7.2
[9] Fix | Delete
Domain Path: /languages
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
[13] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
[14] Fix | Delete
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* Disable the plugin if using a Themify theme: Builder is included in the theme.
[18] Fix | Delete
*
[19] Fix | Delete
* @return void
[20] Fix | Delete
*/
[21] Fix | Delete
function themify_builder_theme_check() {
[22] Fix | Delete
if ( is_file( trailingslashit( get_template_directory() ) . 'themify/themify-utils.php' ) ) {
[23] Fix | Delete
?>
[24] Fix | Delete
<div class="error">
[25] Fix | Delete
<p><?php _e( 'You are using a Themify theme. The Builder is included in the theme framework. No need to install Builder plugin.', 'themify' ); ?></p>
[26] Fix | Delete
</div>
[27] Fix | Delete
<?php
[28] Fix | Delete
deactivate_plugins( plugin_basename( __FILE__ ), true );
[29] Fix | Delete
}
[30] Fix | Delete
}
[31] Fix | Delete
if(is_admin()){
[32] Fix | Delete
add_action( 'admin_notices', 'themify_builder_theme_check' );
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
// Hook loaded
[36] Fix | Delete
add_action( 'after_setup_theme', 'themify_builder_themify_dependencies',1 );
[37] Fix | Delete
add_action( 'after_setup_theme', 'themify_builder_plugin_init', 2 );
[38] Fix | Delete
add_filter( 'plugin_row_meta', 'themify_builder_plugin_meta', 10, 2 );
[39] Fix | Delete
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'themify_builder_action_links' );
[40] Fix | Delete
[41] Fix | Delete
[42] Fix | Delete
if ( ! function_exists( 'themify_builder_activate' ) ) {
[43] Fix | Delete
/**
[44] Fix | Delete
* Plugin activation
[45] Fix | Delete
*
[46] Fix | Delete
* This runs only when Builder plugin is activated.
[47] Fix | Delete
*/
[48] Fix | Delete
function themify_builder_activate() {
[49] Fix | Delete
flush_rewrite_rules();
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
register_activation_hook( __FILE__, 'themify_builder_activate' );
[53] Fix | Delete
[54] Fix | Delete
if(!function_exists('themify_builder_plugin_meta')){
[55] Fix | Delete
function themify_builder_plugin_meta( $links, $file ) {
[56] Fix | Delete
if ( plugin_basename( __FILE__ ) === $file ) {
[57] Fix | Delete
$row_meta = array(
[58] Fix | Delete
'changelogs' => '<a href="' . esc_url( 'https://themify.me/changelogs/' ) . basename( dirname( $file ) ) .'.txt" target="_blank" aria-label="' . esc_attr__( 'Plugin Changelogs', 'themify' ) . '">' . esc_html__( 'View Changelogs', 'themify' ) . '</a>'
[59] Fix | Delete
);
[60] Fix | Delete
[61] Fix | Delete
return array_merge( $links, $row_meta );
[62] Fix | Delete
}
[63] Fix | Delete
return (array) $links;
[64] Fix | Delete
}
[65] Fix | Delete
}
[66] Fix | Delete
if(!function_exists('themify_builder_action_links')){
[67] Fix | Delete
function themify_builder_action_links( $links ) {
[68] Fix | Delete
if ( is_plugin_active( 'themify-updater/themify-updater.php' ) ) {
[69] Fix | Delete
$tlinks = array(
[70] Fix | Delete
'<a href="' . admin_url( 'index.php?page=themify-license' ) . '">'.__('Themify License', 'themify') .'</a>',
[71] Fix | Delete
);
[72] Fix | Delete
} else {
[73] Fix | Delete
$tlinks = array(
[74] Fix | Delete
'<a href="' . esc_url('https://themify.me/docs/themify-updater-documentation') . '">'. __('Themify Updater', 'themify') .'</a>',
[75] Fix | Delete
);
[76] Fix | Delete
}
[77] Fix | Delete
return array_merge( $links, $tlinks );
[78] Fix | Delete
}
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
///////////////////////////////////////////
[82] Fix | Delete
// Version Getter
[83] Fix | Delete
///////////////////////////////////////////
[84] Fix | Delete
if (!function_exists('themify_builder_get')) {
[85] Fix | Delete
[86] Fix | Delete
function themify_builder_get(string $theme_var, $builder_var = false,bool $data_only=true) {
[87] Fix | Delete
static $is=null;
[88] Fix | Delete
if($is===null){
[89] Fix | Delete
$is=\themify_is_themify_theme();
[90] Fix | Delete
}
[91] Fix | Delete
if ($is===true) {
[92] Fix | Delete
return \themify_get($theme_var,null,$data_only);
[93] Fix | Delete
}
[94] Fix | Delete
if ($builder_var === false) {
[95] Fix | Delete
return false;
[96] Fix | Delete
}
[97] Fix | Delete
global $post;
[98] Fix | Delete
$data = \Themify_Builder_Model::get_builder_settings();
[99] Fix | Delete
if (isset($data[$builder_var]) && $data[$builder_var] !== '') {
[100] Fix | Delete
return $data[$builder_var];
[101] Fix | Delete
}
[102] Fix | Delete
elseif (isset($post) && ($val = \get_post_meta($post->ID, $builder_var, true)) !== '') {
[103] Fix | Delete
return $val;
[104] Fix | Delete
}
[105] Fix | Delete
return null;
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
}
[109] Fix | Delete
if ( ! function_exists( 'themify_builder_check' ) ) {
[110] Fix | Delete
[111] Fix | Delete
function themify_builder_check(string $theme_var, $builder_var = false, bool $data_only = true ):bool {
[112] Fix | Delete
$val = \themify_builder_get( $theme_var, $builder_var, $data_only );
[113] Fix | Delete
[114] Fix | Delete
return $val !== null && $val !== '' && $val !== 'off';
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
}
[118] Fix | Delete
if(!function_exists('themify_builder_themify_dependencies')){
[119] Fix | Delete
/**
[120] Fix | Delete
* Load themify functions
[121] Fix | Delete
*/
[122] Fix | Delete
function themify_builder_themify_dependencies(){
[123] Fix | Delete
if ( class_exists( 'Themify_Builder',false ) ) return;
[124] Fix | Delete
[125] Fix | Delete
if ( ! defined( 'THEMIFY_DIR' ) ) {
[126] Fix | Delete
/**
[127] Fix | Delete
* Force regenerate the Builder CSS file after an update
[128] Fix | Delete
*/
[129] Fix | Delete
//
[130] Fix | Delete
define( 'THEMIFY_BUILDER_REGENERATE_CSS', true );
[131] Fix | Delete
$path = plugin_dir_path( __FILE__ ) ;
[132] Fix | Delete
define( 'THEMIFY_VERSION', '7.6.0' );
[133] Fix | Delete
define( 'THEMIFY_DIR', $path. 'themify' );
[134] Fix | Delete
define( 'THEMIFY_URI', plugin_dir_url( __FILE__ ) . 'themify' );
[135] Fix | Delete
require_once THEMIFY_DIR . '/themify-database.php';
[136] Fix | Delete
require_once THEMIFY_DIR . '/class-themify-get-image-size.php';
[137] Fix | Delete
require_once THEMIFY_DIR . '/img.php' ;
[138] Fix | Delete
require_once THEMIFY_DIR . '/themify-utils.php';
[139] Fix | Delete
require_once THEMIFY_DIR . '/themify-fw-filters.php';
[140] Fix | Delete
require_once THEMIFY_DIR . '/themify-hooks.php';
[141] Fix | Delete
require_once $path. 'theme-options.php';
[142] Fix | Delete
if( is_admin() ) {
[143] Fix | Delete
require_once THEMIFY_DIR . '/themify-wpajax.php';
[144] Fix | Delete
}
[145] Fix | Delete
if( ! class_exists( 'Themify_Metabox',false ) ) {
[146] Fix | Delete
require_once $path. 'themify/themify-metabox/themify-metabox.php';
[147] Fix | Delete
}
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
require_once THEMIFY_DIR . '/google-fonts/functions.php';
[151] Fix | Delete
[152] Fix | Delete
if( ! function_exists( 'themify_get_featured_image_link' ) ) {
[153] Fix | Delete
require_once THEMIFY_DIR . '/themify-template-tags.php';
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
require_once THEMIFY_DIR . '/themify-icon-picker/themify-icon-font.php';
[157] Fix | Delete
}
[158] Fix | Delete
}
[159] Fix | Delete
[160] Fix | Delete
// register additional field types used by Builder
[161] Fix | Delete
add_action( 'themify_metabox/field/page_builder', 'themify_meta_field_page_builder', 10, 1 );
[162] Fix | Delete
add_action( 'themify_metabox/field/fontawesome', 'themify_meta_field_fontawesome', 10, 1 );
[163] Fix | Delete
add_action( 'themify_metabox/field/query_category', 'themify_meta_field_query_category', 10, 1 );
[164] Fix | Delete
add_action( 'themify_metabox/field/featimgdropdown', 'themify_meta_field_featimgdropdown', 10, 1 );
[165] Fix | Delete
[166] Fix | Delete
if ( ! function_exists( 'themify_builder_plugin_init' ) ){
[167] Fix | Delete
[168] Fix | Delete
if(!function_exists('theme_compatibility')){
[169] Fix | Delete
function themify_builder_theme_compatibility(){
[170] Fix | Delete
$dir=THEMIFY_BUILDER_DIR . '/theme-compat/' . get_template() ;
[171] Fix | Delete
if ( is_file( $dir . '.css' ) ) {
[172] Fix | Delete
add_theme_support( 'themify-page-options' );
[173] Fix | Delete
}
[174] Fix | Delete
$theme_compatibility_file = $dir. '.php';
[175] Fix | Delete
if ( is_file( $theme_compatibility_file ) ) {
[176] Fix | Delete
include $theme_compatibility_file;
[177] Fix | Delete
}
[178] Fix | Delete
}
[179] Fix | Delete
}
[180] Fix | Delete
/**
[181] Fix | Delete
* Init Plugin
[182] Fix | Delete
* called after theme to avoid redeclare function error
[183] Fix | Delete
*/
[184] Fix | Delete
function themify_builder_plugin_init() {
[185] Fix | Delete
if ( class_exists('Themify_Builder',false) ) return;
[186] Fix | Delete
[187] Fix | Delete
[188] Fix | Delete
/**
[189] Fix | Delete
* Define builder constant
[190] Fix | Delete
*/
[191] Fix | Delete
$path=plugin_basename( __FILE__);
[192] Fix | Delete
define( 'THEMIFY_BUILDER_NAME', trim( dirname( $path ), '/' ) );
[193] Fix | Delete
define( 'THEMIFY_BUILDER_SLUG', trim( $path, '/' ) );
[194] Fix | Delete
[195] Fix | Delete
[196] Fix | Delete
// File Path
[197] Fix | Delete
define( 'THEMIFY_BUILDER_DIR', __DIR__ );
[198] Fix | Delete
define( 'THEMIFY_BUILDER_MODULES_DIR', THEMIFY_BUILDER_DIR . '/modules' );
[199] Fix | Delete
define( 'THEMIFY_BUILDER_TEMPLATES_DIR', THEMIFY_BUILDER_DIR . '/templates' );
[200] Fix | Delete
define( 'THEMIFY_BUILDER_CLASSES_DIR', THEMIFY_BUILDER_DIR . '/classes' );
[201] Fix | Delete
define( 'THEMIFY_BUILDER_INCLUDES_DIR', THEMIFY_BUILDER_DIR . '/includes' );
[202] Fix | Delete
[203] Fix | Delete
// URI Constant
[204] Fix | Delete
define( 'THEMIFY_BUILDER_URI', plugins_url( '' , __FILE__ ) );
[205] Fix | Delete
define('THEMIFY_BUILDER_CSS_MODULES', THEMIFY_BUILDER_URI . '/css/modules/');
[206] Fix | Delete
define('THEMIFY_BUILDER_JS_MODULES', THEMIFY_BUILDER_URI . '/js/modules/');
[207] Fix | Delete
[208] Fix | Delete
// Load Localization
[209] Fix | Delete
load_plugin_textdomain( 'themify', false, THEMIFY_BUILDER_NAME . '/languages' );
[210] Fix | Delete
// Include files
[211] Fix | Delete
require THEMIFY_BUILDER_CLASSES_DIR . '/class-themify-builder-model.php';
[212] Fix | Delete
require THEMIFY_BUILDER_CLASSES_DIR . '/class-themify-builder-layouts.php';
[213] Fix | Delete
require THEMIFY_BUILDER_CLASSES_DIR . '/class-themify-global-styles.php';
[214] Fix | Delete
require THEMIFY_BUILDER_CLASSES_DIR . '/class-themify-builder.php';
[215] Fix | Delete
require THEMIFY_BUILDER_DIR . '/plugin/classes/class-themify-builder-settings.php';
[216] Fix | Delete
require_once THEMIFY_DIR .'/class-themify-storage.php';
[217] Fix | Delete
require_once THEMIFY_DIR . '/cache/class-themify-cache.php';
[218] Fix | Delete
require_once THEMIFY_DIR . '/class-themify-enqueue.php';
[219] Fix | Delete
require_once THEMIFY_DIR . '/class-themify-access-role.php';
[220] Fix | Delete
require_once THEMIFY_DIR . '/class-themify-filesystem.php';
[221] Fix | Delete
require_once THEMIFY_DIR . '/class-themify-custom-fonts.php';
[222] Fix | Delete
require_once THEMIFY_DIR . '/class-themify-maintenance-mode.php';
[223] Fix | Delete
require_once THEMIFY_BUILDER_DIR . '/plugin/classes/class-themify-builder-page-options.php';
[224] Fix | Delete
[225] Fix | Delete
if ( Themify_Builder_Model::builder_check() ) {
[226] Fix | Delete
[227] Fix | Delete
global $ThemifyBuilder;//deprecated
[228] Fix | Delete
do_action( 'themify_builder_before_init' );
[229] Fix | Delete
$ThemifyBuilder = new Themify_Builder();//deprecated
[230] Fix | Delete
add_action( 'init', array( 'Themify_Builder','init' ), 0 );
[231] Fix | Delete
themify_builder_theme_compatibility();
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
if( is_admin() ){
[235] Fix | Delete
require_once THEMIFY_DIR . '/themify-admin.php';
[236] Fix | Delete
require_once THEMIFY_DIR . '/themify-status.php';
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
/* enables the Page Options to be edited from frontend, only for Page post-type */
[240] Fix | Delete
add_theme_support( 'frontend-page-options', [ 'page' ] );
[241] Fix | Delete
}
[242] Fix | Delete
}
[243] Fix | Delete
if ( ! function_exists('themify_builder_edit_module_panel') ) {
[244] Fix | Delete
/**
[245] Fix | Delete
* Hook edit module frontend panel
[246] Fix | Delete
* @param $mod_name
[247] Fix | Delete
* @param $mod_settings
[248] Fix | Delete
*/
[249] Fix | Delete
function themify_builder_edit_module_panel( $mod_name, $mod_settings ) {
[250] Fix | Delete
do_action( 'themify_builder_edit_module_panel', $mod_name, $mod_settings );
[251] Fix | Delete
}
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function