Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/elemento.../includes/controls
File: url.php
<?php
[0] Fix | Delete
namespace Elementor;
[1] Fix | Delete
[2] Fix | Delete
use Elementor\Modules\DynamicTags\Module as TagsModule;
[3] Fix | Delete
[4] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[5] Fix | Delete
exit; // Exit if accessed directly.
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Elementor URL control.
[10] Fix | Delete
*
[11] Fix | Delete
* A base control for creating url control. Displays a URL input with the
[12] Fix | Delete
* ability to set the target of the link to `_blank` to open in a new tab.
[13] Fix | Delete
*
[14] Fix | Delete
* @since 1.0.0
[15] Fix | Delete
*/
[16] Fix | Delete
class Control_URL extends Control_Base_Multiple {
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Get url control type.
[20] Fix | Delete
*
[21] Fix | Delete
* Retrieve the control type, in this case `url`.
[22] Fix | Delete
*
[23] Fix | Delete
* @since 1.0.0
[24] Fix | Delete
* @access public
[25] Fix | Delete
*
[26] Fix | Delete
* @return string Control type.
[27] Fix | Delete
*/
[28] Fix | Delete
public function get_type() {
[29] Fix | Delete
return 'url';
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* Get url control default values.
[34] Fix | Delete
*
[35] Fix | Delete
* Retrieve the default value of the url control. Used to return the default
[36] Fix | Delete
* values while initializing the url control.
[37] Fix | Delete
*
[38] Fix | Delete
* @since 1.0.0
[39] Fix | Delete
* @access public
[40] Fix | Delete
*
[41] Fix | Delete
* @return array Control default value.
[42] Fix | Delete
*/
[43] Fix | Delete
public function get_default_value() {
[44] Fix | Delete
return [
[45] Fix | Delete
'url' => '',
[46] Fix | Delete
'is_external' => '',
[47] Fix | Delete
'nofollow' => '',
[48] Fix | Delete
'custom_attributes' => '',
[49] Fix | Delete
];
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
/**
[53] Fix | Delete
* Get url control default settings.
[54] Fix | Delete
*
[55] Fix | Delete
* Retrieve the default settings of the url control. Used to return the default
[56] Fix | Delete
* settings while initializing the url control.
[57] Fix | Delete
*
[58] Fix | Delete
* @since 1.0.0
[59] Fix | Delete
* @access protected
[60] Fix | Delete
*
[61] Fix | Delete
* @return array Control default settings.
[62] Fix | Delete
*/
[63] Fix | Delete
protected function get_default_settings() {
[64] Fix | Delete
return [
[65] Fix | Delete
'label_block' => true,
[66] Fix | Delete
'placeholder' => esc_html__( 'Type or paste your URL', 'elementor' ),
[67] Fix | Delete
'autocomplete' => true,
[68] Fix | Delete
'options' => [ 'is_external', 'nofollow', 'custom_attributes' ],
[69] Fix | Delete
'dynamic' => [
[70] Fix | Delete
'categories' => [ TagsModule::URL_CATEGORY ],
[71] Fix | Delete
'property' => 'url',
[72] Fix | Delete
],
[73] Fix | Delete
'custom_attributes_description' => sprintf(
[74] Fix | Delete
'%1$s <a target="_blank" href="https://go.elementor.com/panel-link-custom-attributes/">%2$s</a>',
[75] Fix | Delete
esc_html__( 'Set custom attributes for the link element. Separate attribute keys from values using the | (pipe) character. Separate key-value pairs with a comma.', 'elementor' ),
[76] Fix | Delete
esc_html__( 'Learn more', 'elementor' )
[77] Fix | Delete
),
[78] Fix | Delete
];
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
/**
[82] Fix | Delete
* Render url control output in the editor.
[83] Fix | Delete
*
[84] Fix | Delete
* Used to generate the control HTML in the editor using Underscore JS
[85] Fix | Delete
* template. The variables for the class are available using `data` JS
[86] Fix | Delete
* object.
[87] Fix | Delete
*
[88] Fix | Delete
* @since 1.0.0
[89] Fix | Delete
* @access public
[90] Fix | Delete
*/
[91] Fix | Delete
public function content_template() {
[92] Fix | Delete
?>
[93] Fix | Delete
<div class="elementor-control-field elementor-control-url-external-{{{ ( data.options.length || data.show_external ) ? 'show' : 'hide' }}}">
[94] Fix | Delete
<label for="<?php $this->print_control_uid(); ?>" class="elementor-control-title">{{{ data.label }}}</label>
[95] Fix | Delete
<div class="elementor-control-input-wrapper elementor-control-dynamic-switcher-wrapper">
[96] Fix | Delete
<i class="elementor-control-url-autocomplete-spinner eicon-loading eicon-animation-spin" aria-hidden="true"></i>
[97] Fix | Delete
<input id="<?php $this->print_control_uid(); ?>" class="elementor-control-tag-area elementor-input" data-setting="url" placeholder="{{ view.getControlPlaceholder() }}" />
[98] Fix | Delete
<?php // PHPCS - Nonces don't require escaping. ?>
[99] Fix | Delete
<input id="_ajax_linking_nonce" type="hidden" value="<?php echo wp_create_nonce( 'internal-linking' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" />
[100] Fix | Delete
<# if ( !! data.options ) { #>
[101] Fix | Delete
<button class="elementor-control-url-more tooltip-target elementor-control-unit-1" data-tooltip="<?php echo esc_attr__( 'Link Options', 'elementor' ); ?>" aria-label="<?php echo esc_attr__( 'Link Options', 'elementor' ); ?>">
[102] Fix | Delete
<i class="eicon-cog" aria-hidden="true"></i>
[103] Fix | Delete
</button>
[104] Fix | Delete
<# } #>
[105] Fix | Delete
</div>
[106] Fix | Delete
<# if ( !! data.options ) { #>
[107] Fix | Delete
<div class="elementor-control-url-more-options">
[108] Fix | Delete
<div class="elementor-control-url-option">
[109] Fix | Delete
<input id="<?php $this->print_control_uid( 'is_external' ); ?>" type="checkbox" class="elementor-control-url-option-input" data-setting="is_external">
[110] Fix | Delete
<label for="<?php $this->print_control_uid( 'is_external' ); ?>"><?php echo esc_html__( 'Open in new window', 'elementor' ); ?></label>
[111] Fix | Delete
</div>
[112] Fix | Delete
<div class="elementor-control-url-option">
[113] Fix | Delete
<input id="<?php $this->print_control_uid( 'nofollow' ); ?>" type="checkbox" class="elementor-control-url-option-input" data-setting="nofollow">
[114] Fix | Delete
<label for="<?php $this->print_control_uid( 'nofollow' ); ?>"><?php echo esc_html__( 'Add nofollow', 'elementor' ); ?></label>
[115] Fix | Delete
</div>
[116] Fix | Delete
<div class="elementor-control-url__custom-attributes elementor-control-direction-ltr">
[117] Fix | Delete
<label for="<?php $this->print_control_uid( 'custom_attributes' ); ?>" class="elementor-control-url__custom-attributes-label"><?php echo esc_html__( 'Custom Attributes', 'elementor' ); ?></label>
[118] Fix | Delete
<input type="text" id="<?php $this->print_control_uid( 'custom_attributes' ); ?>" class="elementor-control-unit-5" placeholder="key|value" data-setting="custom_attributes">
[119] Fix | Delete
</div>
[120] Fix | Delete
<# if ( ( data.options && -1 !== data.options.indexOf( 'custom_attributes' ) ) && data.custom_attributes_description ) { #>
[121] Fix | Delete
<div class="elementor-control-field-description">{{{ data.custom_attributes_description }}}</div>
[122] Fix | Delete
<# } #>
[123] Fix | Delete
</div>
[124] Fix | Delete
<# } #>
[125] Fix | Delete
</div>
[126] Fix | Delete
<# if ( data.description ) { #>
[127] Fix | Delete
<div class="elementor-control-field-description">{{{ data.description }}}</div>
[128] Fix | Delete
<# } #>
[129] Fix | Delete
<?php
[130] Fix | Delete
}
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function