'elementor/frontend/get_builder_content', $document, $this->_is_excerpt, $with_css );
return $content;
}
/**
* Retrieve builder content for display.
*
* Used to render and return the post content with all the Elementor elements.
*
* @since 1.0.0
* @access public
*
* @param int $post_id The post ID.
*
* @param bool $with_css Optional. Whether to retrieve the content with CSS
* or not. Default is false.
*
* @return string The post content.
*/
public function get_builder_content_for_display( $post_id, $with_css = false ) {
if ( ! get_post( $post_id ) ) {
return '';
}
$editor = Plugin::$instance->editor;
// Avoid recursion
if ( get_the_ID() === (int) $post_id ) {
$content = '';
if ( $editor->is_edit_mode() ) {
$content = '
' . esc_html__( 'Invalid Data: The Template ID cannot be the same as the currently edited template. Please choose a different one.', 'elementor' ) . '
';
}
return $content;
}
// Set edit mode as false, so don't render settings and etc. use the $is_edit_mode to indicate if we need the CSS inline
$is_edit_mode = $editor->is_edit_mode();
$editor->set_edit_mode( false );
$with_css = $with_css ? true : $is_edit_mode;
$content = $this->get_builder_content( $post_id, $with_css );
// Restore edit mode state
Plugin::$instance->editor->set_edit_mode( $is_edit_mode );
return $content;
}
/**
* Start excerpt flag.
*
* Flags when `the_excerpt` is called. Used to avoid enqueueing CSS in the excerpt.
*
* @since 1.4.3
* @access public
*
* @param string $excerpt The post excerpt.
*
* @return string The post excerpt.
*/
public function start_excerpt_flag( $excerpt ) {
$this->_is_excerpt = true;
return $excerpt;
}
/**
* End excerpt flag.
*
* Flags when `the_excerpt` call ended.
*
* @since 1.4.3
* @access public
*
* @param string $excerpt The post excerpt.
*
* @return string The post excerpt.
*/
public function end_excerpt_flag( $excerpt ) {
$this->_is_excerpt = false;
return $excerpt;
}
/**
* Remove content filters.
*
* Remove WordPress default filters that conflicted with Elementor.
*
* @since 1.5.0
* @access public
*/
public function remove_content_filters() {
$filters = [
'wpautop',
'shortcode_unautop',
'wptexturize',
];
foreach ( $filters as $filter ) {
// Check if another plugin/theme do not already removed the filter.
if ( has_filter( 'the_content', $filter ) ) {
remove_filter( 'the_content', $filter );
$this->content_removed_filters[] = $filter;
}
}
}
/**
* Has Elementor In Page
*
* Determine whether the current page is using Elementor.
*
* @since 2.0.9
*
* @access public
* @return bool
*/
public function has_elementor_in_page() {
return $this->_has_elementor_in_page;
}
public function create_action_hash( $action, array $settings = [] ) {
return '#' . rawurlencode( sprintf( 'elementor-action:action=%1$s&settings=%2$s', $action, base64_encode( wp_json_encode( $settings ) ) ) );
}
/**
* Is the current render mode is static.
*
* @return bool
*/
public function is_static_render_mode() {
// The render mode manager is exists only in frontend,
// so by default if it is not exist the method will return false.
if ( ! $this->render_mode_manager ) {
return false;
}
return $this->render_mode_manager->get_current()->is_static();
}
/**
* Get Init Settings
*
* Used to define the default/initial settings of the object. Inheriting classes may implement this method to define
* their own default/initial settings.
*
* @since 2.3.0
*
* @access protected
* @return array
*/
protected function get_init_settings() {
$is_preview_mode = Plugin::$instance->preview->is_preview_mode( Plugin::$instance->preview->get_post_id() );
$active_experimental_features = Plugin::$instance->experiments->get_active_features();
$active_experimental_features = array_fill_keys( array_keys( $active_experimental_features ), true );
$assets_url = ELEMENTOR_ASSETS_URL;
/**
* Frontend assets URL
*
* Filters Elementor frontend assets URL.
*
* @since 2.3.0
*
* @param string $assets_url The frontend assets URL. Default is ELEMENTOR_ASSETS_URL.
*/
$assets_url = apply_filters( 'elementor/frontend/assets_url', $assets_url );
$settings = [
'environmentMode' => [
'edit' => $is_preview_mode,
'wpPreview' => is_preview(),
'isScriptDebug' => Utils::is_script_debug(),
],
'i18n' => [
'shareOnFacebook' => esc_html__( 'Share on Facebook', 'elementor' ),
'shareOnTwitter' => esc_html__( 'Share on Twitter', 'elementor' ),
'pinIt' => esc_html__( 'Pin it', 'elementor' ),
'download' => esc_html__( 'Download', 'elementor' ),
'downloadImage' => esc_html__( 'Download image', 'elementor' ),
'fullscreen' => esc_html__( 'Fullscreen', 'elementor' ),
'zoom' => esc_html__( 'Zoom', 'elementor' ),
'share' => esc_html__( 'Share', 'elementor' ),
'playVideo' => esc_html__( 'Play Video', 'elementor' ),
'previous' => esc_html__( 'Previous', 'elementor' ),
'next' => esc_html__( 'Next', 'elementor' ),
'close' => esc_html__( 'Close', 'elementor' ),
'a11yCarouselWrapperAriaLabel' => __( 'Carousel | Horizontal scrolling: Arrow Left & Right', 'elementor' ),
'a11yCarouselPrevSlideMessage' => __( 'Previous slide', 'elementor' ),
'a11yCarouselNextSlideMessage' => __( 'Next slide', 'elementor' ),
'a11yCarouselFirstSlideMessage' => __( 'This is the first slide', 'elementor' ),
'a11yCarouselLastSlideMessage' => __( 'This is the last slide', 'elementor' ),
'a11yCarouselPaginationBulletMessage' => __( 'Go to slide', 'elementor' ),
],
'is_rtl' => is_rtl(),
// 'breakpoints' object is kept for BC.
'breakpoints' => Responsive::get_breakpoints(),
// 'responsive' contains the custom breakpoints config introduced in Elementor v3.2.0
'responsive' => [
'breakpoints' => Plugin::$instance->breakpoints->get_breakpoints_config(),
],
'version' => ELEMENTOR_VERSION,
'is_static' => $this->is_static_render_mode(),
'experimentalFeatures' => $active_experimental_features,
'urls' => [
'assets' => $assets_url,
],
'swiperClass' => Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' ) ? 'swiper' : 'swiper-container',
];
$settings['settings'] = SettingsManager::get_settings_frontend_config();
$kit = Plugin::$instance->kits_manager->get_active_kit_for_frontend();
$settings['kit'] = $kit->get_frontend_settings();
if ( is_singular() ) {
$post = get_post();
$title = Utils::urlencode_html_entities( wp_get_document_title() );
// Try to use the 'large' WP image size because the Pinterest share API
// has problems accepting shares with large images sometimes, and the WP 'large' thumbnail is
// the largest default WP image size that will probably not be changed in most sites
$featured_image_url = get_the_post_thumbnail_url( null, 'large' );
// If the large size was nullified, use the full size which cannot be nullified/deleted
if ( ! $featured_image_url ) {
$featured_image_url = get_the_post_thumbnail_url( null, 'full' );
}
$settings['post'] = [
'id' => $post->ID,
'title' => $title,
'excerpt' => $post->post_excerpt,
'featuredImage' => $featured_image_url,
];
} else {
$settings['post'] = [
'id' => 0,
'title' => wp_get_document_title(),
'excerpt' => get_the_archive_description(),
];
}
$empty_object = (object) [];
if ( $is_preview_mode ) {
$settings['elements'] = [
'data' => $empty_object,
'editSettings' => $empty_object,
'keys' => $empty_object,
];
}
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
if ( ! empty( $user->roles ) ) {
$settings['user'] = [
'roles' => $user->roles,
];
}
}
return $settings;
}
/**
* Restore content filters.
*
* Restore removed WordPress filters that conflicted with Elementor.
*
* @since 1.5.0
* @access public
*/
public function restore_content_filters() {
foreach ( $this->content_removed_filters as $filter ) {
add_filter( 'the_content', $filter );
}
$this->content_removed_filters = [];
}
/**
* Process More Tag
*
* Respect the native WP () tag
*
* @access private
* @since 2.0.4
*
* @param $content
*
* @return string
*/
private function process_more_tag( $content ) {
$post = get_post();
$content = str_replace( '<!--more-->', '', $content );
$parts = get_extended( $content );
if ( empty( $parts['extended'] ) ) {
return $content;
}
if ( is_singular() ) {
return $parts['main'] . '' . $parts['extended'];
}
if ( empty( $parts['more_text'] ) ) {
$parts['more_text'] = esc_html__( '(more…)', 'elementor' );
}
$more_link_text = sprintf(
'%2$s',
sprintf(
/* translators: %s: Current post name. */
__( 'Continue reading %s', 'elementor' ),
the_title_attribute( [
'echo' => false,
] )
),
$parts['more_text']
);
$more_link = sprintf( ' %s', get_permalink(), $post->ID, $more_link_text );
/**
* The content "more" link.
*
* Filters the "more" link displayed after the content.
*
* This hook can be used either to change the link syntax or to change the
* text inside the link.
*
* @since 2.0.4
*
* @param string $more_link The more link.
* @param string $more_link_text The text inside the more link.
*/
$more_link = apply_filters( 'the_content_more_link', $more_link, $more_link_text );
return force_balance_tags( $parts['main'] ) . $more_link;
}
private function is_optimized_css_mode() {
$is_optimized_css_loading = Plugin::$instance->experiments->is_feature_active( 'e_optimized_css_loading' );
return ! Utils::is_script_debug() && $is_optimized_css_loading && ! Plugin::$instance->preview->is_preview_mode();
}
}
Fatal error: Uncaught Error: Class 'Elementor\Frontend' not found in /home/merciket/public_html/wp-content/plugins/elementor/includes/plugin.php:727
Stack trace:
#0 /home/merciket/public_html/wp-content/plugins/elementor/includes/plugin.php(647): Elementor\Plugin->init_components()
#1 /home/merciket/public_html/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('')
#2 /home/merciket/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 /home/merciket/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /home/merciket/public_html/wp-settings.php(643): do_action('init')
#5 /home/merciket/public_html/wp-config.php(92): require_once('/home/merciket/...')
#6 /home/merciket/public_html/wp-load.php(50): require_once('/home/merciket/...')
#7 /home/merciket/public_html/wp-blog-header.php(13): require_once('/home/merciket/...')
#8 /home/merciket/public_html/index.php(17): require('/home/merciket/...')
#9 {main}
thrown in /home/merciket/public_html/wp-content/plugins/elementor/includes/plugin.php on line 727