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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder
File: class-et-builder-element.php
* @param string $parent_address [description]
[2000] Fix | Delete
* @param string $global_parent [description]
[2001] Fix | Delete
* @param string $global_parent_type [description]
[2002] Fix | Delete
*
[2003] Fix | Delete
* @return string The module's HTML output.
[2004] Fix | Delete
*/
[2005] Fix | Delete
function _render( $attrs, $content = null, $render_slug, $parent_address = '', $global_parent = '', $global_parent_type = '', $parent_type = '' ) {
[2006] Fix | Delete
global $et_fb_processing_shortcode_object, $et_pb_current_parent_type, $et_pb_parent_section_type;
[2007] Fix | Delete
[2008] Fix | Delete
if ( $this->is_rendering ) {
[2009] Fix | Delete
// Every module instance is a singleton so the TB Post Content module
[2010] Fix | Delete
// can cause a section, row and/or column to call _render() multiple
[2011] Fix | Delete
// times - once for each respective shortcode found in the content
[2012] Fix | Delete
// rendered by the Post Content module.
[2013] Fix | Delete
// Since this _render() method changes object state this leads to
[2014] Fix | Delete
// props being messed up between renders so we have to clone the
[2015] Fix | Delete
// base instance every time we try to render while the base
[2016] Fix | Delete
// instance is still rendering.
[2017] Fix | Delete
$clone = clone $this;
[2018] Fix | Delete
$clone->is_rendering = false;
[2019] Fix | Delete
[2020] Fix | Delete
// @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found
[2021] Fix | Delete
return call_user_func_array( array( $clone, '_render' ), func_get_args() );
[2022] Fix | Delete
}
[2023] Fix | Delete
[2024] Fix | Delete
$this->_maybe_rebuild_option_template();
[2025] Fix | Delete
[2026] Fix | Delete
$attrs = $this->_maybe_add_global_presets_settings( $attrs, $render_slug );
[2027] Fix | Delete
[2028] Fix | Delete
// Use the current layout or post ID for AB testing. This is not guaranteed to be the real
[2029] Fix | Delete
// current post ID if we are rendering a TB layout.
[2030] Fix | Delete
$post_interference = self::_should_respect_post_interference();
[2031] Fix | Delete
$post_id = apply_filters( 'et_is_ab_testing_active_post_id', self::get_layout_id() );
[2032] Fix | Delete
$is_main_post = $this->get_the_ID() === $post_id;
[2033] Fix | Delete
[2034] Fix | Delete
if ( ! $post_interference ) {
[2035] Fix | Delete
ET_Post_Stack::replace( ET_Post_Stack::get_main_post() );
[2036] Fix | Delete
}
[2037] Fix | Delete
[2038] Fix | Delete
$enabled_dynamic_attributes = $this->_get_enabled_dynamic_attributes( $attrs );
[2039] Fix | Delete
[2040] Fix | Delete
$attrs = $this->_encode_legacy_dynamic_content( $attrs, $enabled_dynamic_attributes );
[2041] Fix | Delete
[2042] Fix | Delete
$this->attrs_unprocessed = $attrs;
[2043] Fix | Delete
[2044] Fix | Delete
$attrs = $this->process_dynamic_attrs( $attrs );
[2045] Fix | Delete
[2046] Fix | Delete
$this->props = shortcode_atts( $this->resolve_conditional_defaults($attrs, $render_slug), $attrs );
[2047] Fix | Delete
[2048] Fix | Delete
$this->_decode_double_quotes( $enabled_dynamic_attributes, $et_fb_processing_shortcode_object );
[2049] Fix | Delete
[2050] Fix | Delete
$this->_maybe_remove_global_default_values_from_props();
[2051] Fix | Delete
[2052] Fix | Delete
// Some module items need to inherit value from its module parent
[2053] Fix | Delete
// This inheritance needs to be done before migration to make it compatible with migration process
[2054] Fix | Delete
$this->maybe_inherit_values();
[2055] Fix | Delete
[2056] Fix | Delete
$_address = $this->generate_element_address( $render_slug );
[2057] Fix | Delete
[2058] Fix | Delete
/**
[2059] Fix | Delete
* Filters Module Props.
[2060] Fix | Delete
*
[2061] Fix | Delete
* @param array $props Array of processed props.
[2062] Fix | Delete
* @param array $attrs Array of original shortcode attrs
[2063] Fix | Delete
* @param string $slug Module slug
[2064] Fix | Delete
* @param string $_address Module Address
[2065] Fix | Delete
* @param string $content Module content
[2066] Fix | Delete
*/
[2067] Fix | Delete
$this->props = apply_filters( 'et_pb_module_shortcode_attributes', $this->props, $attrs, $render_slug, $_address, $content );
[2068] Fix | Delete
[2069] Fix | Delete
$global_content = false;
[2070] Fix | Delete
[2071] Fix | Delete
$ab_testing_enabled = et_is_ab_testing_active( $post_id );
[2072] Fix | Delete
[2073] Fix | Delete
$hide_subject_module_cached = $hide_subject_module = false;
[2074] Fix | Delete
[2075] Fix | Delete
$global_module_id = $this->props['global_module'];
[2076] Fix | Delete
[2077] Fix | Delete
// If the section/row/module is disabled, hide it
[2078] Fix | Delete
if ( isset( $this->props['disabled'] ) && 'on' === $this->props['disabled'] && ! $et_fb_processing_shortcode_object ) {
[2079] Fix | Delete
if ( ! $post_interference ) {
[2080] Fix | Delete
ET_Post_Stack::restore();
[2081] Fix | Delete
}
[2082] Fix | Delete
return;
[2083] Fix | Delete
}
[2084] Fix | Delete
[2085] Fix | Delete
// need to perform additional check and some modifications in case AB testing enabled
[2086] Fix | Delete
// skip for VB since it's handled on VB side.
[2087] Fix | Delete
if ( $ab_testing_enabled && ( ! $is_main_post || ! $et_fb_processing_shortcode_object ) ) {
[2088] Fix | Delete
// check if ab testing enabled for this module and if it shouldn't be displayed currently
[2089] Fix | Delete
$hide_subject_module = ( ! $is_main_post || ! $et_fb_processing_shortcode_object ) && ! $this->_is_display_module( $this->props ) && ! et_pb_detect_cache_plugins();
[2090] Fix | Delete
[2091] Fix | Delete
// add class to the AB testing subject if needed
[2092] Fix | Delete
if ( isset( $this->props['ab_subject_id'] ) && '' !== $this->props['ab_subject_id'] ) {
[2093] Fix | Delete
$subject_class = sprintf( ' et_pb_ab_subject et_pb_ab_subject_id-%1$s_%2$s',
[2094] Fix | Delete
esc_attr( $post_id ),
[2095] Fix | Delete
esc_attr( $this->props['ab_subject_id'] )
[2096] Fix | Delete
);
[2097] Fix | Delete
$this->props['module_class'] = isset( $this->props['module_class'] ) && '' !== $this->props['module_class'] ? $this->props['module_class'] . $subject_class : $subject_class;
[2098] Fix | Delete
[2099] Fix | Delete
if ( et_pb_detect_cache_plugins() ) {
[2100] Fix | Delete
$hide_subject_module_cached = true;
[2101] Fix | Delete
}
[2102] Fix | Delete
}
[2103] Fix | Delete
[2104] Fix | Delete
// add class to the AB testing goal if needed
[2105] Fix | Delete
if ( isset( $this->props['ab_goal'] ) && 'on' === $this->props['ab_goal'] ) {
[2106] Fix | Delete
$goal_class = sprintf( ' et_pb_ab_goal et_pb_ab_goal_id-%1$s', esc_attr( $post_id ) );
[2107] Fix | Delete
$this->props['module_class'] = isset( $this->props['module_class'] ) && '' !== $this->props['module_class'] ? $this->props['module_class'] . $goal_class : $goal_class;
[2108] Fix | Delete
}
[2109] Fix | Delete
}
[2110] Fix | Delete
[2111] Fix | Delete
//override module attributes for global module. Skip that step while processing Frontend Builder object
[2112] Fix | Delete
if ( ! empty( $global_module_id ) && ! $et_fb_processing_shortcode_object ) {
[2113] Fix | Delete
// Update render_slug when rendering global rows inside Specialty sections.
[2114] Fix | Delete
$render_slug = 'et_pb_specialty_column' === $et_pb_current_parent_type && 'et_pb_row' === $render_slug ? 'et_pb_row_inner' : $render_slug;
[2115] Fix | Delete
[2116] Fix | Delete
$global_module_data = et_pb_load_global_module( $global_module_id, $render_slug );
[2117] Fix | Delete
[2118] Fix | Delete
if ( '' !== $global_module_data ) {
[2119] Fix | Delete
$unsynced_global_attributes = get_post_meta( $global_module_id, '_et_pb_excluded_global_options' );
[2120] Fix | Delete
$use_updated_global_sync_method = ! empty( $unsynced_global_attributes );
[2121] Fix | Delete
[2122] Fix | Delete
$unsynced_options = ! empty( $unsynced_global_attributes[0] ) ? json_decode( $unsynced_global_attributes[0], true ) : array();
[2123] Fix | Delete
[2124] Fix | Delete
$content_synced = $use_updated_global_sync_method && ! in_array( 'et_pb_content_field', $unsynced_options );
[2125] Fix | Delete
[2126] Fix | Delete
// support legacy selective sync system
[2127] Fix | Delete
if ( ! $use_updated_global_sync_method ) {
[2128] Fix | Delete
$content_synced = ! isset( $this->props['saved_tabs'] ) || false !== strpos( $this->props['saved_tabs'], 'general' ) || 'all' === $this->props['saved_tabs'];
[2129] Fix | Delete
}
[2130] Fix | Delete
[2131] Fix | Delete
if ( $content_synced ) {
[2132] Fix | Delete
// Set the flag showing if we load inner row
[2133] Fix | Delete
$load_inner_row = 'et_pb_row_inner' === $render_slug;
[2134] Fix | Delete
$global_content = et_pb_get_global_module_content( $global_module_data, $render_slug, $load_inner_row );
[2135] Fix | Delete
}
[2136] Fix | Delete
[2137] Fix | Delete
// cleanup the shortcode string to avoid the attributes messing with content
[2138] Fix | Delete
$global_content_processed = false !== $global_content ? str_replace( $global_content, '', $global_module_data ) : $global_module_data;
[2139] Fix | Delete
$global_atts = shortcode_parse_atts( et_pb_remove_shortcode_content( $global_content_processed, $this->slug ) );
[2140] Fix | Delete
$global_atts = $this->_encode_legacy_dynamic_content( $global_atts, $enabled_dynamic_attributes );
[2141] Fix | Delete
[2142] Fix | Delete
// Additional content processing required for Code Modules.
[2143] Fix | Delete
if ( in_array( $render_slug, array( 'et_pb_code', 'et_pb_fullwidth_code' ) ) ) {
[2144] Fix | Delete
$global_content_processed = _et_pb_code_module_prep_content( $global_content_processed );
[2145] Fix | Delete
}
[2146] Fix | Delete
[2147] Fix | Delete
// reset module addresses because global items will be processed once again and address will be incremented wrongly
[2148] Fix | Delete
if ( false !== strpos( $render_slug, '_section' ) ) {
[2149] Fix | Delete
self::_set_index( self::INDEX_SECTION, self::_get_index( self::INDEX_SECTION ) - 1 );
[2150] Fix | Delete
self::_set_index( self::INDEX_ROW, -1 );
[2151] Fix | Delete
self::_set_index( self::INDEX_ROW_INNER, -1 );
[2152] Fix | Delete
self::_set_index( self::INDEX_COLUMN, -1 );
[2153] Fix | Delete
self::_set_index( self::INDEX_COLUMN_INNER, -1 );
[2154] Fix | Delete
self::_set_index( self::INDEX_MODULE, -1 );
[2155] Fix | Delete
self::_set_index( self::INDEX_MODULE_ITEM, -1 );
[2156] Fix | Delete
} else if ( false !== strpos( $render_slug, '_row_inner' ) ) {
[2157] Fix | Delete
self::_set_index( self::INDEX_ROW, self::_get_index( self::INDEX_ROW ) - 1 );
[2158] Fix | Delete
self::_set_index( self::INDEX_COLUMN_INNER, -1 );
[2159] Fix | Delete
self::_set_index( self::INDEX_MODULE, -1 );
[2160] Fix | Delete
self::_set_index( self::INDEX_MODULE_ITEM, -1 );
[2161] Fix | Delete
} else if ( false !== strpos( $render_slug, '_row' ) ) {
[2162] Fix | Delete
self::_set_index( self::INDEX_ROW, self::_get_index( self::INDEX_ROW ) - 1 );
[2163] Fix | Delete
self::_set_index( self::INDEX_COLUMN, -1 );
[2164] Fix | Delete
self::_set_index( self::INDEX_MODULE, -1 );
[2165] Fix | Delete
self::_set_index( self::INDEX_MODULE_ITEM, -1 );
[2166] Fix | Delete
} else {
[2167] Fix | Delete
self::_set_index( self::INDEX_MODULE, self::_get_index( self::INDEX_MODULE ) - 1 );
[2168] Fix | Delete
self::_set_index( self::INDEX_MODULE_ITEM, -1 );
[2169] Fix | Delete
}
[2170] Fix | Delete
[2171] Fix | Delete
// Always unsync 'next_background_color' and 'prev_background_color' options for global sections
[2172] Fix | Delete
// They should be dynamic and reflect color of top and bottom sections
[2173] Fix | Delete
if ( $render_slug === 'et_pb_section' ) {
[2174] Fix | Delete
$unsynced_options = array_merge( $unsynced_options, array( 'next_background_color', 'prev_background_color' ) );
[2175] Fix | Delete
}
[2176] Fix | Delete
[2177] Fix | Delete
foreach( $this->props as $single_attr => $value ) {
[2178] Fix | Delete
if ( isset( $global_atts[$single_attr] ) && ! in_array( $single_attr, $unsynced_options ) ) {
[2179] Fix | Delete
// replace %22 with double quotes in options to make sure it's rendered correctly
[2180] Fix | Delete
$this->props[ $single_attr] = is_string( $global_atts[ $single_attr] ) && ! array_intersect( array( "et_pb_{$single_attr}", $single_attr ), $this->dbl_quote_exception_options ) ? str_replace( '%22', '"', $global_atts[ $single_attr] ) : $global_atts[ $single_attr];
[2181] Fix | Delete
}
[2182] Fix | Delete
}
[2183] Fix | Delete
[2184] Fix | Delete
$this->props = $this->process_dynamic_attrs( $this->props );
[2185] Fix | Delete
[2186] Fix | Delete
$this->_decode_double_quotes( array(), $et_fb_processing_shortcode_object );
[2187] Fix | Delete
}
[2188] Fix | Delete
}
[2189] Fix | Delete
[2190] Fix | Delete
self::set_order_class( $render_slug );
[2191] Fix | Delete
[2192] Fix | Delete
$this->before_render();
[2193] Fix | Delete
[2194] Fix | Delete
$this->content_unprocessed = $this->_encode_legacy_dynamic_content_value(
[2195] Fix | Delete
'content',
[2196] Fix | Delete
false !== $global_content ? $global_content : $content,
[2197] Fix | Delete
$enabled_dynamic_attributes
[2198] Fix | Delete
);
[2199] Fix | Delete
$content = $this->_resolve_value(
[2200] Fix | Delete
$this->get_the_ID(),
[2201] Fix | Delete
'content',
[2202] Fix | Delete
$this->content_unprocessed,
[2203] Fix | Delete
$enabled_dynamic_attributes,
[2204] Fix | Delete
$et_fb_processing_shortcode_object
[2205] Fix | Delete
);
[2206] Fix | Delete
[2207] Fix | Delete
// Process scroll effects earlier to preserve the modules hierarchy during processing.
[2208] Fix | Delete
$this->process_scroll_effects( $render_slug );
[2209] Fix | Delete
[2210] Fix | Delete
$content = apply_filters( 'et_pb_module_content', $content, $this->props, $attrs, $render_slug, $_address, $global_content );
[2211] Fix | Delete
[2212] Fix | Delete
// Set empty TinyMCE content '&lt;br /&gt;<br />' as empty string.
[2213] Fix | Delete
if ( 'ltbrgtbr' === preg_replace( '/[^a-z]/', '', $content ) ) {
[2214] Fix | Delete
$content = '';
[2215] Fix | Delete
}
[2216] Fix | Delete
[2217] Fix | Delete
if ( $et_fb_processing_shortcode_object ) {
[2218] Fix | Delete
$this->content = et_pb_fix_shortcodes( $content, $this->use_raw_content );
[2219] Fix | Delete
} else {
[2220] Fix | Delete
// Line breaks should be converted before do_shortcode to avoid legit rendered shortcode
[2221] Fix | Delete
// line breaks being trimmed into one line and causing issue like broken javascript code
[2222] Fix | Delete
if ( $this->use_raw_content ) {
[2223] Fix | Delete
$content = et_builder_convert_line_breaks( et_builder_replace_code_content_entities( $content ) );
[2224] Fix | Delete
}
[2225] Fix | Delete
[2226] Fix | Delete
if( ! ( isset( $this->is_structure_element ) && $this->is_structure_element ) ) {
[2227] Fix | Delete
$content = et_pb_fix_shortcodes( $content, $this->use_raw_content );
[2228] Fix | Delete
$content = et_maybe_enable_embed_shortcode( $content, true );
[2229] Fix | Delete
$this->content = do_shortcode( $content );
[2230] Fix | Delete
} else {
[2231] Fix | Delete
$this->content = '';
[2232] Fix | Delete
}
[2233] Fix | Delete
$this->props['content'] = $this->content;
[2234] Fix | Delete
}
[2235] Fix | Delete
[2236] Fix | Delete
// Restart classname on shortcode callback. Module class is only called once, not on every
[2237] Fix | Delete
// shortcode module appearance. Thus classname construction need to be restarted on each
[2238] Fix | Delete
// module callback
[2239] Fix | Delete
$this->classname = array();
[2240] Fix | Delete
[2241] Fix | Delete
if ( method_exists( $this, 'shortcode_atts' ) ) {
[2242] Fix | Delete
// Deprecated. Do not use this!
[2243] Fix | Delete
$this->shortcode_atts();
[2244] Fix | Delete
}
[2245] Fix | Delete
[2246] Fix | Delete
$this->process_additional_options( $render_slug );
[2247] Fix | Delete
$this->process_custom_css_fields( $render_slug );
[2248] Fix | Delete
[2249] Fix | Delete
// load inline fonts if needed
[2250] Fix | Delete
if ( isset( $this->props['inline_fonts'] ) ) {
[2251] Fix | Delete
$this->process_inline_fonts_option( $this->props['inline_fonts'] );
[2252] Fix | Delete
}
[2253] Fix | Delete
[2254] Fix | Delete
// Automatically add slug as classname for module that uses other module's shortcode callback
[2255] Fix | Delete
// This has to be added first because some classname is position-sensitive and used for
[2256] Fix | Delete
// JS-based calculation (i.e. .et_pb_column in column inner)
[2257] Fix | Delete
if ( $this->slug !== $render_slug ) {
[2258] Fix | Delete
$this->add_classname( $this->slug );
[2259] Fix | Delete
[2260] Fix | Delete
// Apply classnames added to the module that uses other module's shortcode callback
[2261] Fix | Delete
// (i.e. `process_additional_options` for the column inner)
[2262] Fix | Delete
$module = self::get_module( $render_slug, $this->get_post_type() );
[2263] Fix | Delete
$this->add_classname( $module->classname );
[2264] Fix | Delete
}
[2265] Fix | Delete
[2266] Fix | Delete
// Automatically add default classnames
[2267] Fix | Delete
$this->add_classname( array(
[2268] Fix | Delete
'et_pb_module',
[2269] Fix | Delete
$render_slug,
[2270] Fix | Delete
ET_Builder_Element::get_module_order_class( $render_slug ),
[2271] Fix | Delete
) );
[2272] Fix | Delete
[2273] Fix | Delete
// Automatically added user-defined classname if there's any
[2274] Fix | Delete
if ( isset( $this->props['module_class'] ) && '' !== $this->props['module_class'] ) {
[2275] Fix | Delete
$this->add_classname( explode( ' ', $this->props['module_class'] ) );
[2276] Fix | Delete
}
[2277] Fix | Delete
[2278] Fix | Delete
// Animation Styles.
[2279] Fix | Delete
$animation_style = isset( $this->props['animation_style'] ) && '' !== $this->props['animation_style'] ? $this->props['animation_style'] : false;
[2280] Fix | Delete
$animation_repeat = isset( $this->props['animation_repeat'] ) && '' !== $this->props['animation_repeat'] ? $this->props['animation_repeat'] : 'once';
[2281] Fix | Delete
$animation_direction = isset( $this->props['animation_direction'] ) && '' !== $this->props['animation_direction'] ? $this->props['animation_direction'] : 'center';
[2282] Fix | Delete
$animation_duration = isset( $this->props['animation_duration'] ) && '' !== $this->props['animation_duration'] ? $this->props['animation_duration'] : '500ms';
[2283] Fix | Delete
$animation_delay = isset( $this->props['animation_delay'] ) && '' !== $this->props['animation_delay'] ? $this->props['animation_delay'] : '0ms';
[2284] Fix | Delete
$animation_intensity = isset( $this->props["animation_intensity_{$animation_style }"] ) && '' !== $this->props["animation_intensity_{$animation_style }"] ? $this->props["animation_intensity_{$animation_style }"] : '50%';
[2285] Fix | Delete
$animation_starting_opacity = isset( $this->props['animation_starting_opacity'] ) && '' !== $this->props['animation_starting_opacity'] ? $this->props['animation_starting_opacity'] : '0%';
[2286] Fix | Delete
$animation_speed_curve = isset( $this->props['animation_speed_curve'] ) && '' !== $this->props['animation_speed_curve'] ? $this->props['animation_speed_curve'] : 'ease-in-out';
[2287] Fix | Delete
[2288] Fix | Delete
// Animation style and direction values for Tablet & Phone. Basically, style for tablet and
[2289] Fix | Delete
// phone are same with the desktop because we only edit responsive settings for the affected
[2290] Fix | Delete
// fields under animation style. Variable $animation_style_responsive need to be kept as
[2291] Fix | Delete
// unmodified variable because it will be used by animation intensity.
[2292] Fix | Delete
$animation_style_responsive = $animation_style;
[2293] Fix | Delete
$animation_style_tablet = $animation_style;
[2294] Fix | Delete
$animation_style_phone = $animation_style;
[2295] Fix | Delete
$animation_direction_tablet = et_pb_responsive_options()->get_any_value( $this->props, 'animation_direction_tablet' );
[2296] Fix | Delete
$animation_direction_phone = et_pb_responsive_options()->get_any_value( $this->props, 'animation_direction_phone' );
[2297] Fix | Delete
[2298] Fix | Delete
// Check if this is an AJAX request since this is how VB loads the initial module data
[2299] Fix | Delete
// et_core_is_fb_enabled() always returns `false` here
[2300] Fix | Delete
if ( $animation_style && 'none' !== $animation_style && ! wp_doing_ajax() ) {
[2301] Fix | Delete
$transformedAnimations = array(
[2302] Fix | Delete
'desktop' => false,
[2303] Fix | Delete
'tablet' => false,
[2304] Fix | Delete
'phone' => false,
[2305] Fix | Delete
);
[2306] Fix | Delete
// Fade doesn't have direction
[2307] Fix | Delete
if ( 'fade' === $animation_style ) {
[2308] Fix | Delete
$animation_direction_tablet = '';
[2309] Fix | Delete
$animation_direction_phone = '';
[2310] Fix | Delete
} else {
[2311] Fix | Delete
$directions_list = array( 'top', 'right', 'bottom', 'left' );
[2312] Fix | Delete
if ( in_array( $animation_direction, $directions_list ) ) {
[2313] Fix | Delete
$animation_style .= ucfirst( $animation_direction );
[2314] Fix | Delete
}
[2315] Fix | Delete
[2316] Fix | Delete
// avoid custom animation on button because animation is applied to the wrapper so transforms do not need to combine.
[2317] Fix | Delete
if ( 'et_pb_button' !== $render_slug ) {
[2318] Fix | Delete
foreach ( preg_grep( '/(transform_)/', array_keys( $this->props ) ) as $index => $key ) {
[2319] Fix | Delete
if ( strpos( $key, 'link' ) !== false || strpos( $key, 'hover' ) !== false || strpos( $key, 'last_edited' ) !== false ) {
[2320] Fix | Delete
continue;
[2321] Fix | Delete
}
[2322] Fix | Delete
[2323] Fix | Delete
if ( ! empty( $this->props[ $key ] ) ) {
[2324] Fix | Delete
if ( ! $transformedAnimations['desktop'] && strpos( $key, 'tablet' ) === false && strpos( $key, 'phone' ) === false ) {
[2325] Fix | Delete
$transformedAnimations['desktop'] = true;
[2326] Fix | Delete
$transformedAnimations['tablet'] = true;
[2327] Fix | Delete
$transformedAnimations['phone'] = true;
[2328] Fix | Delete
} else if ( ! $transformedAnimations['tablet'] && strpos( $key, 'tablet' ) !== false ) {
[2329] Fix | Delete
$transformedAnimations['tablet'] = true;
[2330] Fix | Delete
$transformedAnimations['phone'] = true;
[2331] Fix | Delete
} else if ( ! $transformedAnimations['phone'] && strpos( $key, 'phone' ) !== false ) {
[2332] Fix | Delete
$transformedAnimations['phone'] = true;
[2333] Fix | Delete
}
[2334] Fix | Delete
[2335] Fix | Delete
if ( $transformedAnimations['desktop'] && $transformedAnimations['tablet'] && $transformedAnimations['phone'] ) {
[2336] Fix | Delete
break;
[2337] Fix | Delete
}
[2338] Fix | Delete
}
[2339] Fix | Delete
}
[2340] Fix | Delete
}
[2341] Fix | Delete
}
[2342] Fix | Delete
[2343] Fix | Delete
$module_class = ET_Builder_Element::get_module_order_class( $render_slug );
[2344] Fix | Delete
[2345] Fix | Delete
if ( $module_class ) {
[2346] Fix | Delete
// Desktop animation data.
[2347] Fix | Delete
$animation_data = array(
[2348] Fix | Delete
'class' => esc_attr( trim( $module_class ) ),
[2349] Fix | Delete
'style' => esc_html( $animation_style ),
[2350] Fix | Delete
'repeat' => esc_html( $animation_repeat ),
[2351] Fix | Delete
'duration' => esc_html( $animation_duration ),
[2352] Fix | Delete
'delay' => esc_html( $animation_delay ),
[2353] Fix | Delete
'intensity' => esc_html( $animation_intensity ),
[2354] Fix | Delete
'starting_opacity' => esc_html( $animation_starting_opacity ),
[2355] Fix | Delete
'speed_curve' => esc_html( $animation_speed_curve ),
[2356] Fix | Delete
);
[2357] Fix | Delete
[2358] Fix | Delete
// Being save to generate Tablet & Phone data attributes. As default, tablet
[2359] Fix | Delete
// default value will inherit desktop value and phone default value will inherit
[2360] Fix | Delete
// tablet value. Ensure to pass the value only if it's different compared to
[2361] Fix | Delete
// desktop value to avoid duplicate values.
[2362] Fix | Delete
$animation_attributes = array(
[2363] Fix | Delete
'repeat' => 'animation_repeat',
[2364] Fix | Delete
'duration' => 'animation_duration',
[2365] Fix | Delete
'delay' => 'animation_delay',
[2366] Fix | Delete
'intensity' => "animation_intensity_{$animation_style_responsive}",
[2367] Fix | Delete
'starting_opacity' => 'animation_starting_opacity',
[2368] Fix | Delete
'speed_curve' => 'animation_speed_curve',
[2369] Fix | Delete
);
[2370] Fix | Delete
[2371] Fix | Delete
foreach ( $animation_attributes as $animation_key => $animation_attribute ) {
[2372] Fix | Delete
$animation_attribute_tablet = '';
[2373] Fix | Delete
$animation_attribute_phone = '';
[2374] Fix | Delete
[2375] Fix | Delete
// Ensure responsive status for current attribute is activated.
[2376] Fix | Delete
if ( ! et_pb_responsive_options()->is_responsive_enabled( $this->props, $animation_attribute ) ) {
[2377] Fix | Delete
continue;
[2378] Fix | Delete
}
[2379] Fix | Delete
[2380] Fix | Delete
// Tablet animation value.
[2381] Fix | Delete
$animation_attribute_tablet = et_pb_responsive_options()->get_any_value( $this->props, "{$animation_attribute}_tablet", $animation_data[ $animation_key ] );
[2382] Fix | Delete
if ( ! empty( $animation_attribute_tablet ) ) {
[2383] Fix | Delete
$animation_data["{$animation_key}_tablet"] = $animation_attribute_tablet;
[2384] Fix | Delete
}
[2385] Fix | Delete
[2386] Fix | Delete
// Phone animation value.
[2387] Fix | Delete
$animation_attribute_phone = et_pb_responsive_options()->get_any_value( $this->props, "{$animation_attribute}_phone", $animation_data[ $animation_key ] );
[2388] Fix | Delete
if ( ! empty( $animation_attribute_phone ) ) {
[2389] Fix | Delete
$animation_data["{$animation_key}_phone"] = $animation_attribute_phone;
[2390] Fix | Delete
}
[2391] Fix | Delete
}
[2392] Fix | Delete
[2393] Fix | Delete
// Animation style is little bit different. We need to check the direction to get
[2394] Fix | Delete
// the correct style. We need to ensure the direction is valid, then add it as
[2395] Fix | Delete
// suffix for the animation style.
[2396] Fix | Delete
if ( et_pb_responsive_options()->is_responsive_enabled( $this->props, 'animation_direction' ) ) {
[2397] Fix | Delete
// Tablet animation style.
[2398] Fix | Delete
if ( ! empty( $animation_direction_tablet ) ) {
[2399] Fix | Delete
$animation_style_tablet_suffix = in_array( $animation_direction_tablet, $directions_list ) ? ucfirst( $animation_direction_tablet ) : '';
[2400] Fix | Delete
$animation_data['style_tablet'] = $animation_style_tablet . $animation_style_tablet_suffix;
[2401] Fix | Delete
}
[2402] Fix | Delete
[2403] Fix | Delete
// Phone animation style.
[2404] Fix | Delete
if ( ! empty( $animation_direction_phone ) ) {
[2405] Fix | Delete
$animation_style_phone_suffix = in_array( $animation_direction_phone, $directions_list ) ? ucfirst( $animation_direction_phone ) : '';
[2406] Fix | Delete
$animation_data['style_phone'] = $animation_style_phone . $animation_style_phone_suffix;
[2407] Fix | Delete
} else if ( ! empty( $animation_data['style_tablet'] ) ) {
[2408] Fix | Delete
$animation_data['style_phone'] = $animation_data['style_tablet'];
[2409] Fix | Delete
}
[2410] Fix | Delete
}
[2411] Fix | Delete
[2412] Fix | Delete
// overwrite animation name to match the custom animation generated on transforms options processing.
[2413] Fix | Delete
if ( $transformedAnimations['desktop'] ) {
[2414] Fix | Delete
$animation_data['style'] = 'transformAnim';
[2415] Fix | Delete
}
[2416] Fix | Delete
if ( $transformedAnimations['tablet'] ) {
[2417] Fix | Delete
$animation_data['style_tablet'] = 'transformAnim';
[2418] Fix | Delete
}
[2419] Fix | Delete
if ( $transformedAnimations['phone'] ) {
[2420] Fix | Delete
$animation_data['style_phone'] = 'transformAnim';
[2421] Fix | Delete
}
[2422] Fix | Delete
[2423] Fix | Delete
et_builder_handle_animation_data( $animation_data );
[2424] Fix | Delete
}
[2425] Fix | Delete
[2426] Fix | Delete
// Try to apply old method for plugins without vb support
[2427] Fix | Delete
if ( ! $et_fb_processing_shortcode_object && 'on' !== $this->vb_support ) {
[2428] Fix | Delete
add_filter( "{$render_slug}_shortcode_output", array( $this, 'add_et_animated_class' ), 10, 2 );
[2429] Fix | Delete
}
[2430] Fix | Delete
[2431] Fix | Delete
// Only print et_animated on front-end. Avoid adding it on computed callback of post slider(s)
[2432] Fix | Delete
// and modules because it'll cause the module to be visually hidden
[2433] Fix | Delete
if ( ! et_core_is_fb_enabled() ) {
[2434] Fix | Delete
$this->add_classname( 'et_animated' );
[2435] Fix | Delete
}
[2436] Fix | Delete
}
[2437] Fix | Delete
[2438] Fix | Delete
// Add "et_hover_enabled" class to elements that have at least one hover prop enabled
[2439] Fix | Delete
if ( et_has_hover_enabled( $this->props ) ) {
[2440] Fix | Delete
$this->add_classname( 'et_hover_enabled' );
[2441] Fix | Delete
}
[2442] Fix | Delete
[2443] Fix | Delete
// Setup link options
[2444] Fix | Delete
$link_option_url = isset( $this->props['link_option_url'] ) ? $this->props['link_option_url'] : '';
[2445] Fix | Delete
$link_option_url_new_window = isset( $this->props['link_option_url_new_window'] ) ? $this->props['link_option_url_new_window'] : false;
[2446] Fix | Delete
[2447] Fix | Delete
if ( '' !== $link_option_url ) {
[2448] Fix | Delete
$module_class = ET_Builder_Element::get_module_order_class( $render_slug );
[2449] Fix | Delete
[2450] Fix | Delete
if ( $module_class ) {
[2451] Fix | Delete
et_builder_handle_link_options_data( array(
[2452] Fix | Delete
'class' => trim( $module_class ),
[2453] Fix | Delete
'url' => esc_url_raw( $link_option_url ),
[2454] Fix | Delete
'target' => 'on' === $link_option_url_new_window ? '_blank' : '_self',
[2455] Fix | Delete
) );
[2456] Fix | Delete
}
[2457] Fix | Delete
[2458] Fix | Delete
$this->add_classname( 'et_clickable' );
[2459] Fix | Delete
}
[2460] Fix | Delete
[2461] Fix | Delete
// Hide module on specific screens if needed
[2462] Fix | Delete
if ( isset( $this->props['disabled_on'] ) && '' !== $this->props['disabled_on'] ) {
[2463] Fix | Delete
$disabled_on_array = explode( '|', $this->props['disabled_on'] );
[2464] Fix | Delete
$i = 0;
[2465] Fix | Delete
$current_media_query = 'max_width_767';
[2466] Fix | Delete
[2467] Fix | Delete
foreach( $disabled_on_array as $value ) {
[2468] Fix | Delete
if ( 'on' === $value ) {
[2469] Fix | Delete
// Added specific declaration to fix the problem when
[2470] Fix | Delete
// Video module is hidden for desktop the fullscreen
[2471] Fix | Delete
// won't work on mobile screen size.
[2472] Fix | Delete
$declaration = 'et_pb_video' === $render_slug ? 'height: 0; padding: 0; overflow: hidden;' : 'display: none !important;';
[2473] Fix | Delete
ET_Builder_Module::set_style( $render_slug, array(
[2474] Fix | Delete
'selector' => '%%order_class%%',
[2475] Fix | Delete
'declaration' => $declaration,
[2476] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( $current_media_query ),
[2477] Fix | Delete
) );
[2478] Fix | Delete
}
[2479] Fix | Delete
$i++;
[2480] Fix | Delete
$current_media_query = 1 === $i ? '768_980' : 'min_width_981';
[2481] Fix | Delete
}
[2482] Fix | Delete
}
[2483] Fix | Delete
[2484] Fix | Delete
if ( ! $et_fb_processing_shortcode_object ) {
[2485] Fix | Delete
if ( 'et_pb_section' === $render_slug ) {
[2486] Fix | Delete
$et_pb_current_parent_type = isset( $this->props['specialty'] ) && 'on' === $this->props['specialty'] ? 'et_pb_specialty_section' : 'et_pb_section';
[2487] Fix | Delete
$et_pb_parent_section_type = $et_pb_current_parent_type;
[2488] Fix | Delete
} else if ( 'et_pb_specialty_section' === $et_pb_current_parent_type && 'et_pb_column' === $render_slug ) {
[2489] Fix | Delete
$et_pb_current_parent_type = 'et_pb_specialty_column';
[2490] Fix | Delete
}
[2491] Fix | Delete
[2492] Fix | Delete
// Make sure content of Specialty Section is valid and has correct structure. Fix inner shortcode tags if needed.
[2493] Fix | Delete
if ( 'et_pb_specialty_section' === $et_pb_current_parent_type ) {
[2494] Fix | Delete
$content = $this->et_pb_maybe_fix_specialty_columns( $content );
[2495] Fix | Delete
}
[2496] Fix | Delete
}
[2497] Fix | Delete
[2498] Fix | Delete
$this->is_rendering = true;
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function