add_filter('tiny_mce_before_init', 'lae_tinymce_settings');
function lae_filtre_boutons( $buttons ) {
$remove_buttons = array(
'strikethrough', 'hr', 'alignleft', 'aligncenter', 'alignright', 'spellchecker',
'underline', 'alignjustify', 'forecolor', 'outdent', 'indent', 'wp_help'
);
foreach ( $buttons as $button_key => $button_value ) {
if ( in_array( $button_value, $remove_buttons ) ) {
unset( $buttons[ $button_key ] );
}
}
return $buttons;
}
add_filter( 'mce_buttons', 'lae_filtre_boutons');
add_filter( 'mce_buttons_2', 'lae_filtre_boutons');
add_action('elementor/query/typeRealisation', function ($query) {
$path = $_SERVER['REQUEST_URI'];
if (ends_with($path, '/')) {
$path = substr($path, 0, -1);
}
$path = explode('/', $path);
if (sizeof($path) > 0) {
$query->set('tax_query', [
[
'taxonomy' => 'type_realisation',
'field' => 'slug',
'terms' => last($path)
]
]);
}
});
Arguments
"Call to undefined function ends_with()"
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 === $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
*/
public function do_action( $args ) {
Arguments
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
*/
public function do_action( $args ) {
$this->doing_action = true;
$this->apply_filters( '', $args );
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
if ( ! $this->nesting_level ) {
$this->doing_action = false;
}
}
/**
* Processes the functions hooked into the 'all' hook.
*
* @since 4.7.0
*
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
*/
public function do_all_hook( &$args ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = $this->priorities;
do {
$priority = current( $this->iterations[ $nesting_level ] );
Arguments
""
array:2 [
0 => WP_Query {#8035}
1 => ElementorPro\Modules\Posts\Widgets\Posts {#8012}
]
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
if ( empty( $arg ) ) {
$arg[] = '';
} elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
// Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
$arg[0] = $arg[0][0];
}
$wp_filter[ $hook_name ]->do_action( $arg );
array_pop( $wp_current_filter );
}
/**
* Calls the callback functions that have been added to an action hook, specifying arguments in an array.
*
* @since 2.1.0
*
* @see do_action() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_actions Stores the number of times each action was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the action to be executed.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
*/
function do_action_ref_array( $hook_name, $args ) {
Arguments
array:2 [
0 => WP_Query {#8035}
1 => ElementorPro\Modules\Posts\Widgets\Posts {#8012}
]
*/
public function pre_get_posts_query_filter( $wp_query ) {
if ( $this->widget ) {
$query_id = $this->get_widget_settings( 'query_id' );
$widget_name = $this->widget->get_name();
/**
* Elementor Pro query arguments.
*
* Fires before the actual query is run. This hook allows developers to
* alter individual queries by id.
*
* The dynamic portions of the hook name, `$widget_name` & `$query_id`,
* refers to the widget name and query id respectively.
*
* @since 2.1.0
*
* @param \WP_Query $wp_query An instance of WordPress query.
* @param Widget_Base $widget An instance of Elementor widget
*/
do_action( "elementor/query/{$query_id}", $wp_query, $this->widget );
}
}
/**
* @param \WP_Query $query
*/
public function fix_query_offset( &$query ) {
$offset = $this->get_widget_settings( 'offset' );
if ( $offset && $query->is_paged ) {
$query->query_vars['offset'] = $offset + ( ( $query->query_vars['paged'] - 1 ) * $query->query_vars['posts_per_page'] );
} else {
$query->query_vars['offset'] = $offset;
}
}
/**
* @param int $found_posts
* @param \WP_Query $query
*
Arguments
"elementor/query/typeRealisation"
WP_Query {#8035}
ElementorPro\Modules\Posts\Widgets\Posts {#8012}
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 === $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
Arguments
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
*/
public function do_action( $args ) {
$this->doing_action = true;
$this->apply_filters( '', $args );
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
if ( ! $this->nesting_level ) {
$this->doing_action = false;
}
}
/**
* Processes the functions hooked into the 'all' hook.
*
* @since 4.7.0
*
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
*/
public function do_all_hook( &$args ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = $this->priorities;
do {
$priority = current( $this->iterations[ $nesting_level ] );
Arguments
null
array:1 [
0 => WP_Query {#8035}
]
// Do 'all' actions first.
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
$wp_filter[ $hook_name ]->do_action( $args );
array_pop( $wp_current_filter );
}
/**
* Checks if any action has been registered for a hook.
*
* When using the `$callback` argument, this function may return a non-boolean value
* that evaluates to false (e.g. 0), so use the `===` operator for testing the return value.
*
* @since 2.5.0
* @since 6.9.0 Added the `$priority` parameter.
*
* @see has_filter() This function is an alias of has_filter().
*
* @param string $hook_name The name of the action hook.
* @param callable|string|array|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
* a callback that may or may not exist. Default false.
* @param int|false $priority Optional. The specific priority at which to check for the callback.
Arguments
array:1 [
0 => WP_Query {#8035}
]
*
* @return WP_Post[]|int[] Array of post objects or post IDs.
*/
public function get_posts() {
global $wpdb;
$this->parse_query();
/**
* Fires after the query variable object is created, but before the actual query is run.
*
* Note: If using conditional tags, use the method versions within the passed instance
* (e.g. $this->is_main_query() instead of is_main_query()). This is because the functions
* like is_main_query() test against the global $wp_query instance, not the passed one.
*
* @since 2.0.0
*
* @param WP_Query $query The WP_Query instance (passed by reference).
*/
do_action_ref_array( 'pre_get_posts', array( &$this ) );
// Locally scoped reference for easy of use.
$query_vars = &$this->query_vars;
// Fill again in case 'pre_get_posts' unset some vars.
$query_vars = $this->fill_query_vars( $query_vars );
/**
* Filters whether an attachment query should include filenames or not.
*
* @since 6.0.3
*
* @param bool $allow_query_attachment_by_filename Whether or not to include filenames.
*/
$this->allow_query_attachment_by_filename = apply_filters( 'wp_allow_query_attachment_by_filename', false );
remove_all_filters( 'wp_allow_query_attachment_by_filename' );
// Parse meta query.
$this->meta_query = new WP_Meta_Query();
$this->meta_query->parse_query_vars( $query_vars );
Arguments
"pre_get_posts"
array:1 [
0 => WP_Query {#8035}
]
if ( $this->comment_count > 0 ) {
$this->comment = $this->comments[0];
}
}
/**
* Sets up the WordPress query by parsing query string.
*
* @since 1.5.0
*
* @see WP_Query::parse_query() for all available arguments.
*
* @param string|array $query URL query string or array of query arguments.
* @return WP_Post[]|int[] Array of post objects or post IDs.
*/
public function query( $query ) {
$this->init();
$this->query = wp_parse_args( $query );
$this->query_vars = $this->query;
return $this->get_posts();
}
/**
* Retrieves the currently queried object.
*
* If queried object is not set, then the queried object will be set from
* the category, tag, taxonomy, posts page, single post, page, or author
* query variable. After it is set up, it will be returned.
*
* @since 1.5.0
*
* @return WP_Term|WP_Post_Type|WP_Post|WP_User|null The queried object.
*/
public function get_queried_object() {
if ( isset( $this->queried_object ) ) {
return $this->queried_object;
}
$this->queried_object = null;
$this->queried_object_id = null;
return $this->queried_object_id;
}
return 0;
}
/**
* Constructor.
*
* Sets up the WordPress query, if parameter is not empty.
*
* @since 1.5.0
*
* @see WP_Query::parse_query() for all available arguments.
*
* @param string|array $query URL query string or array of vars.
*/
public function __construct( $query = '' ) {
if ( ! empty( $query ) ) {
$this->query( $query );
}
}
/**
* Makes private properties readable for backward compatibility.
*
* @since 4.0.0
*
* @param string $name Property to get.
* @return mixed Property.
*/
public function __get( $name ) {
if ( in_array( $name, $this->compat_fields, true ) ) {
return $this->$name;
}
}
/**
* Makes private properties checkable for backward compatibility.
*
Arguments
array:9 [
"posts_per_page" => 10000
"paged" => 1
"has_custom_pagination" => false
"post_status" => "publish"
"post_type" => "page"
"orderby" => "menu_order"
"order" => "asc"
"ignore_sticky_posts" => false
"date_query" => []
]
$this->get_query_args();
$offset_control = $this->get_widget_settings( 'offset' );
$query_id = $this->get_widget_settings( 'query_id' );
if ( ! empty( $query_id ) ) {
add_action( 'pre_get_posts', [ $this, 'pre_get_posts_query_filter' ] );
}
$post_type = $this->get_widget_settings( 'post_type' );
if ( 'by_id' !== $post_type && 0 < $offset_control ) {
/**
* @see https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
*/
add_action( 'pre_get_posts', [ $this, 'fix_query_offset' ], 1 );
add_filter( 'found_posts', [ $this, 'fix_query_found_posts' ], 1, 2 );
}
$query = new \WP_Query( $this->query_args );// SQL_CALC_FOUND_ROWS is used.
remove_action( 'pre_get_posts', [ $this, 'pre_get_posts_query_filter' ] );
remove_action( 'pre_get_posts', [ $this, 'fix_query_offset' ], 1 );
remove_filter( 'found_posts', [ $this, 'fix_query_found_posts' ], 1 );
Module::add_to_avoid_list( wp_list_pluck( $query->posts, 'ID' ) );
/**
* Elementor Pro query results.
*
* Fires before the actual query is run. This hook allows developers
* to alter individual query results.
*
* @param \WP_Query $query An instance of WordPress query.
* @param Widget_Base $widget An instance of Elementor widget.
*/
do_action( 'elementor/query/query_results', $query, $this->widget );
return $query;
}
Arguments
array:9 [
"posts_per_page" => 10000
"paged" => 1
"has_custom_pagination" => false
"post_status" => "publish"
"post_type" => "page"
"orderby" => "menu_order"
"order" => "asc"
"ignore_sticky_posts" => false
"date_query" => []
]
return $posts_query->get_query_args( $control_id, $settings );
}
/**
* @param \Elementor\Widget_Base $widget
* @param string $name
* @param array $query_args
* @param array $fallback_args
*
* @return \WP_Query
*/
public function get_query( $widget, $name, $query_args = [], $fallback_args = [] ) {
$prefix = $name . '_';
$post_type = $widget->get_settings( $prefix . 'post_type' );
if ( 'related' === $post_type ) {
$elementor_query = new Elementor_Related_Query( $widget, $name, $query_args, $fallback_args );
} else {
$elementor_query = new Elementor_Post_Query( $widget, $name, $query_args );
}
return $elementor_query->get_query();
}
/**
* @param Ajax $ajax_manager
*/
public function register_ajax_actions( $ajax_manager ) {
$ajax_manager->register_ajax_action( 'query_control_value_titles', [ $this, 'ajax_posts_control_value_titles' ] );
$ajax_manager->register_ajax_action( 'pro_panel_posts_control_filter_autocomplete', [ $this, 'ajax_posts_filter_autocomplete' ] );
/**
* @deprecated 2.6.0 use new `autocomplete` format
*/
$ajax_manager->register_ajax_action( 'query_control_value_titles_deprecated', [ $this, 'ajax_posts_control_value_titles_deprecated' ] );
$ajax_manager->register_ajax_action( 'pro_panel_posts_control_filter_autocomplete_deprecated', [ $this, 'ajax_posts_filter_autocomplete_deprecated' ] );
}
/**
* @deprecated 3.1.0
*/
public function localize_settings() {
Plugin::elementor()->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0' );
* Returns the query control name used in the widget's main query.
*
* @since 3.8.0
*
* @return string
*/
public function get_query_name() {
return $this->get_name();
}
public function query_posts() {
$query_args = [
'posts_per_page' => $this->get_posts_per_page_value(),
'paged' => $this->get_current_page(),
'has_custom_pagination' => $this->is_allow_to_use_custom_page_option(),
];
/** @var Module_Query $elementor_query */
$elementor_query = Module_Query::instance();
$this->query = $elementor_query->get_query( $this, $this->get_query_name(), $query_args, [] );
}
/**
* Get Posts Per Page Value
*
* Returns the value of the Posts Per Page control of the widget. This method was created because in some cases,
* the control is registered in the widget, and in some cases, it is registered in a widget skin.
*
* @since 3.8.0
* @access protected
*
* @return mixed
*/
protected function get_posts_per_page_value() {
return $this->get_current_skin()->get_instance_value( 'posts_per_page' );
}
protected function register_query_section_controls() {
$this->start_controls_section(
'section_query',
Arguments
ElementorPro\Modules\Posts\Widgets\Posts {#8012}
"posts"
array:3 [
"posts_per_page" => 10000
"paged" => 1
"has_custom_pagination" => false
]
[]
$this->settings = $this->parent->get_settings();
do_action( 'ECS_after_slider_elements', $this );
}
private function nothing_found(){
$this->render_loop_header();
$should_escape = apply_filters( 'elementor_pro/theme_builder/archive/escape_nothing_found_message', true );
$message = $this->parent->get_settings_for_display( 'nothing_found_message' );
if ( $should_escape ) {
$message = esc_html( $message );
}
$message = '<div class="elementor-posts-nothing-found">' . $message . '</div>';
do_action( 'ECS_not_found', $this );
echo $message;
$this->render_loop_footer();
}
public function render() {
$this->parent->query_posts();
/** @var \WP_Query $query */
$query = $this->parent->get_query();
do_action("ECS_before_loop_query",$query,$this);
// start de incercat de bagat in action ECS_before_loop_query
if (class_exists('ECS_Conditions_Manager'))
if($this->get_instance_value( 'is_display_conditions' )) $this->conditions = new \ECS_Conditions_Manager();
// end de bagat
if ( ! $query->found_posts ) {
$this->nothing_found();
return;
}
$this->render_loop_header();
/**
* Render element in static mode.
*
* If not inherent will call the base render.
*/
public function render_static() {
$this->render();
}
/**
* Determine the render logic.
*/
public function render_by_mode() {
if ( Plugin::$instance->frontend->is_static_render_mode() ) {
$this->render_static();
return;
}
$this->render();
}
/**
* Register skin controls actions.
*
* Run on init and used to register new skins to be injected to the widget.
* This method is used to register new actions that specify the location of
* the skin in the widget.
*
* Example usage:
* `add_action( 'elementor/element/{widget_id}/{section_id}/before_section_end', [ $this, 'register_controls' ] );`
*
* @since 1.0.0
* @access protected
*/
protected function _register_controls_actions() {}
/**
* Get skin control ID.
*
* @access public
*/
public function render_content() {
/**
* Before widget render content.
*
* Fires before Elementor widget is being rendered.
*
* @since 1.0.0
*
* @param Widget_Base $this The current widget.
*/
do_action( 'elementor/widget/before_render_content', $this );
ob_start();
$skin = $this->get_current_skin();
if ( $skin ) {
$skin->set_parent( $this );
$skin->render_by_mode();
} else {
$this->render_by_mode();
}
$widget_content = ob_get_clean();
if ( empty( $widget_content ) ) {
return;
}
?>
<div class="elementor-widget-container">
<?php
if ( $this->is_widget_first_render( $this->get_group_name() ) ) {
$this->register_runtime_widget( $this->get_group_name() );
}
$this->print_widget_css();
// get_name
ob_start();
$this->render_content();
$data['htmlCache'] = ob_get_clean();
}
return $data;
}
/**
* Print widget content.
*
* Output the widget final HTML on the frontend.
*
* @since 1.0.0
* @access protected
*/
protected function print_content() {
$this->render_content();
}
/**
* Print a setting content without escaping.
*
* Script tags are allowed on frontend according to the WP theme securing policy.
*
* @param string $setting
* @param null $repeater_name
* @param null $index
*/
final public function print_unescaped_setting( $setting, $repeater_name = null, $index = null ) {
if ( $repeater_name ) {
$repeater = $this->get_settings_for_display( $repeater_name );
$output = $repeater[ $index ][ $setting ];
} else {
$output = $this->get_settings_for_display( $setting );
}
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
* Before frontend element render.
*
* Fires before Elementor element is rendered in the frontend.
*
* The dynamic portion of the hook name, `$element_type`, refers to the element type.
*
* @since 1.0.0
*
* @param Element_Base $this The element.
*/
do_action( "elementor/frontend/{$element_type}/before_render", $this );
ob_start();
if ( $this->has_own_method( '_print_content', self::class ) ) {
Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( '_print_content', '3.1.0', __CLASS__ . '::print_content()' );
$this->_print_content();
} else {
$this->print_content();
}
$content = ob_get_clean();
$should_render = ( ! empty( $content ) || $this->should_print_empty() );
/**
* Should the element be rendered for frontend
*
* Filters if the element should be rendered on frontend.
*
* @since 2.3.3
*
* @param bool true The element.
* @param Element_Base $this The element.
*/
$should_render = apply_filters( "elementor/frontend/{$element_type}/should_render", $should_render, $this );
if ( $should_render ) {
if ( $this->has_own_method( '_add_render_attributes', self::class ) ) {
* @access protected
* @deprecated 3.1.0 Use `print_content()` method instead.
*/
protected function _print_content() {
Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', 'print_content()' );
$this->print_content();
}
/**
* Print element content.
*
* Output the element final HTML on the frontend.
*
* @since 3.1.0
* @access protected
*/
protected function print_content() {
foreach ( $this->get_children() as $child ) {
$child->print_element();
}
}
/**
* Get initial config.
*
* Retrieve the current element initial configuration.
*
* Adds more configuration on top of the controls list and the tabs assigned
* to the control. This method also adds element name, type, icon and more.
*
* @since 2.9.0
* @access protected
*
* @return array The initial config.
*/
protected function get_initial_config() {
$config = [
'name' => $this->get_name(),
'elType' => $this->get_type(),
* Before frontend element render.
*
* Fires before Elementor element is rendered in the frontend.
*
* The dynamic portion of the hook name, `$element_type`, refers to the element type.
*
* @since 1.0.0
*
* @param Element_Base $this The element.
*/
do_action( "elementor/frontend/{$element_type}/before_render", $this );
ob_start();
if ( $this->has_own_method( '_print_content', self::class ) ) {
Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( '_print_content', '3.1.0', __CLASS__ . '::print_content()' );
$this->_print_content();
} else {
$this->print_content();
}
$content = ob_get_clean();
$should_render = ( ! empty( $content ) || $this->should_print_empty() );
/**
* Should the element be rendered for frontend
*
* Filters if the element should be rendered on frontend.
*
* @since 2.3.3
*
* @param bool true The element.
* @param Element_Base $this The element.
*/
$should_render = apply_filters( "elementor/frontend/{$element_type}/should_render", $should_render, $this );
if ( $should_render ) {
if ( $this->has_own_method( '_add_render_attributes', self::class ) ) {
* @access protected
* @deprecated 3.1.0 Use `print_content()` method instead.
*/
protected function _print_content() {
Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0', 'print_content()' );
$this->print_content();
}
/**
* Print element content.
*
* Output the element final HTML on the frontend.
*
* @since 3.1.0
* @access protected
*/
protected function print_content() {
foreach ( $this->get_children() as $child ) {
$child->print_element();
}
}
/**
* Get initial config.
*
* Retrieve the current element initial configuration.
*
* Adds more configuration on top of the controls list and the tabs assigned
* to the control. This method also adds element name, type, icon and more.
*
* @since 2.9.0
* @access protected
*
* @return array The initial config.
*/
protected function get_initial_config() {
$config = [
'name' => $this->get_name(),
'elType' => $this->get_type(),
* Before frontend element render.
*
* Fires before Elementor element is rendered in the frontend.
*
* The dynamic portion of the hook name, `$element_type`, refers to the element type.
*
* @since 1.0.0
*
* @param Element_Base $this The element.
*/
do_action( "elementor/frontend/{$element_type}/before_render", $this );
ob_start();
if ( $this->has_own_method( '_print_content', self::class ) ) {
Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( '_print_content', '3.1.0', __CLASS__ . '::print_content()' );
$this->_print_content();
} else {
$this->print_content();
}
$content = ob_get_clean();
$should_render = ( ! empty( $content ) || $this->should_print_empty() );
/**
* Should the element be rendered for frontend
*
* Filters if the element should be rendered on frontend.
*
* @since 2.3.3
*
* @param bool true The element.
* @param Element_Base $this The element.
*/
$should_render = apply_filters( "elementor/frontend/{$element_type}/should_render", $should_render, $this );
if ( $should_render ) {
if ( $this->has_own_method( '_add_render_attributes', self::class ) ) {
/**
* @since 2.1.3
* @access protected
*/
protected function print_elements( $elements_data ) {
// Collect all data updaters that should be updated on runtime.
$runtime_elements_iteration_actions = $this->get_runtime_elements_iteration_actions();
if ( $runtime_elements_iteration_actions ) {
$this->iterate_elements( $elements_data, $runtime_elements_iteration_actions, 'render' );
}
foreach ( $elements_data as $element_data ) {
$element = Plugin::$instance->elements_manager->create_element_instance( $element_data );
if ( ! $element ) {
continue;
}
$element->print_element();
}
}
protected function register_document_controls() {
$this->start_controls_section(
'document_settings',
[
'label' => esc_html__( 'General Settings', 'elementor' ),
'tab' => Controls_Manager::TAB_SETTINGS,
]
);
$this->add_control(
'post_title',
[
'label' => esc_html__( 'Title', 'elementor' ),
'type' => Controls_Manager::TEXT,
'default' => $this->post->post_title,
'label_block' => true,
]
$has_wrapper_tags = $this->get_wrapper_tags();
$settings = $this->get_settings_for_display();
$wrapper_tag = 'div';
// Only proceed if the inheriting document has optional wrapper HTML tags to replace 'div'
if ( $has_wrapper_tags ) {
$wrapper_tag = Utils::validate_html_tag( $settings['content_wrapper_html_tag'] );
}
if ( ! $elements_data ) {
$elements_data = $this->get_elements_data();
}
$is_dom_optimization_active = Plugin::elementor()->experiments->is_feature_active( 'e_dom_optimization' );
?>
<<?php Utils::print_validated_html_tag( $wrapper_tag ); ?> <?php Utils::print_html_attributes( $this->get_container_attributes() ); ?>>
<?php if ( ! $is_dom_optimization_active ) : ?>
<div class="elementor-section-wrap">
<?php endif; ?>
<?php $this->print_elements( $elements_data ); ?>
<?php if ( ! $is_dom_optimization_active ) : ?>
</div>
<?php endif; ?>
</<?php Utils::print_validated_html_tag( $wrapper_tag ); ?>>
<?php
}
public function get_wrapper_tags() {
// 'div' is added later, no need to include it in this list
return [
'main',
'article',
'header',
'footer',
'section',
'aside',
'nav',
];
}
Arguments
array:2 [
0 => array:5 [
"id" => "5d35910"
"elType" => "section"
"settings" => array:3 [
"layout" => "full_width"
"gap" => "no"
"padding" => array:6 [
"unit" => "px"
"top" => "0"
"right" => "0"
"bottom" => "50"
"left" => "0"
"isLinked" => false
]
]
"elements" => array:1 [
0 => array:5 [
"id" => "ca61472"
"elType" => "column"
"settings" => array:1 [
"_column_size" => 100
]
"elements" => array:1 [
0 => array:5 [
"id" => "ea60f99"
"elType" => "widget"
"settings" => array:15 [
"title" => "Maison de santé <br> Nant (12)"
"header_size" => "h1"
"align" => "center"
"title_color" => "#ffffff"
"_margin" => array:6 [
"unit" => "px"
"top" => "0"
"right" => "0"
"bottom" => "0"
"left" => "0"
"isLinked" => false
]
"_padding" => array:6 [
"unit" => "px"
"top" => "135"
"right" => "0"
"bottom" => "135"
"left" => "0"
"isLinked" => false
]
"_background_background" => "classic"
"_background_image" => array:2 [
"url" => "https://www.sopribat12.fr/uploads/2019/10/balaruc-les-bains-34-equipement-sportif-pech-meja.jpg"
"id" => 689
]
"_animation" => "none"
"_background_position" => "center center"
"_padding_tablet" => array:6 [
"unit" => "px"
"top" => "50"
"right" => "0"
"bottom" => "50"
"left" => "0"
"isLinked" => false
]
"_css_classes" => "bandeau"
"_background_color" => "#414141"
"_background_image_tablet" => array:2 [
"url" => "https://www.sopribat12.fr/uploads/2019/11/e.png"
"id" => 1388
]
"__dynamic__" => array:1 [
"title" => "[elementor-tag id="8d169a1" name="archive-title" settings="%7B%22include_context%22%3A%22%22%2C%22before%22%3A%22%20%22%7D"]"
]
]
"elements" => []
"widgetType" => "heading"
]
]
"isInner" => false
]
]
"isInner" => false
]
1 => array:5 [
"id" => "59ad2b2"
"elType" => "section"
"settings" => []
"elements" => array:1 [
0 => array:5 [
"id" => "b32ea8a"
"elType" => "column"
"settings" => array:1 [
"_column_size" => 100
]
"elements" => array:1 [
0 => array:5 [
"id" => "59c839b"
"elType" => "widget"
"settings" => array:33 [
"classic_meta_data" => []
"classic_meta_separator" => "///"
"classic_show_read_more" => ""
"classic_read_more_text" => "Read More »"
"cards_posts_per_page" => 10000
"cards_show_excerpt" => ""
"cards_meta_data" => []
"cards_meta_separator" => "•"
"cards_read_more_text" => "Read More »"
"cards_badge_taxonomy" => "type_realisation"
"cards_show_avatar" => ""
"custom_skin_template" => "1875"
"custom_template_list" => array:1 [
0 => array:3 [
"nth" => 1
"skin_template" => "308"
"_id" => "7a67817"
]
]
"custom_same_height" => "100%"
"custom_use_keywords" => "yes"
"custom_posts_per_page" => 10000
"custom_meta_separator" => "///"
"posts_post_type" => "page"
"posts_include" => []
"posts_orderby" => "menu_order"
"posts_query_id" => "typeRealisation"
"pagination_page_limit" => "5"
"pagination_prev_label" => "« Previous"
"pagination_next_label" => "Next »"
"_skin" => "custom"
"classic_posts_per_page" => 100
"classic_thumbnail_size_size" => "medium_large"
"classic_show_excerpt" => ""
"cards_show_read_more" => ""
"cards_show_badge" => ""
"posts_order" => "asc"
"custom_column_gap" => array:3 [
"unit" => "px"
"size" => 10
"sizes" => []
]
"custom_row_gap" => array:3 [
"unit" => "px"
"size" => 10
"sizes" => []
]
]
"elements" => []
"widgetType" => "posts"
]
]
"isInner" => false
]
]
"isInner" => false
]
]
// Handle JS and Customizer requests, with CSS inline.
if ( is_customize_preview() || wp_doing_ajax() ) {
$with_css = true;
}
/**
* Builder Content - With CSS
*
* Allows overriding the `$with_css` parameter which is a factor in determining whether to print the document's
* CSS and font links inline in a `style` tag above the document's markup.
*
* @param $with_css boolean
*/
$with_css = apply_filters( 'elementor/frontend/builder_content/before_print_css', $with_css );
if ( ! empty( $css_file ) && $with_css ) {
$css_file->print_css();
}
$document->print_elements_with_wrapper( $data );
$content = ob_get_clean();
$content = $this->process_more_tag( $content );
/**
* Frontend content.
*
* Filters the content in the frontend.
*
* @since 1.0.0
*
* @param string $content The content.
*/
$content = apply_filters( 'elementor/frontend/the_content', $content );
if ( ! empty( $content ) ) {
$this->_has_elementor_in_page = true;
}
Arguments
array:2 [
0 => array:5 [
"id" => "5d35910"
"elType" => "section"
"settings" => array:3 [
"layout" => "full_width"
"gap" => "no"
"padding" => array:6 [
"unit" => "px"
"top" => "0"
"right" => "0"
"bottom" => "50"
"left" => "0"
"isLinked" => false
]
]
"elements" => array:1 [
0 => array:5 [
"id" => "ca61472"
"elType" => "column"
"settings" => array:1 [
"_column_size" => 100
]
"elements" => array:1 [
0 => array:5 [
"id" => "ea60f99"
"elType" => "widget"
"settings" => array:15 [
"title" => "Maison de santé <br> Nant (12)"
"header_size" => "h1"
"align" => "center"
"title_color" => "#ffffff"
"_margin" => array:6 [
"unit" => "px"
"top" => "0"
"right" => "0"
"bottom" => "0"
"left" => "0"
"isLinked" => false
]
"_padding" => array:6 [
"unit" => "px"
"top" => "135"
"right" => "0"
"bottom" => "135"
"left" => "0"
"isLinked" => false
]
"_background_background" => "classic"
"_background_image" => array:2 [
"url" => "https://www.sopribat12.fr/uploads/2019/10/balaruc-les-bains-34-equipement-sportif-pech-meja.jpg"
"id" => 689
]
"_animation" => "none"
"_background_position" => "center center"
"_padding_tablet" => array:6 [
"unit" => "px"
"top" => "50"
"right" => "0"
"bottom" => "50"
"left" => "0"
"isLinked" => false
]
"_css_classes" => "bandeau"
"_background_color" => "#414141"
"_background_image_tablet" => array:2 [
"url" => "https://www.sopribat12.fr/uploads/2019/11/e.png"
"id" => 1388
]
"__dynamic__" => array:1 [
"title" => "[elementor-tag id="8d169a1" name="archive-title" settings="%7B%22include_context%22%3A%22%22%2C%22before%22%3A%22%20%22%7D"]"
]
]
"elements" => []
"widgetType" => "heading"
]
]
"isInner" => false
]
]
"isInner" => false
]
1 => array:5 [
"id" => "59ad2b2"
"elType" => "section"
"settings" => []
"elements" => array:1 [
0 => array:5 [
"id" => "b32ea8a"
"elType" => "column"
"settings" => array:1 [
"_column_size" => 100
]
"elements" => array:1 [
0 => array:5 [
"id" => "59c839b"
"elType" => "widget"
"settings" => array:33 [
"classic_meta_data" => []
"classic_meta_separator" => "///"
"classic_show_read_more" => ""
"classic_read_more_text" => "Read More »"
"cards_posts_per_page" => 10000
"cards_show_excerpt" => ""
"cards_meta_data" => []
"cards_meta_separator" => "•"
"cards_read_more_text" => "Read More »"
"cards_badge_taxonomy" => "type_realisation"
"cards_show_avatar" => ""
"custom_skin_template" => "1875"
"custom_template_list" => array:1 [
0 => array:3 [
"nth" => 1
"skin_template" => "308"
"_id" => "7a67817"
]
]
"custom_same_height" => "100%"
"custom_use_keywords" => "yes"
"custom_posts_per_page" => 10000
"custom_meta_separator" => "///"
"posts_post_type" => "page"
"posts_include" => []
"posts_orderby" => "menu_order"
"posts_query_id" => "typeRealisation"
"pagination_page_limit" => "5"
"pagination_prev_label" => "« Previous"
"pagination_next_label" => "Next »"
"_skin" => "custom"
"classic_posts_per_page" => 100
"classic_thumbnail_size_size" => "medium_large"
"classic_show_excerpt" => ""
"cards_show_read_more" => ""
"cards_show_badge" => ""
"posts_order" => "asc"
"custom_column_gap" => array:3 [
"unit" => "px"
"size" => 10
"sizes" => []
]
"custom_row_gap" => array:3 [
"unit" => "px"
"size" => 10
"sizes" => []
]
]
"elements" => []
"widgetType" => "posts"
]
]
"isInner" => false
]
]
"isInner" => false
]
]
* @access public
*/
public function get_post() {
return $this->post;
}
/**
* @since 2.0.0
* @access public
*/
public function get_permalink() {
return get_permalink( $this->get_main_id() );
}
/**
* @since 2.0.8
* @access public
*/
public function get_content( $with_css = false ) {
return Plugin::$instance->frontend->get_builder_content( $this->post->ID, $with_css );
}
/**
* @since 2.0.0
* @access public
*/
public function delete() {
if ( 'revision' === $this->post->post_type ) {
$deleted = wp_delete_post_revision( $this->post );
} else {
$deleted = wp_delete_post( $this->post->ID );
}
return $deleted && ! is_wp_error( $deleted );
}
public function force_delete() {
$deleted = wp_delete_post( $this->post->ID, true );
return $deleted && ! is_wp_error( $deleted );
Arguments
* Adds more configuration on top of the controls list and the tabs assigned
* to the control. This method also adds element name, type, icon and more.
*
* @since 2.9.0
* @access protected
*
* @return array The initial config.
*/
public function get_initial_config() {
$config = parent::get_initial_config();
$config['library'] = [
'save_as_same_type' => true,
];
return $config;
}
public function get_content( $with_css = false ) {
return do_shortcode( parent::get_content( $with_css ) );
}
}
Arguments
$label .= ' (' . esc_html__( 'Unsupported', 'elementor-pro' ) . ')';
}
return $label;
}
public function before_get_content() {
$preview_manager = Module::instance()->get_preview_manager();
$preview_manager->switch_to_preview_query();
}
public function after_get_content() {
$preview_manager = Module::instance()->get_preview_manager();
$preview_manager->restore_current_query();
}
public function get_content( $with_css = false ) {
$this->before_get_content();
$content = parent::get_content( $with_css );
$this->after_get_content();
return $content;
}
public function print_content() {
$plugin = Plugin::elementor();
if ( $plugin->preview->is_preview_mode( $this->get_main_id() ) ) {
// PHPCS - the method builder_wrapper is safe.
echo $plugin->preview->builder_wrapper( '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
// PHPCS - the method get_content is safe.
echo $this->get_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
public static function get_preview_as_default() {
return '';
Arguments
public function get_content( $with_css = false ) {
$this->before_get_content();
$content = parent::get_content( $with_css );
$this->after_get_content();
return $content;
}
public function print_content() {
$plugin = Plugin::elementor();
if ( $plugin->preview->is_preview_mode( $this->get_main_id() ) ) {
// PHPCS - the method builder_wrapper is safe.
echo $plugin->preview->builder_wrapper( '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
// PHPCS - the method get_content is safe.
echo $this->get_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
public static function get_preview_as_default() {
return '';
}
public static function get_preview_as_options() {
return [];
}
public function get_container_attributes() {
$attributes = parent::get_container_attributes();
$location = Module::instance()->get_locations_manager()->get_current_location();
if ( $location ) {
$attributes['class'] .= ' elementor-location-' . $location;
}
$this->inspector_log( [
'location' => $location,
'document' => $document,
'description' => 'Added manually but skipped because is not Published',
] );
$this->skip_doc_in_location( $location, $document_id );
continue;
}
}
$this->inspector_log( [
'location' => $location,
'document' => $document,
'description' => isset( $documents_by_conditions[ $document_id ] ) ? 'Added By Condition' : 'Added Manually',
] );
$this->current_location = $location;
$document->print_content();
$this->did_locations[] = $this->current_location;
$this->current_location = null;
$this->set_is_printed( $location, $document_id );
}
/**
* After location content printed.
*
* Fires after Elementor theme location is printed.
*
* The dynamic portion of the hook name, `$location`, refers to the location name.
*
* @since 2.0.0
*
* @param Locations_Manager $this An instance of locations manager.
*/
do_action( "elementor/theme/after_do_{$location}", $this );
return true;
* Override theme location.
*
* Filters the ability to override any Elementor theme location.
*
* @param bool $need_override_location Whether to override theme location.
* @param string $location Location name.
* @param Locations_Manager $this An instance of location manager.
*/
$need_override_location = apply_filters( 'elementor/theme/need_override_location', $need_override_location, $location, $this );
if ( $location && empty( $page_template ) && ( ! $location_exist || $need_override_location ) ) {
$page_template = $page_templates_module::TEMPLATE_HEADER_FOOTER;
}
if ( ! empty( $page_template ) ) {
$template_path = $page_templates_module->get_template_path( $page_template );
if ( $template_path ) {
$page_templates_module->set_print_callback( function() use ( $location ) {
Module::instance()->get_locations_manager()->do_location( $location );
} );
$this->inspector_log( [
'location' => $location,
'template' => $template_path,
'description' => $location_exist ? 'Template File: Location Settings (Override)' : 'Template File: Location not exit',
] );
$template = $template_path;
}
}
return $template;
}
/**
* @param string $location
* @param integer $document_id
*/
public function add_doc_to_location( $location, $document_id ) {
Arguments
while ( have_posts() ) :
the_post();
the_content();
endwhile;
}
/**
* Print content.
*
* Prints the page template content.
*
* @since 2.0.0
* @access public
*/
public function print_content() {
if ( ! $this->print_callback ) {
$this->print_callback = [ $this, 'print_callback' ];
}
call_user_func( $this->print_callback );
}
/**
* Get page template path.
*
* Retrieve the path for any given page template.
*
* @since 2.0.0
* @access public
*
* @param string $page_template The page template name.
*
* @return string Page template path.
*/
public function get_template_path( $page_template ) {
$template_path = '';
switch ( $page_template ) {
case self::TEMPLATE_CANVAS:
$template_path = __DIR__ . '/templates/canvas.php';
break;
while ( have_posts() ) :
the_post();
the_content();
endwhile;
}
/**
* Print content.
*
* Prints the page template content.
*
* @since 2.0.0
* @access public
*/
public function print_content() {
if ( ! $this->print_callback ) {
$this->print_callback = [ $this, 'print_callback' ];
}
call_user_func( $this->print_callback );
}
/**
* Get page template path.
*
* Retrieve the path for any given page template.
*
* @since 2.0.0
* @access public
*
* @param string $page_template The page template name.
*
* @return string Page template path.
*/
public function get_template_path( $page_template ) {
$template_path = '';
switch ( $page_template ) {
case self::TEMPLATE_CANVAS:
$template_path = __DIR__ . '/templates/canvas.php';
break;
Arguments
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
\Elementor\Plugin::$instance->frontend->add_body_class( 'elementor-template-full-width' );
get_header();
/**
* Before Header-Footer page template content.
*
* Fires before the content of Elementor Header-Footer page template.
*
* @since 2.0.0
*/
do_action( 'elementor/page_templates/header-footer/before_content' );
\Elementor\Plugin::$instance->modules_manager->get_modules( 'page-templates' )->print_content();
/**
* After Header-Footer page template content.
*
* Fires after the content of Elementor Header-Footer page template.
*
* @since 2.0.0
*/
do_action( 'elementor/page_templates/header-footer/after_content' );
get_footer();
*/
$template = apply_filters( 'template_include', $template );
$is_stringy = is_string( $template ) || ( is_object( $template ) && method_exists( $template, '__toString' ) );
$template = $is_stringy ? realpath( (string) $template ) : null;
if (
is_string( $template ) &&
( str_ends_with( $template, '.php' ) || str_ends_with( $template, '.html' ) ) &&
is_file( $template ) &&
is_readable( $template )
) {
/**
* Fires immediately before including the template.
*
* @since 6.9.0
*
* @param string $template The path of the template about to be included.
*/
do_action( 'wp_before_include_template', $template );
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
Arguments
"/var/www/sopribat12.fr_www/httpsdocs/plugins/elementor/modules/page-templates/templates/header-footer.php"
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
Arguments
"/var/www/sopribat12.fr_www/httpsdocs/wordpress/wp-includes/template-loader.php"
|
| We need to define and tell WordPress to load the WordPress theme and
| output it to the client's browser.
|
*/
define('WP_USE_THEMES', true);
/*
|--------------------------------------------------------------------------
| Booting WordPress
|--------------------------------------------------------------------------
|
| This is the front to the WordPress application. This file doesn't do
| anything, but loads wp-blog-header.php which does and tells WordPress to
| load the theme.
|
*/
require __DIR__.'/wordpress/wp-blog-header.php';
Arguments
"/var/www/sopribat12.fr_www/httpsdocs/wordpress/wp-blog-header.php"