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.../themes/Divi/includes/builder/plugin-c...
File: dk-pdf.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit; // Exit if accessed directly
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Plugin compatibility for dk-pdf
[6] Fix | Delete
* @since 3.0.96
[7] Fix | Delete
* @link https://wordpress.org/plugins/dk-pdf/
[8] Fix | Delete
*/
[9] Fix | Delete
class ET_Builder_Plugin_Compat_DK_Pdf extends ET_Builder_Plugin_Compat_Base {
[10] Fix | Delete
/**
[11] Fix | Delete
* Constructor
[12] Fix | Delete
*/
[13] Fix | Delete
function __construct() {
[14] Fix | Delete
$this->plugin_id = "dk-pdf/dk-pdf.php";
[15] Fix | Delete
$this->init_hooks();
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Hook methods to WordPress
[20] Fix | Delete
* Note: once this issue is fixed in future version, run version_compare() to limit the scope
[21] Fix | Delete
* of the hooked fix
[22] Fix | Delete
* Latest plugin version: 1.9.3
[23] Fix | Delete
* @return void
[24] Fix | Delete
*/
[25] Fix | Delete
function init_hooks() {
[26] Fix | Delete
// Bail if there's no version found
[27] Fix | Delete
if ( ! $this->get_plugin_version() ) {
[28] Fix | Delete
return;
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
// Up to: latest theme version
[32] Fix | Delete
[33] Fix | Delete
// If current page has pdf query string, it means that DK PDF re-route the request to
[34] Fix | Delete
// display the pdf version of the page
[35] Fix | Delete
if ( isset( $_GET['pdf'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification
[36] Fix | Delete
add_filter(
[37] Fix | Delete
'et_pb_load_main_elements_priority',
[38] Fix | Delete
array( $this, 'fix_load_main_elements_priority' )
[39] Fix | Delete
);
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
// Add styling to fix DK PDF button when page builder is used
[43] Fix | Delete
add_action( 'wp_enqueue_scripts', array( $this, 'fix_dkpdf_button_styling' ), 20 );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* Modify priority of et_builder_add_main_elements() hook so it'll be triggered before dk-pdf
[48] Fix | Delete
* @return int
[49] Fix | Delete
*/
[50] Fix | Delete
function fix_load_main_elements_priority( $priority ) {
[51] Fix | Delete
return 7;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Modify DK PDF button if the page uses builder
[56] Fix | Delete
* @return void
[57] Fix | Delete
*/
[58] Fix | Delete
function fix_dkpdf_button_styling() {
[59] Fix | Delete
global $post;
[60] Fix | Delete
[61] Fix | Delete
if ( isset( $post->ID ) && et_pb_is_pagebuilder_used( $post->ID ) ) {
[62] Fix | Delete
$content_width = et_get_option( 'content_width', 1080 );
[63] Fix | Delete
[64] Fix | Delete
wp_add_inline_style(
[65] Fix | Delete
'dkpdf-frontend',
[66] Fix | Delete
'.dkpdf-button-container { float: none; width: 80%; max-width: '. $content_width .'px; margin: 0 auto; }'
[67] Fix | Delete
);
[68] Fix | Delete
}
[69] Fix | Delete
}
[70] Fix | Delete
}
[71] Fix | Delete
new ET_Builder_Plugin_Compat_DK_Pdf;
[72] Fix | Delete
[73] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function