Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/elemento.../modules/componen.../widgets
File: component.php
<?php
[0] Fix | Delete
namespace Elementor\Modules\Components\Widgets;
[1] Fix | Delete
[2] Fix | Delete
use Elementor\Modules\AtomicWidgets\Elements\Atomic_Widget_Base;
[3] Fix | Delete
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type;
[4] Fix | Delete
use Elementor\Plugin;
[5] Fix | Delete
[6] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[7] Fix | Delete
exit; // Exit if accessed directly.
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
class Component extends Atomic_Widget_Base {
[11] Fix | Delete
[12] Fix | Delete
public static function get_element_type(): string {
[13] Fix | Delete
return 'e-component';
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
public function show_in_panel() {
[17] Fix | Delete
return false;
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
public function get_title() {
[21] Fix | Delete
$title = esc_html__( 'Component', 'elementor' );
[22] Fix | Delete
[23] Fix | Delete
if ( isset( $this->get_settings ) && null !== $this->get_settings( 'component_id' ) ) {
[24] Fix | Delete
$post_id = $this->get_settings( 'component_id' )['value'];
[25] Fix | Delete
$title = Plugin::$instance->documents->get( $post_id )->get_title();
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
return $title;
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public function get_keywords() {
[32] Fix | Delete
return [ 'component' ];
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
public function get_icon() {
[36] Fix | Delete
return 'eicon-star';
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
protected static function define_props_schema(): array {
[40] Fix | Delete
return [
[41] Fix | Delete
'component_id' => Number_Prop_Type::make(),
[42] Fix | Delete
];
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
protected function define_atomic_controls(): array {
[46] Fix | Delete
return [];
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
protected function get_settings_controls(): array {
[50] Fix | Delete
return [];
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
protected function render(): void {
[54] Fix | Delete
if ( null === $this->get_settings( 'component_id' ) ) {
[55] Fix | Delete
return;
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
$post_id = $this->get_settings( 'component_id' )['value'];
[59] Fix | Delete
$content = Plugin::$instance->frontend->get_builder_content( $post_id );
[60] Fix | Delete
$html = sprintf( '<div class="e-component">%s</div>', $content );
[61] Fix | Delete
[62] Fix | Delete
// PHPCS - should not be escaped.
[63] Fix | Delete
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[64] Fix | Delete
}
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function