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: functions.php
),
[10500] Fix | Delete
),
[10501] Fix | Delete
) );
[10502] Fix | Delete
[10503] Fix | Delete
// Filter shortcuts
[10504] Fix | Delete
$filtered_shortcuts = array();
[10505] Fix | Delete
[10506] Fix | Delete
foreach ($shortcuts as $group_key => $group) {
[10507] Fix | Delete
foreach ($group as $shortcut_key => $shortcut) {
[10508] Fix | Delete
if ( in_array( $on, $shortcut['on'] ) ) {
[10509] Fix | Delete
$filtered_shortcuts[ $group_key ][ $shortcut_key ] = $shortcut;
[10510] Fix | Delete
}
[10511] Fix | Delete
}
[10512] Fix | Delete
}
[10513] Fix | Delete
[10514] Fix | Delete
return $filtered_shortcuts;
[10515] Fix | Delete
}
[10516] Fix | Delete
endif;
[10517] Fix | Delete
[10518] Fix | Delete
/**
[10519] Fix | Delete
* Parsed *_last_edited value and determine wheter the passed string means it has responsive value or not
[10520] Fix | Delete
* *_last_edited holds two values (responsive status and last opened tabs) in the following format: status|last_opened_tab
[10521] Fix | Delete
* @param string last_edited data
[10522] Fix | Delete
* @return bool
[10523] Fix | Delete
*/
[10524] Fix | Delete
if ( ! function_exists( 'et_pb_get_responsive_status' ) ) :
[10525] Fix | Delete
function et_pb_get_responsive_status( $last_edited ) {
[10526] Fix | Delete
$parsed_last_edited = is_string( $last_edited ) ? explode( '|', $last_edited ) : array( 'off', 'desktop' );
[10527] Fix | Delete
[10528] Fix | Delete
return isset( $parsed_last_edited[0] ) ? $parsed_last_edited[0] === 'on' : false;
[10529] Fix | Delete
}
[10530] Fix | Delete
endif;
[10531] Fix | Delete
[10532] Fix | Delete
/**
[10533] Fix | Delete
* Get unit of given value
[10534] Fix | Delete
* @param string string with unit
[10535] Fix | Delete
* @return string unit name
[10536] Fix | Delete
*/
[10537] Fix | Delete
if ( ! function_exists( 'et_pb_get_value_unit' ) ) :
[10538] Fix | Delete
function et_pb_get_value_unit( $value, $default_unit = 'px' ) {
[10539] Fix | Delete
$value = isset( $value ) ? $value : '';
[10540] Fix | Delete
$valid_one_char_units = array( "%", 'x' );
[10541] Fix | Delete
$valid_two_chars_units = array( "em", "px", "cm", "mm", "in", "pt", "pc", "ex", "vh", "vw", "ms" );
[10542] Fix | Delete
$valid_three_chars_units = array( 'deg', 'rem' );
[10543] Fix | Delete
$important = "!important";
[10544] Fix | Delete
$important_length = strlen( $important );
[10545] Fix | Delete
$value_length = strlen( $value );
[10546] Fix | Delete
[10547] Fix | Delete
if ( $value === '' || is_numeric( $value ) ) {
[10548] Fix | Delete
return $default_unit;
[10549] Fix | Delete
}
[10550] Fix | Delete
[10551] Fix | Delete
if ( substr( $value, ( 0 - $important_length ), $important_length ) === $important ) {
[10552] Fix | Delete
$value_length = $value_length - $important_length;
[10553] Fix | Delete
$value = substr( $value, 0, $value_length ).trim();
[10554] Fix | Delete
}
[10555] Fix | Delete
[10556] Fix | Delete
if ( in_array( substr( $value, -3, 3 ), $valid_three_chars_units ) ) {
[10557] Fix | Delete
return substr( $value, -3, 3 );
[10558] Fix | Delete
}
[10559] Fix | Delete
[10560] Fix | Delete
if ( in_array( substr( $value, -2, 2 ), $valid_two_chars_units ) ) {
[10561] Fix | Delete
return substr( $value, -2, 2 );
[10562] Fix | Delete
}
[10563] Fix | Delete
[10564] Fix | Delete
if ( in_array( substr( $value, -1, 1 ), $valid_one_char_units ) ) {
[10565] Fix | Delete
return substr( $value, -1, 1 );
[10566] Fix | Delete
}
[10567] Fix | Delete
[10568] Fix | Delete
return $default_unit;
[10569] Fix | Delete
}
[10570] Fix | Delete
endif;
[10571] Fix | Delete
[10572] Fix | Delete
/**
[10573] Fix | Delete
* Sanitized value and its unit
[10574] Fix | Delete
* @param mixed
[10575] Fix | Delete
* @param string
[10576] Fix | Delete
* @param string|bool
[10577] Fix | Delete
*
[10578] Fix | Delete
* @return string sanitized input and its unit
[10579] Fix | Delete
*/
[10580] Fix | Delete
if ( ! function_exists( 'et_sanitize_input_unit' ) ) :
[10581] Fix | Delete
function et_sanitize_input_unit( $value = '', $auto_important = false, $default_unit = false ) {
[10582] Fix | Delete
$value = (string) $value;
[10583] Fix | Delete
$valid_one_char_units = array( '%', 'x' );
[10584] Fix | Delete
$valid_two_chars_units = array( 'em', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw', 'ms' );
[10585] Fix | Delete
$valid_three_chars_units = array( 'deg', 'rem' );
[10586] Fix | Delete
$important = '!important';
[10587] Fix | Delete
$important_length = strlen( $important );
[10588] Fix | Delete
$has_important = false;
[10589] Fix | Delete
$value_length = strlen( $value );
[10590] Fix | Delete
$unit_value;
[10591] Fix | Delete
[10592] Fix | Delete
// Check for important
[10593] Fix | Delete
if ( substr( $value, ( 0 - $important_length ), $important_length ) === $important ) {
[10594] Fix | Delete
$has_important = true;
[10595] Fix | Delete
$value_length = $value_length - $important_length;
[10596] Fix | Delete
$value = trim( substr( $value, 0, $value_length ) );
[10597] Fix | Delete
}
[10598] Fix | Delete
[10599] Fix | Delete
if ( in_array( substr( $value, -3, 3 ), $valid_three_chars_units ) ) {
[10600] Fix | Delete
$unit_value = floatval( $value ) . substr( $value, -3, 3 );
[10601] Fix | Delete
[10602] Fix | Delete
// Re-add !important tag
[10603] Fix | Delete
if ( $has_important && ! $auto_important ) {
[10604] Fix | Delete
$unit_value = $unit_value . ' ' . $important;
[10605] Fix | Delete
}
[10606] Fix | Delete
[10607] Fix | Delete
return $unit_value;
[10608] Fix | Delete
}
[10609] Fix | Delete
[10610] Fix | Delete
if ( in_array( substr( $value, -2, 2 ), $valid_two_chars_units ) ) {
[10611] Fix | Delete
$unit_value = floatval( $value ) . substr( $value, -2, 2 );
[10612] Fix | Delete
[10613] Fix | Delete
// Re-add !important tag
[10614] Fix | Delete
if ( $has_important && ! $auto_important ) {
[10615] Fix | Delete
$unit_value = $unit_value . ' ' . $important;
[10616] Fix | Delete
}
[10617] Fix | Delete
[10618] Fix | Delete
return $unit_value;
[10619] Fix | Delete
}
[10620] Fix | Delete
[10621] Fix | Delete
if ( in_array( substr( $value, -1, 1 ), $valid_one_char_units ) ) {
[10622] Fix | Delete
$unit_value = floatval( $value ) . substr( $value, -1, 1 );
[10623] Fix | Delete
[10624] Fix | Delete
// Re-add !important tag
[10625] Fix | Delete
if ( $has_important && ! $auto_important ) {
[10626] Fix | Delete
$unit_value = $unit_value . ' ' . $important;
[10627] Fix | Delete
}
[10628] Fix | Delete
[10629] Fix | Delete
return $unit_value;
[10630] Fix | Delete
}
[10631] Fix | Delete
[10632] Fix | Delete
$result = floatval( $value );
[10633] Fix | Delete
[10634] Fix | Delete
if ( 'no_default_unit' === $default_unit ) {
[10635] Fix | Delete
return $result;
[10636] Fix | Delete
}
[10637] Fix | Delete
[10638] Fix | Delete
if ( $default_unit ) {
[10639] Fix | Delete
return $result . $default_unit;
[10640] Fix | Delete
}
[10641] Fix | Delete
[10642] Fix | Delete
if ( ! $default_unit ) {
[10643] Fix | Delete
$result .= 'px';
[10644] Fix | Delete
}
[10645] Fix | Delete
[10646] Fix | Delete
// Return and automatically append px (default value)
[10647] Fix | Delete
return $result;
[10648] Fix | Delete
}
[10649] Fix | Delete
endif;
[10650] Fix | Delete
[10651] Fix | Delete
/**
[10652] Fix | Delete
* Get taxonomies for modules
[10653] Fix | Delete
*
[10654] Fix | Delete
* @return array Array of WP taxonomies splitted into the taxonomy types
[10655] Fix | Delete
*/
[10656] Fix | Delete
if ( ! function_exists( 'et_builder_get_taxonomies' ) ) :
[10657] Fix | Delete
function et_builder_get_shop_categories( $args = array() ) {
[10658] Fix | Delete
$defaults = apply_filters( 'et_builder_include_categories_shop_defaults', array (
[10659] Fix | Delete
'use_terms' => true,
[10660] Fix | Delete
'term_name' => 'product_cat',
[10661] Fix | Delete
) );
[10662] Fix | Delete
[10663] Fix | Delete
$term_args = apply_filters( 'et_builder_include_categories_shop_args', array( 'hide_empty' => false, ) );
[10664] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[10665] Fix | Delete
$product_categories = $args['use_terms'] ? get_terms( $args['term_name'], $term_args ) : get_categories( apply_filters( 'et_builder_get_categories_shop_args', 'hide_empty=0' ) );
[10666] Fix | Delete
[10667] Fix | Delete
return $product_categories;
[10668] Fix | Delete
}
[10669] Fix | Delete
endif;
[10670] Fix | Delete
[10671] Fix | Delete
if ( ! function_exists( 'et_pb_get_spacing' ) ):
[10672] Fix | Delete
function et_pb_get_spacing( $spacing, $corner, $default = '0px' ) {
[10673] Fix | Delete
$corners = array( 'top', 'right', 'bottom', 'left' );
[10674] Fix | Delete
$corner_index = array_search( $corner, $corners );
[10675] Fix | Delete
$spacing_array = explode( '|', $spacing );
[10676] Fix | Delete
[10677] Fix | Delete
return isset( $spacing_array[ $corner_index ] ) && '' !== $spacing_array[ $corner_index ] ? $spacing_array[ $corner_index ] : $default;
[10678] Fix | Delete
}
[10679] Fix | Delete
endif;
[10680] Fix | Delete
[10681] Fix | Delete
/**
[10682] Fix | Delete
* Enqueue a bundle
[10683] Fix | Delete
*/
[10684] Fix | Delete
[10685] Fix | Delete
if ( ! function_exists( 'et_fb_enqueue_bundle' ) ) :
[10686] Fix | Delete
function et_fb_enqueue_bundle( $id, $resource, $deps, $ver = false ) {
[10687] Fix | Delete
$DEBUG = defined( 'ET_DEBUG' ) && ET_DEBUG;
[10688] Fix | Delete
$ver = false === $ver ? ET_BUILDER_VERSION : $ver;
[10689] Fix | Delete
$build = 'frontend-builder/build';
[10690] Fix | Delete
$bundle = sprintf( '%s/%s/%s', ET_BUILDER_URI, $build, $resource );
[10691] Fix | Delete
$type = pathinfo( $resource, PATHINFO_EXTENSION );
[10692] Fix | Delete
[10693] Fix | Delete
switch ( $type ) {
[10694] Fix | Delete
case 'css':
[10695] Fix | Delete
if ( file_exists( sprintf( '%s%s/%s', ET_BUILDER_DIR, $build, $resource ) ) || ! $DEBUG ) {
[10696] Fix | Delete
wp_enqueue_style( $id, $bundle, $deps, $ver );
[10697] Fix | Delete
} elseif ( $DEBUG ) {
[10698] Fix | Delete
// Style is already embedded in the bundle but we still need to enqueue its deps.
[10699] Fix | Delete
foreach ( $deps as $dep ) {
[10700] Fix | Delete
wp_enqueue_style( $dep );
[10701] Fix | Delete
}
[10702] Fix | Delete
}
[10703] Fix | Delete
break;
[10704] Fix | Delete
case 'js':
[10705] Fix | Delete
if ( file_exists( sprintf( '%s%s/%s', ET_BUILDER_DIR, $build, $resource ) ) || ! $DEBUG ) {
[10706] Fix | Delete
// If the file exists on disk, enqueue it
[10707] Fix | Delete
wp_enqueue_script( $id, $bundle, $deps, $ver, true );
[10708] Fix | Delete
} else {
[10709] Fix | Delete
// Otherwise load `hot` from webpack-dev-server
[10710] Fix | Delete
$site_url = wp_parse_url( get_site_url() );
[10711] Fix | Delete
$hot_bundle_url = "{$site_url['scheme']}://{$site_url['host']}:31495/$resource";
[10712] Fix | Delete
[10713] Fix | Delete
wp_enqueue_script( $id, $hot_bundle_url, $deps, $ver, true );
[10714] Fix | Delete
}
[10715] Fix | Delete
wp_add_inline_script( $id, 'window.et_gb = (window.top && window.top.Cypress && window.parent === window.top && window) || (window.top && window.top.Cypress && window.parent !== window.top && window.parent) || window.top || window;', 'before' );
[10716] Fix | Delete
break;
[10717] Fix | Delete
}
[10718] Fix | Delete
}
[10719] Fix | Delete
endif;
[10720] Fix | Delete
[10721] Fix | Delete
/**
[10722] Fix | Delete
* Get list of all active plugins (single, network active, and mu)
[10723] Fix | Delete
*
[10724] Fix | Delete
* @return array active plugins
[10725] Fix | Delete
*/
[10726] Fix | Delete
if ( ! function_exists( 'et_builder_get_active_plugins' ) ):
[10727] Fix | Delete
function et_builder_get_active_plugins() {
[10728] Fix | Delete
$active_plugins = get_option( 'active_plugins' );
[10729] Fix | Delete
[10730] Fix | Delete
// Returned format must be array
[10731] Fix | Delete
if ( ! is_array( $active_plugins ) ) {
[10732] Fix | Delete
$active_plugins = array();
[10733] Fix | Delete
}
[10734] Fix | Delete
[10735] Fix | Delete
// Get mu-plugins (must-use)
[10736] Fix | Delete
// mu-plugins data is returned in array( "plugin/name.php" => array( 'data' => 'value' ) ) format.
[10737] Fix | Delete
$mu_plugins = get_mu_plugins();
[10738] Fix | Delete
if ( is_array( $mu_plugins ) ) {
[10739] Fix | Delete
$active_plugins = array_merge( $active_plugins, array_keys( $mu_plugins ) );
[10740] Fix | Delete
}
[10741] Fix | Delete
[10742] Fix | Delete
// Get network active plugins
[10743] Fix | Delete
// Network active plugin data is returned in array( "plugin/name.php" => active_timestamp_int format.
[10744] Fix | Delete
if ( is_multisite() ) {
[10745] Fix | Delete
$network_active_plugins = get_site_option( 'active_sitewide_plugins' );
[10746] Fix | Delete
[10747] Fix | Delete
if ( is_array( $network_active_plugins ) ) {
[10748] Fix | Delete
$active_plugins = array_merge( $active_plugins, array_keys( $network_active_plugins ) );
[10749] Fix | Delete
}
[10750] Fix | Delete
}
[10751] Fix | Delete
[10752] Fix | Delete
return apply_filters( 'et_builder_get_active_plugins', $active_plugins );
[10753] Fix | Delete
}
[10754] Fix | Delete
endif;
[10755] Fix | Delete
[10756] Fix | Delete
if ( ! function_exists( 'et_has_hover_enabled' ) ) :
[10757] Fix | Delete
function et_has_hover_enabled( $props ) {
[10758] Fix | Delete
$et_has_hover_enabled = false;
[10759] Fix | Delete
$prop_names = array_keys( $props );
[10760] Fix | Delete
$suffix = et_pb_hover_options()->get_enabled_suffix();
[10761] Fix | Delete
foreach ( $prop_names as $prop_name ) {
[10762] Fix | Delete
if ( preg_match( "~{$suffix}$~", $prop_name ) && 'on' === $props[ $prop_name ] ) {
[10763] Fix | Delete
$et_has_hover_enabled = true;
[10764] Fix | Delete
break;
[10765] Fix | Delete
}
[10766] Fix | Delete
}
[10767] Fix | Delete
return $et_has_hover_enabled;
[10768] Fix | Delete
}
[10769] Fix | Delete
endif;
[10770] Fix | Delete
[10771] Fix | Delete
if ( ! function_exists( 'et_builder_is_hover_enabled' ) ) :
[10772] Fix | Delete
function et_builder_is_hover_enabled( $setting, $props ) {
[10773] Fix | Delete
return et_pb_hover_options()->is_enabled( $setting, $props );
[10774] Fix | Delete
}
[10775] Fix | Delete
endif;
[10776] Fix | Delete
[10777] Fix | Delete
if ( ! function_exists( 'et_builder_add_prefix' ) ) {
[10778] Fix | Delete
/**
[10779] Fix | Delete
* Prefixes a string key with a prefix string using the provided delimiter
[10780] Fix | Delete
* In case the prefix is empty, original key is returned
[10781] Fix | Delete
*
[10782] Fix | Delete
* @param string $prefix
[10783] Fix | Delete
* @param string $key
[10784] Fix | Delete
* @param string $delimiter
[10785] Fix | Delete
*
[10786] Fix | Delete
* @return string
[10787] Fix | Delete
*/
[10788] Fix | Delete
function et_builder_add_prefix( $prefix, $key, $delimiter = '_' ) {
[10789] Fix | Delete
return $prefix === '' ? $key : $prefix . $delimiter . $key;
[10790] Fix | Delete
}
[10791] Fix | Delete
}
[10792] Fix | Delete
[10793] Fix | Delete
if ( ! function_exists( 'et_builder_has_value' ) ) {
[10794] Fix | Delete
/**
[10795] Fix | Delete
* Check if value is not an empty value
[10796] Fix | Delete
* Empty values are considered:
[10797] Fix | Delete
* - null
[10798] Fix | Delete
* - ''
[10799] Fix | Delete
* - false
[10800] Fix | Delete
*
[10801] Fix | Delete
* @param $value
[10802] Fix | Delete
*
[10803] Fix | Delete
* @return bool
[10804] Fix | Delete
*/
[10805] Fix | Delete
function et_builder_has_value( $value ) {
[10806] Fix | Delete
return null !== $value && '' !== $value && false !== $value;
[10807] Fix | Delete
}
[10808] Fix | Delete
}
[10809] Fix | Delete
[10810] Fix | Delete
if ( ! function_exists( 'et_builder_get_or' ) ) {
[10811] Fix | Delete
/**
[10812] Fix | Delete
* Returns the value in case it is not empty
[10813] Fix | Delete
* Otherwise, return the default value
[10814] Fix | Delete
*
[10815] Fix | Delete
* @param $value
[10816] Fix | Delete
* @param string $default
[10817] Fix | Delete
*
[10818] Fix | Delete
* @return string
[10819] Fix | Delete
*/
[10820] Fix | Delete
function et_builder_get_or( $value, $default = '' ) {
[10821] Fix | Delete
return et_builder_has_value( $value ) ? $value : $default;
[10822] Fix | Delete
}
[10823] Fix | Delete
}
[10824] Fix | Delete
[10825] Fix | Delete
if ( ! function_exists( 'et_builder_module_prop' ) ) {
[10826] Fix | Delete
/**
[10827] Fix | Delete
* Returns props value by provided key, if the value is empty, returns the default value
[10828] Fix | Delete
*
[10829] Fix | Delete
* @param string $prop
[10830] Fix | Delete
* @param array $props
[10831] Fix | Delete
* @param mixed $default
[10832] Fix | Delete
*
[10833] Fix | Delete
* @return mixed|null
[10834] Fix | Delete
*/
[10835] Fix | Delete
function et_builder_module_prop( $prop, $props, $default ) {
[10836] Fix | Delete
return et_builder_get_or( et_()->array_get( $props, $prop ), $default );
[10837] Fix | Delete
}
[10838] Fix | Delete
}
[10839] Fix | Delete
[10840] Fix | Delete
if ( ! function_exists( 'et_pb_get_column_svg' ) ) {
[10841] Fix | Delete
/**
[10842] Fix | Delete
* Returns svg which represents the requried columns type
[10843] Fix | Delete
*
[10844] Fix | Delete
* @param string $type
[10845] Fix | Delete
*
[10846] Fix | Delete
* @return string svg code.
[10847] Fix | Delete
*/
[10848] Fix | Delete
function et_pb_get_column_svg( $type ) {
[10849] Fix | Delete
$svg = '';
[10850] Fix | Delete
[10851] Fix | Delete
switch ( $type ) {
[10852] Fix | Delete
case '4_4':
[10853] Fix | Delete
$svg = '<rect width="100%" height="20" y="5" rx="5" ry="5" />';
[10854] Fix | Delete
break;
[10855] Fix | Delete
case '1_2,1_2':
[10856] Fix | Delete
$svg = '<rect width="48.5%" height="20" y="5" rx="5" ry="5" />
[10857] Fix | Delete
<rect width="48.5%" height="20" y="5" rx="5" ry="5" x="51.5%" />';
[10858] Fix | Delete
break;
[10859] Fix | Delete
case '1_3,1_3,1_3':
[10860] Fix | Delete
$svg = '<rect width="31.3%" height="20" y="5" rx="5" ry="5" />
[10861] Fix | Delete
<rect width="31.3%" height="20" y="5" rx="5" ry="5" x="34.3%" />
[10862] Fix | Delete
<rect width="31.3%" height="20" y="5" rx="5" ry="5" x="68.6%" />';
[10863] Fix | Delete
break;
[10864] Fix | Delete
case '1_4,1_4,1_4,1_4':
[10865] Fix | Delete
$svg = '<rect width="22.75%" height="20" y="5" rx="5" ry="5" />
[10866] Fix | Delete
<rect width="22.75%" height="20" y="5" rx="5" ry="5" x="25.75%" />
[10867] Fix | Delete
<rect width="22.75%" height="20" y="5" rx="5" ry="5" x="51.5%" />
[10868] Fix | Delete
<rect width="22.75%" height="20" y="5" rx="5" ry="5" x="77.25%" />';
[10869] Fix | Delete
break;
[10870] Fix | Delete
case '1_5,1_5,1_5,1_5,1_5':
[10871] Fix | Delete
$svg = '<rect width="17.6%" height="20" y="5" rx="5" ry="5" />
[10872] Fix | Delete
<rect width="17.6%" height="20" y="5" rx="5" ry="5" x="20.6%" />
[10873] Fix | Delete
<rect width="17.6%" height="20" y="5" rx="5" ry="5" x="41.2%" />
[10874] Fix | Delete
<rect width="17.6%" height="20" y="5" rx="5" ry="5" x="61.8%" />
[10875] Fix | Delete
<rect width="17.6%" height="20" y="5" rx="5" ry="5" x="82.4%" />';
[10876] Fix | Delete
break;
[10877] Fix | Delete
case '1_6,1_6,1_6,1_6,1_6,1_6':
[10878] Fix | Delete
$svg = '<rect width="14.16%" height="20" y="5" rx="5" ry="5" />
[10879] Fix | Delete
<rect width="14.16%" height="20" y="5" rx="5" ry="5" x="17.16%" />
[10880] Fix | Delete
<rect width="14.16%" height="20" y="5" rx="5" ry="5" x="34.32%" />
[10881] Fix | Delete
<rect width="14.16%" height="20" y="5" rx="5" ry="5" x="51.48%" />
[10882] Fix | Delete
<rect width="14.16%" height="20" y="5" rx="5" ry="5" x="68.64%" />
[10883] Fix | Delete
<rect width="14.16%" height="20" y="5" rx="5" ry="5" x="85.8%" />';
[10884] Fix | Delete
break;
[10885] Fix | Delete
case '2_5,3_5' :
[10886] Fix | Delete
$svg = '<rect width="38.5%" height="20" y="5" rx="5" ry="5" />
[10887] Fix | Delete
<rect width="58.5%" height="20" y="5" rx="5" ry="5" x="41.5%" />';
[10888] Fix | Delete
break;
[10889] Fix | Delete
case '3_5,2_5' :
[10890] Fix | Delete
$svg = '<rect width="58.5%" height="20" y="5" rx="5" ry="5" />
[10891] Fix | Delete
<rect width="38.5%" height="20" y="5" rx="5" ry="5" x="61.5%" />';
[10892] Fix | Delete
break;
[10893] Fix | Delete
case '1_3,2_3' :
[10894] Fix | Delete
$svg = '<rect width="31.5%" height="20" y="5" rx="5" ry="5" />
[10895] Fix | Delete
<rect width="65.5%" height="20" y="5" rx="5" ry="5" x="34.5%" />';
[10896] Fix | Delete
break;
[10897] Fix | Delete
case '2_3,1_3' :
[10898] Fix | Delete
$svg = '<rect width="65.5%" height="20" y="5" rx="5" ry="5" />
[10899] Fix | Delete
<rect width="31.5%" height="20" y="5" rx="5" ry="5" x="68.5%" />';
[10900] Fix | Delete
break;
[10901] Fix | Delete
case '1_4,3_4' :
[10902] Fix | Delete
$svg = '<rect width="23.5%" height="20" y="5" rx="5" ry="5" />
[10903] Fix | Delete
<rect width="73.5%" height="20" y="5" rx="5" ry="5" x="26.5%" />';
[10904] Fix | Delete
break;
[10905] Fix | Delete
case '3_4,1_4' :
[10906] Fix | Delete
$svg = '<rect width="73.5%" height="20" y="5" rx="5" ry="5" />
[10907] Fix | Delete
<rect width="23.5%" height="20" y="5" rx="5" ry="5" x="76.5%" />';
[10908] Fix | Delete
break;
[10909] Fix | Delete
case '1_4,1_2,1_4':
[10910] Fix | Delete
$svg = '<rect width="23.5%" height="20" y="5" rx="5" ry="5" />
[10911] Fix | Delete
<rect width="47%" height="20" y="5" rx="5" ry="5" x="26.5%" />
[10912] Fix | Delete
<rect width="23.5%" height="20" y="5" rx="5" ry="5" x="76.5%" />';
[10913] Fix | Delete
break;
[10914] Fix | Delete
case '1_5,3_5,1_5':
[10915] Fix | Delete
$svg = '<rect width="18.5%" height="20" y="5" rx="5" ry="5" />
[10916] Fix | Delete
<rect width="57%" height="20" y="5" rx="5" ry="5" x="21.5%" />
[10917] Fix | Delete
<rect width="18.5%" height="20" y="5" rx="5" ry="5" x="81.5%" />';
[10918] Fix | Delete
break;
[10919] Fix | Delete
case '1_4,1_4,1_2':
[10920] Fix | Delete
$svg = '<rect width="23.5%" height="20" y="5" rx="5" ry="5" />
[10921] Fix | Delete
<rect width="23.5%" height="20" y="5" rx="5" ry="5" x="26.5%" />
[10922] Fix | Delete
<rect width="47%" height="20" y="5" rx="5" ry="5" x="53%" />';
[10923] Fix | Delete
break;
[10924] Fix | Delete
case '1_2,1_4,1_4':
[10925] Fix | Delete
$svg = '<rect width="47%" height="20" y="5" rx="5" ry="5" />
[10926] Fix | Delete
<rect width="23.5%" height="20" y="5" rx="5" ry="5" x="50%" />
[10927] Fix | Delete
<rect width="23.5%" height="20" y="5" rx="5" ry="5" x="76.5%" />';
[10928] Fix | Delete
break;
[10929] Fix | Delete
case '1_5,1_5,3_5':
[10930] Fix | Delete
$svg = '<rect width="18.5%" height="20" y="5" rx="5" ry="5" />
[10931] Fix | Delete
<rect width="18.5%" height="20" y="5" rx="5" ry="5" x="21.5%" />
[10932] Fix | Delete
<rect width="57%" height="20" y="5" rx="5" ry="5" x="43%" />';
[10933] Fix | Delete
break;
[10934] Fix | Delete
case '3_5,1_5,1_5':
[10935] Fix | Delete
$svg = '<rect width="57%" height="20" y="5" rx="5" ry="5" />
[10936] Fix | Delete
<rect width="18.5%" height="20" y="5" rx="5" ry="5" x="60%" />
[10937] Fix | Delete
<rect width="18.5%" height="20" y="5" rx="5" ry="5" x="81.5%" />';
[10938] Fix | Delete
break;
[10939] Fix | Delete
case '1_6,1_6,1_6,1_2':
[10940] Fix | Delete
$svg = '<rect width="14.6%" height="20" y="5" rx="5" ry="5" />
[10941] Fix | Delete
<rect width="14.6%" height="20" y="5" rx="5" ry="5" x="18.1%" />
[10942] Fix | Delete
<rect width="14.6%" height="20" y="5" rx="5" ry="5" x="36.2%" />
[10943] Fix | Delete
<rect width="45.7%" height="20" y="5" rx="5" ry="5" x="54.3%" />';
[10944] Fix | Delete
break;
[10945] Fix | Delete
case '1_2,1_6,1_6,1_6':
[10946] Fix | Delete
$svg = '<rect width="47%" height="20" y="5" rx="5" ry="5" />
[10947] Fix | Delete
<rect width="14.6%" height="20" y="5" rx="5" ry="5" x="50%" />
[10948] Fix | Delete
<rect width="14.6%" height="20" y="5" rx="5" ry="5" x="67.6%" />
[10949] Fix | Delete
<rect width="14.6%" height="20" y="5" rx="5" ry="5" x="85.2%" />';
[10950] Fix | Delete
break;
[10951] Fix | Delete
}
[10952] Fix | Delete
[10953] Fix | Delete
return $svg;
[10954] Fix | Delete
}
[10955] Fix | Delete
}
[10956] Fix | Delete
[10957] Fix | Delete
/**
[10958] Fix | Delete
* Get image metadata responsive sizes
[10959] Fix | Delete
*
[10960] Fix | Delete
* @since 3.27.3
[10961] Fix | Delete
*
[10962] Fix | Delete
* @param string $image_src The 'src' of the image.
[10963] Fix | Delete
* @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'.
[10964] Fix | Delete
* @param array $size Array of width and height values in pixels (in that order).
[10965] Fix | Delete
*
[10966] Fix | Delete
* @return array|bool
[10967] Fix | Delete
*/
[10968] Fix | Delete
function et_builder_responsive_image_metadata( $image_src, $image_meta = null, $size = null ) {
[10969] Fix | Delete
$cache = ET_Core_Cache_File::get( 'image_responsive_metadata' );
[10970] Fix | Delete
[10971] Fix | Delete
// Normalize image URL.
[10972] Fix | Delete
$normalized_url = et_attachment_normalize_url( $image_src );
[10973] Fix | Delete
[10974] Fix | Delete
if ( isset( $cache[ $normalized_url ] ) ) {
[10975] Fix | Delete
if ( et_core_is_uploads_dir_url( $normalized_url ) ) {
[10976] Fix | Delete
return $cache[ $normalized_url ];
[10977] Fix | Delete
}
[10978] Fix | Delete
[10979] Fix | Delete
unset( $cache[ $normalized_url ] );
[10980] Fix | Delete
ET_Core_Cache_File::set( 'image_responsive_metadata', $cache );
[10981] Fix | Delete
}
[10982] Fix | Delete
[10983] Fix | Delete
$responsive_sizes = array();
[10984] Fix | Delete
[10985] Fix | Delete
$image_id = is_numeric( $image_src ) ? intval( $image_src ) : et_get_attachment_id_by_url( $image_src );
[10986] Fix | Delete
[10987] Fix | Delete
if ( ! $image_id ) {
[10988] Fix | Delete
return array();
[10989] Fix | Delete
}
[10990] Fix | Delete
[10991] Fix | Delete
if ( is_null( $image_meta ) ) {
[10992] Fix | Delete
$image_meta = wp_get_attachment_metadata( $image_id );
[10993] Fix | Delete
}
[10994] Fix | Delete
[10995] Fix | Delete
if ( ! $image_meta || empty( $image_meta['sizes'] ) ) {
[10996] Fix | Delete
return array();
[10997] Fix | Delete
}
[10998] Fix | Delete
[10999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function