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/wp-conte.../plugins/embedpre.../EmbedPre.../Includes/Classes
File: Extend_Elementor_Controls.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace EmbedPress\Includes\Classes;
[2] Fix | Delete
[3] Fix | Delete
use \Elementor\Controls_Manager;
[4] Fix | Delete
[5] Fix | Delete
class Extend_Elementor_Controls
[6] Fix | Delete
{
[7] Fix | Delete
[8] Fix | Delete
public function __construct()
[9] Fix | Delete
{
[10] Fix | Delete
add_action('extend_elementor_controls', [$this, 'extend_elementor_share_and_lock_controls'], 10, 4);
[11] Fix | Delete
}
[12] Fix | Delete
[13] Fix | Delete
public function extend_elementor_share_and_lock_controls($that, $infix = '', $pro_text = '', $pro_class = '')
[14] Fix | Delete
{
[15] Fix | Delete
$ad_condition = [
[16] Fix | Delete
'adManager' => 'yes'
[17] Fix | Delete
];
[18] Fix | Delete
$ai_condition = [
[19] Fix | Delete
'active' => false,
[20] Fix | Delete
];
[21] Fix | Delete
[22] Fix | Delete
$that->start_controls_section(
[23] Fix | Delete
'embedpress_adManager',
[24] Fix | Delete
[
[25] Fix | Delete
'label' => esc_html__('EP Ads Settings', 'embedpress'),
[26] Fix | Delete
]
[27] Fix | Delete
);
[28] Fix | Delete
[29] Fix | Delete
$that->add_control(
[30] Fix | Delete
'adManager',
[31] Fix | Delete
[
[32] Fix | Delete
'label' => sprintf(__('Ads Settings %s', 'embedpress'), $pro_text),
[33] Fix | Delete
'type' => Controls_Manager::SWITCHER,
[34] Fix | Delete
'label_block' => false,
[35] Fix | Delete
'return_value' => 'yes',
[36] Fix | Delete
'default' => '',
[37] Fix | Delete
'classes' => $pro_class,
[38] Fix | Delete
]
[39] Fix | Delete
);
[40] Fix | Delete
[41] Fix | Delete
$that->add_control(
[42] Fix | Delete
'adSource',
[43] Fix | Delete
[
[44] Fix | Delete
'label' => __('Ad Source', 'embedpress'),
[45] Fix | Delete
'type' => \Elementor\Controls_Manager::SELECT,
[46] Fix | Delete
'options' => [
[47] Fix | Delete
'video' => __('Upload Video', 'embedpress'),
[48] Fix | Delete
'image' => __('Upload Image', 'embedpress'),
[49] Fix | Delete
'url' => __('URL', 'embedpress'),
[50] Fix | Delete
],
[51] Fix | Delete
'default' => 'video',
[52] Fix | Delete
'condition' => $ad_condition,
[53] Fix | Delete
'ai' => $ai_condition,
[54] Fix | Delete
]
[55] Fix | Delete
);
[56] Fix | Delete
[57] Fix | Delete
$that->add_control(
[58] Fix | Delete
'adFileUrl',
[59] Fix | Delete
[
[60] Fix | Delete
'label' => __('Uploaded Video', 'embedpress'),
[61] Fix | Delete
'type' => \Elementor\Controls_Manager::MEDIA,
[62] Fix | Delete
'media_types' => [
[63] Fix | Delete
'video'
[64] Fix | Delete
],
[65] Fix | Delete
'condition' => [
[66] Fix | Delete
'adManager' => 'yes',
[67] Fix | Delete
'adSource' => 'video',
[68] Fix | Delete
],
[69] Fix | Delete
'ai' => $ai_condition,
[70] Fix | Delete
]
[71] Fix | Delete
);
[72] Fix | Delete
$that->add_control(
[73] Fix | Delete
'adFileUrl1',
[74] Fix | Delete
[
[75] Fix | Delete
'label' => __('Uploaded Image', 'embedpress'),
[76] Fix | Delete
'type' => \Elementor\Controls_Manager::MEDIA,
[77] Fix | Delete
'media_types' => [
[78] Fix | Delete
'image'
[79] Fix | Delete
],
[80] Fix | Delete
'condition' => [
[81] Fix | Delete
'adManager' => 'yes',
[82] Fix | Delete
'adSource' => 'image',
[83] Fix | Delete
],
[84] Fix | Delete
'ai' => $ai_condition,
[85] Fix | Delete
]
[86] Fix | Delete
);
[87] Fix | Delete
$that->add_control(
[88] Fix | Delete
'adFileUrl2',
[89] Fix | Delete
[
[90] Fix | Delete
'type' => \Elementor\Controls_Manager::URL,
[91] Fix | Delete
'condition' => [
[92] Fix | Delete
'adManager' => 'yes',
[93] Fix | Delete
'adSource' => 'url',
[94] Fix | Delete
],
[95] Fix | Delete
'ai' => $ai_condition,
[96] Fix | Delete
]
[97] Fix | Delete
);
[98] Fix | Delete
[99] Fix | Delete
// For Ad Width TextControl
[100] Fix | Delete
$that->add_control(
[101] Fix | Delete
'adWidth',
[102] Fix | Delete
[
[103] Fix | Delete
'label' => __('Ad Width', 'embedpress'),
[104] Fix | Delete
'type' => \Elementor\Controls_Manager::TEXT,
[105] Fix | Delete
'condition' => [
[106] Fix | Delete
'adManager' => 'yes',
[107] Fix | Delete
'adSource' => 'image',
[108] Fix | Delete
],
[109] Fix | Delete
'default' => '300',
[110] Fix | Delete
'ai' => $ai_condition,
[111] Fix | Delete
]
[112] Fix | Delete
);
[113] Fix | Delete
[114] Fix | Delete
// For Ad Height TextControl
[115] Fix | Delete
$that->add_control(
[116] Fix | Delete
'adHeight',
[117] Fix | Delete
[
[118] Fix | Delete
'label' => __('Ad Height', 'embedpress'),
[119] Fix | Delete
'type' => \Elementor\Controls_Manager::TEXT,
[120] Fix | Delete
'condition' => [
[121] Fix | Delete
'adManager' => 'yes',
[122] Fix | Delete
'adSource' => 'image',
[123] Fix | Delete
],
[124] Fix | Delete
'default' => '200',
[125] Fix | Delete
'ai' => $ai_condition,
[126] Fix | Delete
]
[127] Fix | Delete
);
[128] Fix | Delete
[129] Fix | Delete
// For Ad X Position RangeControl
[130] Fix | Delete
$that->add_control(
[131] Fix | Delete
'adXPosition',
[132] Fix | Delete
[
[133] Fix | Delete
'label' => __('Ad X Position(%)', 'embedpress'),
[134] Fix | Delete
'type' => \Elementor\Controls_Manager::NUMBER,
[135] Fix | Delete
'default' => 25, // Set the default value if needed
[136] Fix | Delete
'min' => 0,
[137] Fix | Delete
'max' => 100,
[138] Fix | Delete
'condition' => [
[139] Fix | Delete
'adManager' => 'yes',
[140] Fix | Delete
'adSource' => 'image',
[141] Fix | Delete
],
[142] Fix | Delete
]
[143] Fix | Delete
);
[144] Fix | Delete
[145] Fix | Delete
// For Ad Y Position RangeControl
[146] Fix | Delete
$that->add_control(
[147] Fix | Delete
'adYPosition',
[148] Fix | Delete
[
[149] Fix | Delete
'label' => __('Ad Y Position(%)', 'embedpress'),
[150] Fix | Delete
'type' => \Elementor\Controls_Manager::NUMBER,
[151] Fix | Delete
'default' => 20, // Set the default value if needed
[152] Fix | Delete
'min' => 0,
[153] Fix | Delete
'max' => 100,
[154] Fix | Delete
'condition' => [
[155] Fix | Delete
'adManager' => 'yes',
[156] Fix | Delete
'adSource' => 'image',
[157] Fix | Delete
],
[158] Fix | Delete
]
[159] Fix | Delete
);
[160] Fix | Delete
[161] Fix | Delete
$that->add_control(
[162] Fix | Delete
'adUrl',
[163] Fix | Delete
[
[164] Fix | Delete
'label' => __('Ad URL', 'embedpress'),
[165] Fix | Delete
'type' => \Elementor\Controls_Manager::TEXT,
[166] Fix | Delete
'condition' => $ad_condition,
[167] Fix | Delete
'ai' => $ai_condition,
[168] Fix | Delete
[169] Fix | Delete
]
[170] Fix | Delete
);
[171] Fix | Delete
[172] Fix | Delete
$that->add_control(
[173] Fix | Delete
'adStart',
[174] Fix | Delete
[
[175] Fix | Delete
'label' => __('Ad Start After (sec)', 'embedpress'),
[176] Fix | Delete
'type' => \Elementor\Controls_Manager::TEXT,
[177] Fix | Delete
'condition' => $ad_condition,
[178] Fix | Delete
'default' => '5',
[179] Fix | Delete
'ai' => $ai_condition,
[180] Fix | Delete
[181] Fix | Delete
]
[182] Fix | Delete
);
[183] Fix | Delete
[184] Fix | Delete
$that->add_control(
[185] Fix | Delete
'adSkipButton',
[186] Fix | Delete
[
[187] Fix | Delete
'label' => __('Ad Skip Button', 'embedpress'),
[188] Fix | Delete
'type' => \Elementor\Controls_Manager::SWITCHER,
[189] Fix | Delete
'label_on' => __('Yes', 'embedpress'),
[190] Fix | Delete
'label_off' => __('No', 'embedpress'),
[191] Fix | Delete
'default' => 'yes',
[192] Fix | Delete
'condition' => $ad_condition
[193] Fix | Delete
]
[194] Fix | Delete
);
[195] Fix | Delete
[196] Fix | Delete
$that->add_control(
[197] Fix | Delete
'adSkipButtonAfter',
[198] Fix | Delete
[
[199] Fix | Delete
'label' => __('Skip Button After (sec)', 'embedpress'),
[200] Fix | Delete
'type' => \Elementor\Controls_Manager::TEXT,
[201] Fix | Delete
'condition' => [
[202] Fix | Delete
'adManager' => 'yes',
[203] Fix | Delete
'adSkipButton' => 'yes',
[204] Fix | Delete
],
[205] Fix | Delete
'ai' => $ai_condition,
[206] Fix | Delete
'default' => '5'
[207] Fix | Delete
]
[208] Fix | Delete
);
[209] Fix | Delete
[210] Fix | Delete
$that->end_controls_section();
[211] Fix | Delete
[212] Fix | Delete
$that->start_controls_section(
[213] Fix | Delete
'embedpress_content_protection_settings',
[214] Fix | Delete
[
[215] Fix | Delete
'label' => esc_html__('EP Content Protection', 'embedpress'),
[216] Fix | Delete
]
[217] Fix | Delete
);
[218] Fix | Delete
[219] Fix | Delete
$that->add_control(
[220] Fix | Delete
'embedpress' . $infix . 'lock_content',
[221] Fix | Delete
[
[222] Fix | Delete
'label' => sprintf(__('Enable Content Protection %s', 'embedpress'), $pro_text),
[223] Fix | Delete
'type' => Controls_Manager::SWITCHER,
[224] Fix | Delete
'label_block' => false,
[225] Fix | Delete
'return_value' => 'yes',
[226] Fix | Delete
'default' => '',
[227] Fix | Delete
'classes' => $pro_class,
[228] Fix | Delete
]
[229] Fix | Delete
);
[230] Fix | Delete
[231] Fix | Delete
$that->add_control(
[232] Fix | Delete
'embedpress' . $infix . 'lock_content_password',
[233] Fix | Delete
[
[234] Fix | Delete
'label' => __('Set Password', 'embedpress'),
[235] Fix | Delete
'type' => Controls_Manager::TEXT,
[236] Fix | Delete
'default' => '',
[237] Fix | Delete
'placeholder' => '••••••',
[238] Fix | Delete
'label_block' => false,
[239] Fix | Delete
'condition' => [
[240] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[241] Fix | Delete
]
[242] Fix | Delete
]
[243] Fix | Delete
);
[244] Fix | Delete
[245] Fix | Delete
[246] Fix | Delete
$that->add_control(
[247] Fix | Delete
'embedpress' . $infix . 'lock_content_error_message',
[248] Fix | Delete
[
[249] Fix | Delete
'label' => __('Error Message', 'embedpress'),
[250] Fix | Delete
'type' => Controls_Manager::TEXTAREA,
[251] Fix | Delete
'default' => 'Oops, that wasn\'t the right password. Try again.',
[252] Fix | Delete
'placeholder' => __('Oops, that wasn\'t the right password. Try again.', 'embedpress'),
[253] Fix | Delete
'label_block' => true,
[254] Fix | Delete
'condition' => [
[255] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[256] Fix | Delete
]
[257] Fix | Delete
]
[258] Fix | Delete
);
[259] Fix | Delete
$that->add_control(
[260] Fix | Delete
'embedpress' . $infix . 'password_placeholder',
[261] Fix | Delete
[
[262] Fix | Delete
'label' => __('Placeholder', 'embedpress'),
[263] Fix | Delete
'type' => Controls_Manager::TEXT,
[264] Fix | Delete
'default' => 'Password',
[265] Fix | Delete
'placeholder' => __('Password', 'embedpress'),
[266] Fix | Delete
'label_block' => false,
[267] Fix | Delete
'condition' => [
[268] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[269] Fix | Delete
]
[270] Fix | Delete
]
[271] Fix | Delete
);
[272] Fix | Delete
$that->add_control(
[273] Fix | Delete
'embedpress' . $infix . 'submit_button_text',
[274] Fix | Delete
[
[275] Fix | Delete
'label' => __('Button Text', 'embedpress'),
[276] Fix | Delete
'type' => Controls_Manager::TEXT,
[277] Fix | Delete
'default' => 'Unlock',
[278] Fix | Delete
'placeholder' => __('Unlock', 'embedpress'),
[279] Fix | Delete
'label_block' => false,
[280] Fix | Delete
'condition' => [
[281] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[282] Fix | Delete
]
[283] Fix | Delete
]
[284] Fix | Delete
);
[285] Fix | Delete
$that->add_control(
[286] Fix | Delete
'embedpress' . $infix . 'submit_Unlocking_text',
[287] Fix | Delete
[
[288] Fix | Delete
'label' => __('Loader Text', 'embedpress'),
[289] Fix | Delete
'type' => Controls_Manager::TEXT,
[290] Fix | Delete
'default' => 'Unlocking...',
[291] Fix | Delete
'placeholder' => __('Unlocking...', 'embedpress'),
[292] Fix | Delete
'label_block' => false,
[293] Fix | Delete
'condition' => [
[294] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[295] Fix | Delete
]
[296] Fix | Delete
]
[297] Fix | Delete
);
[298] Fix | Delete
[299] Fix | Delete
$that->add_control(
[300] Fix | Delete
'embedpress' . $infix . 'lock_content_heading',
[301] Fix | Delete
[
[302] Fix | Delete
'label' => __('Header', 'embedpress'),
[303] Fix | Delete
'type' => Controls_Manager::TEXT,
[304] Fix | Delete
'default' => 'Content Locked',
[305] Fix | Delete
'placeholder' => __('Content Locked', 'embedpress'),
[306] Fix | Delete
'label_block' => false,
[307] Fix | Delete
'condition' => [
[308] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[309] Fix | Delete
]
[310] Fix | Delete
]
[311] Fix | Delete
);
[312] Fix | Delete
[313] Fix | Delete
$that->add_control(
[314] Fix | Delete
'embedpress' . $infix . 'lock_content_sub_heading',
[315] Fix | Delete
[
[316] Fix | Delete
'label' => __('Description', 'embedpress'),
[317] Fix | Delete
'type' => Controls_Manager::TEXTAREA,
[318] Fix | Delete
'default' => 'Content is locked and requires password to access it.',
[319] Fix | Delete
'placeholder' => __('Content is locked and requires password to access it.', 'embedpress'),
[320] Fix | Delete
'label_block' => true,
[321] Fix | Delete
'condition' => [
[322] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[323] Fix | Delete
]
[324] Fix | Delete
]
[325] Fix | Delete
);
[326] Fix | Delete
[327] Fix | Delete
[328] Fix | Delete
$that->add_control(
[329] Fix | Delete
'embedpress' . $infix . 'enable_footer_message',
[330] Fix | Delete
[
[331] Fix | Delete
'label' => __('Footer Text', 'embedpress'),
[332] Fix | Delete
'type' => Controls_Manager::SWITCHER,
[333] Fix | Delete
'label_block' => false,
[334] Fix | Delete
'return_value' => 'yes',
[335] Fix | Delete
'default' => '',
[336] Fix | Delete
'condition' => [
[337] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[338] Fix | Delete
],
[339] Fix | Delete
[340] Fix | Delete
]
[341] Fix | Delete
);
[342] Fix | Delete
[343] Fix | Delete
$that->add_control(
[344] Fix | Delete
'embedpress' . $infix . 'lock_content_footer_message',
[345] Fix | Delete
[
[346] Fix | Delete
'label' => __('Footer', 'embedpress'),
[347] Fix | Delete
'type' => Controls_Manager::TEXTAREA,
[348] Fix | Delete
'default' => 'In case you don\'t have the password, kindly reach out to content owner or administrator to request access.',
[349] Fix | Delete
'placeholder' => __('In case you don\'t have the password, kindly reach out to content owner or administrator to request access.', 'embedpress'),
[350] Fix | Delete
'label_block' => true,
[351] Fix | Delete
'condition' => [
[352] Fix | Delete
'embedpress' . $infix . 'enable_footer_message' => 'yes',
[353] Fix | Delete
'embedpress' . $infix . 'lock_content' => 'yes'
[354] Fix | Delete
]
[355] Fix | Delete
]
[356] Fix | Delete
);
[357] Fix | Delete
[358] Fix | Delete
$that->end_controls_section();
[359] Fix | Delete
[360] Fix | Delete
[361] Fix | Delete
[362] Fix | Delete
[363] Fix | Delete
$that->start_controls_section(
[364] Fix | Delete
'embedpress_content_share_settings',
[365] Fix | Delete
[
[366] Fix | Delete
'label' => esc_html__('EP Social Share', 'embedpress'),
[367] Fix | Delete
]
[368] Fix | Delete
);
[369] Fix | Delete
[370] Fix | Delete
$that->add_control(
[371] Fix | Delete
'embedpress' . $infix . 'content_share',
[372] Fix | Delete
[
[373] Fix | Delete
'label' => __('Enable Social Share', 'embedpress'),
[374] Fix | Delete
'type' => Controls_Manager::SWITCHER,
[375] Fix | Delete
'label_block' => false,
[376] Fix | Delete
'return_value' => 'yes',
[377] Fix | Delete
'default' => '',
[378] Fix | Delete
]
[379] Fix | Delete
);
[380] Fix | Delete
$that->add_control(
[381] Fix | Delete
'embedpress' . $infix . 'content_share_position',
[382] Fix | Delete
[
[383] Fix | Delete
'label' => __('Position', 'embedpress'),
[384] Fix | Delete
'type' => Controls_Manager::SELECT,
[385] Fix | Delete
'default' => 'right',
[386] Fix | Delete
'options' => [
[387] Fix | Delete
'top' => __('Top', 'embedpress'),
[388] Fix | Delete
'right' => __('Right', 'embedpress'),
[389] Fix | Delete
'bottom' => __('Bottom', 'embedpress'),
[390] Fix | Delete
'left' => __('Left', 'embedpress'),
[391] Fix | Delete
],
[392] Fix | Delete
'condition' => [
[393] Fix | Delete
'embedpress' . $infix . 'content_share' => 'yes'
[394] Fix | Delete
]
[395] Fix | Delete
]
[396] Fix | Delete
);
[397] Fix | Delete
$that->add_control(
[398] Fix | Delete
'embedpress' . $infix . 'content_title',
[399] Fix | Delete
[
[400] Fix | Delete
'label' => __('Title', 'embedpress'),
[401] Fix | Delete
'type' => Controls_Manager::TEXT,
[402] Fix | Delete
'placeholder' => __('Enter share title', 'embedpress'),
[403] Fix | Delete
'condition' => [
[404] Fix | Delete
'embedpress' . $infix . 'content_share' => 'yes'
[405] Fix | Delete
]
[406] Fix | Delete
]
[407] Fix | Delete
);
[408] Fix | Delete
$that->add_control(
[409] Fix | Delete
'embedpress' . $infix . 'content_descripiton',
[410] Fix | Delete
[
[411] Fix | Delete
'label' => __('Description', 'embedpress'),
[412] Fix | Delete
'type' => Controls_Manager::TEXTAREA,
[413] Fix | Delete
'placeholder' => __('Enter share description', 'embedpress'),
[414] Fix | Delete
'condition' => [
[415] Fix | Delete
'embedpress' . $infix . 'content_share' => 'yes'
[416] Fix | Delete
]
[417] Fix | Delete
]
[418] Fix | Delete
);
[419] Fix | Delete
[420] Fix | Delete
$that->add_control(
[421] Fix | Delete
'embedpress' . $infix . 'content_share_custom_thumbnail',
[422] Fix | Delete
[
[423] Fix | Delete
'label' => esc_html__('Thumbnail', 'textdomain'),
[424] Fix | Delete
'type' => \Elementor\Controls_Manager::MEDIA,
[425] Fix | Delete
'default' => [
[426] Fix | Delete
'url' => \Elementor\Utils::get_placeholder_image_src(),
[427] Fix | Delete
],
[428] Fix | Delete
'condition' => [
[429] Fix | Delete
'embedpress' . $infix . 'content_share' => 'yes'
[430] Fix | Delete
]
[431] Fix | Delete
]
[432] Fix | Delete
);
[433] Fix | Delete
$that->end_controls_section();
[434] Fix | Delete
}
[435] Fix | Delete
}
[436] Fix | Delete
[437] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function