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
wp_send_json_error();
[2000] Fix | Delete
}
[2001] Fix | Delete
}
[2002] Fix | Delete
add_action( 'wp_ajax_et_fb_ajax_save', 'et_fb_ajax_save' );
[2003] Fix | Delete
[2004] Fix | Delete
function et_fb_get_shortcode_from_fb_object() {
[2005] Fix | Delete
if ( ! et_core_security_check( 'edit_posts', 'et_fb_convert_to_shortcode_nonce', 'et_fb_convert_to_shortcode_nonce', '_POST', false ) ) {
[2006] Fix | Delete
wp_send_json_error();
[2007] Fix | Delete
}
[2008] Fix | Delete
[2009] Fix | Delete
$shortcode_data = json_decode( stripslashes( $_POST['modules'] ), true );
[2010] Fix | Delete
$layout_type = '';
[2011] Fix | Delete
[2012] Fix | Delete
$post_content = et_fb_process_to_shortcode( $shortcode_data, array(), $layout_type );
[2013] Fix | Delete
[2014] Fix | Delete
// Get rendered post content only if it's needed.
[2015] Fix | Delete
$utils = ET_Core_Data_Utils::instance();
[2016] Fix | Delete
$return_rendered_content = sanitize_text_field( $utils->array_get( $_POST, 'options.return_rendered_content', 'false' ) );
[2017] Fix | Delete
$rendered_post_content = 'true' === $return_rendered_content ? do_shortcode( $post_content ) : '';
[2018] Fix | Delete
[2019] Fix | Delete
wp_send_json_success( array(
[2020] Fix | Delete
'processed_content' => $post_content,
[2021] Fix | Delete
'rendered_content' => $rendered_post_content,
[2022] Fix | Delete
) );
[2023] Fix | Delete
}
[2024] Fix | Delete
[2025] Fix | Delete
add_action( 'wp_ajax_et_fb_get_shortcode_from_fb_object', 'et_fb_get_shortcode_from_fb_object' );
[2026] Fix | Delete
[2027] Fix | Delete
function et_fb_save_layout() {
[2028] Fix | Delete
if ( ! wp_verify_nonce( $_POST['et_fb_save_library_modules_nonce'], 'et_fb_save_library_modules_nonce' ) ){
[2029] Fix | Delete
die( -1 );
[2030] Fix | Delete
}
[2031] Fix | Delete
[2032] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[2033] Fix | Delete
die( -1 );
[2034] Fix | Delete
}
[2035] Fix | Delete
[2036] Fix | Delete
if ( empty( $_POST['et_layout_name'] ) ) {
[2037] Fix | Delete
die( -1 );
[2038] Fix | Delete
}
[2039] Fix | Delete
[2040] Fix | Delete
$post_type = sanitize_text_field( et_()->array_get( $_POST, 'et_post_type', 'page' ) );
[2041] Fix | Delete
[2042] Fix | Delete
if ( et_theme_builder_is_layout_post_type( $post_type ) ) {
[2043] Fix | Delete
// Treat TB layouts as normal posts when storing layouts from the library.
[2044] Fix | Delete
$post_type = 'page';
[2045] Fix | Delete
}
[2046] Fix | Delete
[2047] Fix | Delete
$args = array(
[2048] Fix | Delete
'layout_type' => isset( $_POST['et_layout_type'] ) ? sanitize_text_field( $_POST['et_layout_type'] ) : 'layout',
[2049] Fix | Delete
'layout_selected_cats' => isset( $_POST['et_layout_cats'] ) ? sanitize_text_field( $_POST['et_layout_cats'] ) : '',
[2050] Fix | Delete
'built_for_post_type' => $post_type,
[2051] Fix | Delete
'layout_new_cat' => isset( $_POST['et_layout_new_cat'] ) ? sanitize_text_field( $_POST['et_layout_new_cat'] ) : '',
[2052] Fix | Delete
'columns_layout' => isset( $_POST['et_columns_layout'] ) ? sanitize_text_field( $_POST['et_columns_layout'] ) : '0',
[2053] Fix | Delete
'module_type' => isset( $_POST['et_module_type'] ) ? sanitize_text_field( $_POST['et_module_type'] ) : 'et_pb_unknown',
[2054] Fix | Delete
'layout_scope' => isset( $_POST['et_layout_scope'] ) ? sanitize_text_field( $_POST['et_layout_scope'] ) : 'not_global',
[2055] Fix | Delete
'module_width' => isset( $_POST['et_module_width'] ) ? sanitize_text_field( $_POST['et_module_width'] ) : 'regular',
[2056] Fix | Delete
'layout_content' => isset( $_POST['et_layout_content'] ) ? et_fb_process_to_shortcode( json_decode( stripslashes( $_POST['et_layout_content'] ), true ) ) : '',
[2057] Fix | Delete
'layout_name' => isset( $_POST['et_layout_name'] ) ? sanitize_text_field( $_POST['et_layout_name'] ) : '',
[2058] Fix | Delete
);
[2059] Fix | Delete
[2060] Fix | Delete
$new_layout_meta = et_pb_submit_layout( $args );
[2061] Fix | Delete
die( et_core_esc_previously( $new_layout_meta ) );
[2062] Fix | Delete
}
[2063] Fix | Delete
add_action( 'wp_ajax_et_fb_save_layout', 'et_fb_save_layout' );
[2064] Fix | Delete
[2065] Fix | Delete
function et_fb_prepare_shortcode() {
[2066] Fix | Delete
if ( !isset( $_POST['et_fb_prepare_shortcode_nonce'] ) || !wp_verify_nonce( $_POST['et_fb_prepare_shortcode_nonce'], 'et_fb_prepare_shortcode_nonce' ) ) {
[2067] Fix | Delete
wp_send_json_error();
[2068] Fix | Delete
}
[2069] Fix | Delete
[2070] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[2071] Fix | Delete
die( -1 );
[2072] Fix | Delete
}
[2073] Fix | Delete
[2074] Fix | Delete
$content = isset( $_POST['et_page_content'] ) ? json_decode( stripslashes( $_POST['et_page_content'] ), true ) : '';
[2075] Fix | Delete
$apply_global_presets = isset( $_POST['apply_global_presets'] ) ? wp_validate_boolean( $_POST['apply_global_presets'] ) : false;
[2076] Fix | Delete
[2077] Fix | Delete
$options = array(
[2078] Fix | Delete
'apply_global_presets' => $apply_global_presets,
[2079] Fix | Delete
);
[2080] Fix | Delete
[2081] Fix | Delete
$result = $content ? et_fb_process_to_shortcode( $content, $options, '', false ) : '';
[2082] Fix | Delete
[2083] Fix | Delete
die( json_encode( array( 'shortcode' => $result ) ) );
[2084] Fix | Delete
}
[2085] Fix | Delete
add_action( 'wp_ajax_et_fb_prepare_shortcode', 'et_fb_prepare_shortcode' );
[2086] Fix | Delete
[2087] Fix | Delete
function et_fb_update_layout() {
[2088] Fix | Delete
if ( ! wp_verify_nonce( $_POST['et_fb_save_library_modules_nonce'], 'et_fb_save_library_modules_nonce' ) ) {
[2089] Fix | Delete
die( -1 );
[2090] Fix | Delete
}
[2091] Fix | Delete
[2092] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[2093] Fix | Delete
die( -1 );
[2094] Fix | Delete
}
[2095] Fix | Delete
[2096] Fix | Delete
$post_id = isset( $_POST['et_template_post_id'] ) ? absint( $_POST['et_template_post_id'] ) : '';
[2097] Fix | Delete
[2098] Fix | Delete
if ( ! current_user_can( 'edit_post', $post_id ) ) {
[2099] Fix | Delete
die( -1 );
[2100] Fix | Delete
}
[2101] Fix | Delete
[2102] Fix | Delete
$post_content = json_decode( stripslashes( $_POST['et_layout_content'] ), true );
[2103] Fix | Delete
$new_content = isset( $_POST['et_layout_content'] ) ? et_fb_process_to_shortcode( $post_content ) : '';
[2104] Fix | Delete
$excluded_global_options = isset( $_POST['et_excluded_global_options'] ) ? stripslashes( $_POST['et_excluded_global_options'] ) : array();
[2105] Fix | Delete
$is_saving_global_module = isset( $_POST['et_saving_global_module'] ) ? sanitize_text_field( $_POST['et_saving_global_module'] ) : '';
[2106] Fix | Delete
[2107] Fix | Delete
if ( '' !== $post_id ) {
[2108] Fix | Delete
$update = array(
[2109] Fix | Delete
'ID' => $post_id,
[2110] Fix | Delete
'post_content' => $new_content,
[2111] Fix | Delete
);
[2112] Fix | Delete
[2113] Fix | Delete
$result = wp_update_post( $update );
[2114] Fix | Delete
[2115] Fix | Delete
if ( ! $result || is_wp_error( $result ) ) {
[2116] Fix | Delete
wp_send_json_error();
[2117] Fix | Delete
}
[2118] Fix | Delete
[2119] Fix | Delete
ET_Core_PageResource::remove_static_resources( 'all', 'all' );
[2120] Fix | Delete
[2121] Fix | Delete
// update list of unsynced options for global module
[2122] Fix | Delete
if ( 'true' === $is_saving_global_module ) {
[2123] Fix | Delete
update_post_meta( $post_id, '_et_pb_excluded_global_options', sanitize_text_field( $excluded_global_options ) );
[2124] Fix | Delete
}
[2125] Fix | Delete
}
[2126] Fix | Delete
[2127] Fix | Delete
die();
[2128] Fix | Delete
}
[2129] Fix | Delete
add_action( 'wp_ajax_et_fb_update_layout', 'et_fb_update_layout' );
[2130] Fix | Delete
[2131] Fix | Delete
function et_fb_fetch_attachments() {
[2132] Fix | Delete
et_core_security_check( 'edit_posts', 'et_fb_fetch_attachments', 'et_fb_fetch_attachments' );
[2133] Fix | Delete
[2134] Fix | Delete
$ids = ET_Core_Data_Utils::instance()->array_get( $_POST, 'ids' );
[2135] Fix | Delete
[2136] Fix | Delete
if ( empty( $ids ) ) {
[2137] Fix | Delete
wp_send_json( null );
[2138] Fix | Delete
} else {
[2139] Fix | Delete
$attachments = get_posts( array(
[2140] Fix | Delete
'posts_per_page' => - 1,
[2141] Fix | Delete
'include' => $ids,
[2142] Fix | Delete
'post_type' => 'attachment',
[2143] Fix | Delete
) );
[2144] Fix | Delete
[2145] Fix | Delete
foreach ( $attachments as $index => $attachment ) {
[2146] Fix | Delete
$metadata = array();
[2147] Fix | Delete
[2148] Fix | Delete
foreach ( get_intermediate_image_sizes() as $size ) {
[2149] Fix | Delete
$metadata[ $size ] = wp_get_attachment_image_src( $attachment->ID, $size );
[2150] Fix | Delete
}
[2151] Fix | Delete
[2152] Fix | Delete
$attachments[ $index ] = array_merge( get_object_vars( $attachment ), array(
[2153] Fix | Delete
'metadata' => $metadata,
[2154] Fix | Delete
) );
[2155] Fix | Delete
}
[2156] Fix | Delete
[2157] Fix | Delete
wp_send_json( $attachments );
[2158] Fix | Delete
}
[2159] Fix | Delete
[2160] Fix | Delete
die();
[2161] Fix | Delete
}
[2162] Fix | Delete
[2163] Fix | Delete
add_action( 'wp_ajax_et_fb_fetch_attachments', 'et_fb_fetch_attachments' );
[2164] Fix | Delete
[2165] Fix | Delete
if ( ! function_exists( 'et_fb_disable_product_tour' ) ) :
[2166] Fix | Delete
function et_fb_disable_product_tour() {
[2167] Fix | Delete
do_action( 'et_fb_disable_product_tour' );
[2168] Fix | Delete
[2169] Fix | Delete
if ( ! et_core_security_check_passed( 'edit_posts' ) ) {
[2170] Fix | Delete
ET_Core_Logger::debug( 'Unable to disable product tour. Security check failed!' );
[2171] Fix | Delete
return;
[2172] Fix | Delete
}
[2173] Fix | Delete
[2174] Fix | Delete
$user_id = (int) get_current_user_id();
[2175] Fix | Delete
$all_product_settings = et_get_option( 'product_tour_status', array() );
[2176] Fix | Delete
$all_product_settings[ $user_id ] = 'off';
[2177] Fix | Delete
[2178] Fix | Delete
et_update_option( 'product_tour_status', $all_product_settings );
[2179] Fix | Delete
}
[2180] Fix | Delete
endif;
[2181] Fix | Delete
[2182] Fix | Delete
/**
[2183] Fix | Delete
* Generate output string for `include_categories` option used in backbone template.
[2184] Fix | Delete
* @param array
[2185] Fix | Delete
* @return string
[2186] Fix | Delete
*/
[2187] Fix | Delete
if ( ! function_exists( 'et_builder_include_categories_option' ) ) :
[2188] Fix | Delete
function et_builder_include_categories_option( $args = array(), $default_category = '' ) {
[2189] Fix | Delete
$custom_items = array();
[2190] Fix | Delete
[2191] Fix | Delete
if ( !empty( $args['custom_items'] ) ) {
[2192] Fix | Delete
$custom_items = $args['custom_items'];
[2193] Fix | Delete
unset($args['custom_items']);
[2194] Fix | Delete
}
[2195] Fix | Delete
[2196] Fix | Delete
$defaults = apply_filters( 'et_builder_include_categories_defaults', array (
[2197] Fix | Delete
'use_terms' => true,
[2198] Fix | Delete
'term_name' => 'project_category',
[2199] Fix | Delete
'field_name' => 'et_pb_include_categories',
[2200] Fix | Delete
) );
[2201] Fix | Delete
[2202] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[2203] Fix | Delete
$args['field_name'] = esc_attr( $args['field_name'] );
[2204] Fix | Delete
[2205] Fix | Delete
$term_args = apply_filters( 'et_builder_include_categories_option_args', array( 'hide_empty' => false, ) );
[2206] Fix | Delete
[2207] Fix | Delete
$output = "\t" . "<% var {$args['field_name']}_temp = typeof data !== 'undefined' && typeof data.{$args['field_name']} !== 'undefined' ? data.{$args['field_name']}.split( ',' ) : ['" . esc_html( $default_category ) . "']; {$args['field_name']}_temp = typeof data === 'undefined' && typeof {$args['field_name']} !== 'undefined' ? {$args['field_name']}.split( ',' ) : {$args['field_name']}_temp; %>" . "\n";
[2208] Fix | Delete
[2209] Fix | Delete
if ( $args['use_terms'] ) {
[2210] Fix | Delete
$cats_array = get_terms( $args['term_name'], $term_args );
[2211] Fix | Delete
} else {
[2212] Fix | Delete
$cats_array = get_categories( apply_filters( 'et_builder_get_categories_args', 'hide_empty=0' ) );
[2213] Fix | Delete
}
[2214] Fix | Delete
[2215] Fix | Delete
$cats_array = array_merge( $custom_items, $cats_array );
[2216] Fix | Delete
[2217] Fix | Delete
if ( empty( $cats_array ) ) {
[2218] Fix | Delete
$taxonomy_type = $args['use_terms'] ? $args['term_name'] : 'category';
[2219] Fix | Delete
$taxonomy = get_taxonomy( $taxonomy_type );
[2220] Fix | Delete
$labels = get_taxonomy_labels( $taxonomy );
[2221] Fix | Delete
$output = sprintf( '<p>%1$s</p>', esc_html( $labels->not_found ) );
[2222] Fix | Delete
}
[2223] Fix | Delete
[2224] Fix | Delete
foreach ( $cats_array as $category ) {
[2225] Fix | Delete
$contains = sprintf(
[2226] Fix | Delete
"<%%= _.contains( {$args['field_name']}_temp, '%1\$s' ) ? checked='checked' : '' %%>",
[2227] Fix | Delete
is_array( $category ) ? esc_html( $category['term_id'] ) : esc_html( $category->term_id )
[2228] Fix | Delete
);
[2229] Fix | Delete
[2230] Fix | Delete
$output .= sprintf(
[2231] Fix | Delete
'%4$s<label><input type="checkbox" name="%5$s" value="%1$s"%3$s> %2$s</label><br/>',
[2232] Fix | Delete
is_array( $category ) ? esc_html( $category['term_id'] ) : esc_html( $category->term_id ),
[2233] Fix | Delete
is_array( $category ) ? esc_html( $category['name'] ) : esc_html( $category->name ),
[2234] Fix | Delete
$contains,
[2235] Fix | Delete
"\n\t\t\t\t\t",
[2236] Fix | Delete
$args['field_name']
[2237] Fix | Delete
);
[2238] Fix | Delete
}
[2239] Fix | Delete
[2240] Fix | Delete
$output = "<div id='{$args['field_name']}'>" . $output . '</div>';
[2241] Fix | Delete
[2242] Fix | Delete
return apply_filters( 'et_builder_include_categories_option_html', $output );
[2243] Fix | Delete
}
[2244] Fix | Delete
endif;
[2245] Fix | Delete
[2246] Fix | Delete
/**
[2247] Fix | Delete
* Generate output string for `include_shop_categories` option used in backbone template.
[2248] Fix | Delete
* @param array
[2249] Fix | Delete
* @return string
[2250] Fix | Delete
*/
[2251] Fix | Delete
if ( ! function_exists( 'et_builder_include_categories_shop_option' ) ) :
[2252] Fix | Delete
function et_builder_include_categories_shop_option( $args = array() ) {
[2253] Fix | Delete
if ( ! class_exists( 'WooCommerce' ) ) {
[2254] Fix | Delete
return '';
[2255] Fix | Delete
}
[2256] Fix | Delete
[2257] Fix | Delete
$output = "\t" . "<% var et_pb_include_categories_shop_temp = typeof data !== 'undefined' && typeof data.et_pb_include_categories !== 'undefined' ? data.et_pb_include_categories.split( ',' ) : []; et_pb_include_categories_shop_temp = typeof data === 'undefined' && typeof et_pb_include_categories !== 'undefined' ? et_pb_include_categories.split( ',' ) : et_pb_include_categories_shop_temp; %>" . "\n";
[2258] Fix | Delete
[2259] Fix | Delete
$product_categories = et_builder_get_shop_categories( $args );
[2260] Fix | Delete
[2261] Fix | Delete
$output .= '<div id="et_pb_include_categories">';
[2262] Fix | Delete
[2263] Fix | Delete
if ( is_array( $product_categories ) && ! empty( $product_categories ) ) {
[2264] Fix | Delete
foreach ( $product_categories as $category ) {
[2265] Fix | Delete
if ( is_object( $category ) && is_a($category, 'WP_Term') ) {
[2266] Fix | Delete
$contains = sprintf(
[2267] Fix | Delete
'<%%= _.contains( et_pb_include_categories_shop_temp, "%1$s" ) ? checked="checked" : "" %%>',
[2268] Fix | Delete
esc_html( $category->term_id )
[2269] Fix | Delete
);
[2270] Fix | Delete
[2271] Fix | Delete
$output .= sprintf(
[2272] Fix | Delete
'%4$s<label><input type="checkbox" name="et_pb_include_categories" value="%1$s"%3$s> %2$s</label><br/>',
[2273] Fix | Delete
esc_attr( $category->term_id ),
[2274] Fix | Delete
esc_html( $category->name ),
[2275] Fix | Delete
$contains,
[2276] Fix | Delete
"\n\t\t\t\t\t"
[2277] Fix | Delete
);
[2278] Fix | Delete
}
[2279] Fix | Delete
}
[2280] Fix | Delete
}
[2281] Fix | Delete
[2282] Fix | Delete
$output .= '</div>';
[2283] Fix | Delete
[2284] Fix | Delete
return apply_filters( 'et_builder_include_categories_option_html', $output );
[2285] Fix | Delete
}
[2286] Fix | Delete
endif;
[2287] Fix | Delete
[2288] Fix | Delete
if ( ! function_exists( 'et_divi_get_projects' ) ) :
[2289] Fix | Delete
function et_divi_get_projects( $args = array() ) {
[2290] Fix | Delete
$default_args = array(
[2291] Fix | Delete
'post_type' => 'project',
[2292] Fix | Delete
);
[2293] Fix | Delete
$args = wp_parse_args( $args, $default_args );
[2294] Fix | Delete
return new WP_Query( $args );
[2295] Fix | Delete
}
[2296] Fix | Delete
endif;
[2297] Fix | Delete
[2298] Fix | Delete
if ( ! function_exists( 'et_pb_extract_items' ) ) :
[2299] Fix | Delete
function et_pb_extract_items( $content ) {
[2300] Fix | Delete
$output = $first_character = '';
[2301] Fix | Delete
$lines = array_filter( explode( "\n", str_replace( array( '<p>', '</p>', '<br />' ), "\n", $content ) ) );
[2302] Fix | Delete
foreach ( $lines as $line ) {
[2303] Fix | Delete
$line = trim( $line );
[2304] Fix | Delete
if ( '&#8211;' === substr( $line, 0, 7 ) ) {
[2305] Fix | Delete
$line = '-' . substr( $line, 7 );
[2306] Fix | Delete
}
[2307] Fix | Delete
if ( '' === $line ) {
[2308] Fix | Delete
continue;
[2309] Fix | Delete
}
[2310] Fix | Delete
$first_character = $line[0];
[2311] Fix | Delete
if ( in_array( $first_character, array( '-', '+' ) ) ) {
[2312] Fix | Delete
$line = trim( substr( $line, 1 ) );
[2313] Fix | Delete
}
[2314] Fix | Delete
$output .= sprintf( '[et_pb_pricing_item available="%2$s"]%1$s[/et_pb_pricing_item]',
[2315] Fix | Delete
$line,
[2316] Fix | Delete
( '-' === $first_character ? 'off' : 'on' )
[2317] Fix | Delete
);
[2318] Fix | Delete
}
[2319] Fix | Delete
return do_shortcode( $output );
[2320] Fix | Delete
}
[2321] Fix | Delete
endif;
[2322] Fix | Delete
[2323] Fix | Delete
/**
[2324] Fix | Delete
* Get all acceptable string value for given CSS property
[2325] Fix | Delete
* @param string property name
[2326] Fix | Delete
* @return array of acceptable CSS string values of given property name
[2327] Fix | Delete
*/
[2328] Fix | Delete
function et_builder_get_acceptable_css_string_values( $property = 'all' ) {
[2329] Fix | Delete
$acceptable_strings = apply_filters( 'et_builder_acceptable_css_string_values', array(
[2330] Fix | Delete
'width' => array(
[2331] Fix | Delete
'auto',
[2332] Fix | Delete
'inherit',
[2333] Fix | Delete
'initial',
[2334] Fix | Delete
'unset',
[2335] Fix | Delete
),
[2336] Fix | Delete
'max-width' => array(
[2337] Fix | Delete
'none',
[2338] Fix | Delete
'inherit',
[2339] Fix | Delete
'initial',
[2340] Fix | Delete
'unset',
[2341] Fix | Delete
),
[2342] Fix | Delete
'margin' => array(
[2343] Fix | Delete
'auto',
[2344] Fix | Delete
'inherit',
[2345] Fix | Delete
'initial',
[2346] Fix | Delete
'unset',
[2347] Fix | Delete
),
[2348] Fix | Delete
'padding' => array(
[2349] Fix | Delete
'inherit',
[2350] Fix | Delete
'initial',
[2351] Fix | Delete
'unset',
[2352] Fix | Delete
),
[2353] Fix | Delete
'height' => array(
[2354] Fix | Delete
'auto',
[2355] Fix | Delete
'inherit',
[2356] Fix | Delete
'initial',
[2357] Fix | Delete
'unset',
[2358] Fix | Delete
),
[2359] Fix | Delete
'min-height' => array(
[2360] Fix | Delete
'auto',
[2361] Fix | Delete
'inherit',
[2362] Fix | Delete
'initial',
[2363] Fix | Delete
'unset',
[2364] Fix | Delete
),
[2365] Fix | Delete
'max-height' => array(
[2366] Fix | Delete
'none',
[2367] Fix | Delete
'inherit',
[2368] Fix | Delete
'initial',
[2369] Fix | Delete
'unset',
[2370] Fix | Delete
),
[2371] Fix | Delete
'font-size' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
[2372] Fix | Delete
) );
[2373] Fix | Delete
[2374] Fix | Delete
if ( 'all' === $property ) {
[2375] Fix | Delete
return $acceptable_strings;
[2376] Fix | Delete
}
[2377] Fix | Delete
[2378] Fix | Delete
return isset( $acceptable_strings[ $property ] ) ? $acceptable_strings[ $property ] : array();
[2379] Fix | Delete
}
[2380] Fix | Delete
[2381] Fix | Delete
if ( ! function_exists( 'et_builder_process_range_value' ) ) :
[2382] Fix | Delete
function et_builder_process_range_value( $range, $option_type = '' ) {
[2383] Fix | Delete
$range = trim( $range );
[2384] Fix | Delete
$range_digit = '';
[2385] Fix | Delete
[2386] Fix | Delete
if ( $range !== 'none' ) {
[2387] Fix | Delete
$range_digit = floatval( $range );
[2388] Fix | Delete
}
[2389] Fix | Delete
[2390] Fix | Delete
$range_string = str_replace( et_()->to_css_decimal( $range_digit ), '', (string) $range );
[2391] Fix | Delete
[2392] Fix | Delete
if ( '' !== $option_type && in_array( $range, et_builder_get_acceptable_css_string_values( $option_type ) ) ) {
[2393] Fix | Delete
$result = $range;
[2394] Fix | Delete
} else {
[2395] Fix | Delete
if ( '' === $range_string ) {
[2396] Fix | Delete
$range_string = 'line_height' === $option_type && 3 >= $range_digit ? 'em' : 'px';
[2397] Fix | Delete
}
[2398] Fix | Delete
[2399] Fix | Delete
$result = et_()->to_css_decimal( $range_digit ) . $range_string;
[2400] Fix | Delete
}
[2401] Fix | Delete
[2402] Fix | Delete
return apply_filters( 'et_builder_processed_range_value', $result, $range, $range_string );
[2403] Fix | Delete
}
[2404] Fix | Delete
endif;
[2405] Fix | Delete
[2406] Fix | Delete
if ( ! function_exists( 'et_builder_get_border_styles' ) ) :
[2407] Fix | Delete
function et_builder_get_border_styles() {
[2408] Fix | Delete
$styles = array(
[2409] Fix | Delete
'solid' => esc_html__( 'Solid', 'et_builder' ),
[2410] Fix | Delete
'dashed' => esc_html__( 'Dashed', 'et_builder' ),
[2411] Fix | Delete
'dotted' => esc_html__( 'Dotted', 'et_builder' ),
[2412] Fix | Delete
'double' => esc_html__( 'Double', 'et_builder' ),
[2413] Fix | Delete
'groove' => esc_html__( 'Groove', 'et_builder' ),
[2414] Fix | Delete
'ridge' => esc_html__( 'Ridge', 'et_builder' ),
[2415] Fix | Delete
'inset' => esc_html__( 'Inset', 'et_builder' ),
[2416] Fix | Delete
'outset' => esc_html__( 'Outset', 'et_builder' ),
[2417] Fix | Delete
'none' => et_builder_i18n( 'None' ),
[2418] Fix | Delete
);
[2419] Fix | Delete
[2420] Fix | Delete
return apply_filters( 'et_builder_border_styles', $styles );
[2421] Fix | Delete
}
[2422] Fix | Delete
endif;
[2423] Fix | Delete
[2424] Fix | Delete
if ( ! function_exists( 'et_builder_font_options' ) ) :
[2425] Fix | Delete
function et_builder_font_options() {
[2426] Fix | Delete
$options = array();
[2427] Fix | Delete
[2428] Fix | Delete
$default_options = array( 'default' => array(
[2429] Fix | Delete
'name' => et_builder_i18n( 'Default' ),
[2430] Fix | Delete
) );
[2431] Fix | Delete
$fonts = array_merge( $default_options, et_builder_get_fonts() );
[2432] Fix | Delete
[2433] Fix | Delete
foreach ( $fonts as $font_name => $font_settings ) {
[2434] Fix | Delete
$options[ $font_name ] = 'default' !== $font_name ? $font_name : $font_settings['name'];
[2435] Fix | Delete
}
[2436] Fix | Delete
[2437] Fix | Delete
return $options;
[2438] Fix | Delete
}
[2439] Fix | Delete
endif;
[2440] Fix | Delete
[2441] Fix | Delete
if ( ! function_exists( 'et_builder_get_google_font_items' ) ) :
[2442] Fix | Delete
function et_builder_get_google_font_items() {
[2443] Fix | Delete
$output = '';
[2444] Fix | Delete
$font_options = et_builder_font_options();
[2445] Fix | Delete
[2446] Fix | Delete
foreach ( $font_options as $key => $value ) {
[2447] Fix | Delete
$output .= sprintf(
[2448] Fix | Delete
'<li class="select-option-item select-option-item-%3$s" data-value="%1$s">%2$s</li>',
[2449] Fix | Delete
esc_attr( $key ),
[2450] Fix | Delete
esc_html( $value ),
[2451] Fix | Delete
str_replace( ' ', '_', esc_attr( $key ) )
[2452] Fix | Delete
);
[2453] Fix | Delete
}
[2454] Fix | Delete
[2455] Fix | Delete
return $output;
[2456] Fix | Delete
}
[2457] Fix | Delete
endif;
[2458] Fix | Delete
[2459] Fix | Delete
if ( ! function_exists( 'et_builder_set_element_font' ) ) :
[2460] Fix | Delete
function et_builder_set_element_font( $font, $use_important = false, $default = false ) {
[2461] Fix | Delete
static $cache = array();
[2462] Fix | Delete
[2463] Fix | Delete
$style = '';
[2464] Fix | Delete
[2465] Fix | Delete
if ( '' === $font ) {
[2466] Fix | Delete
return $style;
[2467] Fix | Delete
}
[2468] Fix | Delete
[2469] Fix | Delete
$font_values = explode( '|', $font );
[2470] Fix | Delete
$default = ! $default ? "||||||||" : $default;
[2471] Fix | Delete
$font_values_default = explode( '|', $default );
[2472] Fix | Delete
[2473] Fix | Delete
if ( ! empty( $font_values ) ) {
[2474] Fix | Delete
// backward compatibility with old version of theme
[2475] Fix | Delete
if ( isset( $font_values[1] ) ) {
[2476] Fix | Delete
$font_values[1] = 'on' === $font_values[1] ? '700' : $font_values[1];
[2477] Fix | Delete
}
[2478] Fix | Delete
[2479] Fix | Delete
$font_values = array_map( 'trim', $font_values );
[2480] Fix | Delete
$font_name = $font_values[0];
[2481] Fix | Delete
$font_weight = isset( $font_values[1] ) && '' !== $font_values[1] ? $font_values[1] : '';
[2482] Fix | Delete
$is_font_italic = isset( $font_values[2] ) && 'on' === $font_values[2] ? true : false;
[2483] Fix | Delete
$is_font_uppercase = isset( $font_values[3] ) && 'on' === $font_values[3] ? true : false;
[2484] Fix | Delete
$is_font_underline = isset( $font_values[4] ) && 'on' === $font_values[4] ? true : false;
[2485] Fix | Delete
$is_font_small_caps = isset( $font_values[5] ) && 'on' === $font_values[5] ? true : false;
[2486] Fix | Delete
$is_font_line_through = isset( $font_values[6] ) && 'on' === $font_values[6] ? true : false;
[2487] Fix | Delete
$font_line_color = isset( $font_values[7] ) ? $font_values[7] : '';
[2488] Fix | Delete
$font_line_style = isset( $font_values[8] ) ? $font_values[8] : '';
[2489] Fix | Delete
[2490] Fix | Delete
$font_name_default = $font_values_default[0];
[2491] Fix | Delete
$font_weight_default = isset( $font_values_default[1] ) && '' !== $font_values_default[1] ? $font_values_default[1] : '';
[2492] Fix | Delete
$is_font_italic_default = isset( $font_values_default[2] ) && 'on' === $font_values_default[2] ? true : false;
[2493] Fix | Delete
$is_font_uppercase_default = isset( $font_values_default[3] ) && 'on' === $font_values_default[3] ? true : false;
[2494] Fix | Delete
$is_font_underline_default = isset( $font_values_default[4] ) && 'on' === $font_values_default[4] ? true : false;
[2495] Fix | Delete
$is_font_small_caps_default = isset( $font_values_default[5] ) && 'on' === $font_values_default[5] ? true : false;
[2496] Fix | Delete
$is_font_line_through_default = isset( $font_values_default[6] ) && 'on' === $font_values_default[6] ? true : false;
[2497] Fix | Delete
$font_line_color_default = isset( $font_values_default[7] ) ? $font_values_default[7] : '';
[2498] Fix | Delete
$font_line_style_default = isset( $font_values_default[8] ) ? $font_values_default[8] : '';
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function