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: core.php
'epanel' => 'epanel_portability',
[6000] Fix | Delete
);
[6001] Fix | Delete
[6002] Fix | Delete
$cap = et_()->array_get( $context_caps, $context, '' );
[6003] Fix | Delete
[6004] Fix | Delete
if ( ! empty( $cap ) && ! et_pb_is_allowed( $cap ) ) {
[6005] Fix | Delete
return '';
[6006] Fix | Delete
}
[6007] Fix | Delete
[6008] Fix | Delete
return et_core_portability_link( $context, $attributes );
[6009] Fix | Delete
}
[6010] Fix | Delete
[6011] Fix | Delete
/**
[6012] Fix | Delete
* Get the list of all public post types.
[6013] Fix | Delete
*
[6014] Fix | Delete
* @since 3.26.7
[6015] Fix | Delete
*
[6016] Fix | Delete
* @return WP_Post_Type[]
[6017] Fix | Delete
*/
[6018] Fix | Delete
function et_builder_get_public_post_types() {
[6019] Fix | Delete
$cache_key = 'et_builder_get_public_post_types';
[6020] Fix | Delete
[6021] Fix | Delete
if ( ! et_core_cache_has( $cache_key ) ) {
[6022] Fix | Delete
$blocklist = array_merge( array(
[6023] Fix | Delete
'et_pb_layout',
[6024] Fix | Delete
ET_THEME_BUILDER_TEMPLATE_POST_TYPE,
[6025] Fix | Delete
), et_theme_builder_get_layout_post_types() );
[6026] Fix | Delete
$all_post_types = get_post_types( array(), 'objects' );
[6027] Fix | Delete
$post_types = array();
[6028] Fix | Delete
[6029] Fix | Delete
foreach ( $all_post_types as $post_type ) {
[6030] Fix | Delete
if ( ! in_array( $post_type->name, $blocklist, true ) && et_builder_is_post_type_public( $post_type->name ) ) {
[6031] Fix | Delete
$post_types[ $post_type->name ] = $post_type;
[6032] Fix | Delete
}
[6033] Fix | Delete
}
[6034] Fix | Delete
[6035] Fix | Delete
et_core_cache_add( $cache_key, $post_types );
[6036] Fix | Delete
}
[6037] Fix | Delete
[6038] Fix | Delete
/**
[6039] Fix | Delete
* Filter array of public post types.
[6040] Fix | Delete
*
[6041] Fix | Delete
* @since 3.26.7
[6042] Fix | Delete
*
[6043] Fix | Delete
* @param WP_Post_Type[]
[6044] Fix | Delete
*/
[6045] Fix | Delete
return apply_filters( 'et_builder_get_public_post_types', et_core_cache_get( $cache_key ) );
[6046] Fix | Delete
}
[6047] Fix | Delete
[6048] Fix | Delete
/**
[6049] Fix | Delete
* Clear public post type cache whenever a custom post type is registered.
[6050] Fix | Delete
*
[6051] Fix | Delete
* @since 3.26.7
[6052] Fix | Delete
*
[6053] Fix | Delete
* @return void
[6054] Fix | Delete
*/
[6055] Fix | Delete
function et_builder_clear_get_public_post_types_cache() {
[6056] Fix | Delete
et_core_cache_delete( 'et_builder_get_public_post_types' );
[6057] Fix | Delete
}
[6058] Fix | Delete
add_action( 'registered_post_type', 'et_builder_clear_get_public_post_types_cache' );
[6059] Fix | Delete
[6060] Fix | Delete
if ( ! function_exists( 'et_filter_intermediate_image_sizes_advanced' ) ):
[6061] Fix | Delete
/**
[6062] Fix | Delete
* Filters the image sizes to calculate responsive image height.
[6063] Fix | Delete
*
[6064] Fix | Delete
* @param array $sizes An associative array of image sizes.
[6065] Fix | Delete
* @param array $metadata An associative array of image metadata: width, height, file.
[6066] Fix | Delete
*
[6067] Fix | Delete
* @return array
[6068] Fix | Delete
*/
[6069] Fix | Delete
function et_filter_intermediate_image_sizes_advanced( $sizes, $metadata = array() ) {
[6070] Fix | Delete
// Bail early when the attachment metadata is empty.
[6071] Fix | Delete
if ( ! $metadata ) {
[6072] Fix | Delete
return $sizes;
[6073] Fix | Delete
}
[6074] Fix | Delete
[6075] Fix | Delete
foreach ( array_keys( $sizes ) as $size_key ) {
[6076] Fix | Delete
if ( strpos( $size_key, 'et-pb-image--responsive--' ) !== 0 ) {
[6077] Fix | Delete
continue;
[6078] Fix | Delete
}
[6079] Fix | Delete
[6080] Fix | Delete
$breakpoint = str_replace( 'et-pb-image--responsive--', '', $size_key );
[6081] Fix | Delete
$responsive_size = et_image_get_responsive_size( $metadata['width'], $metadata['height'], $breakpoint );
[6082] Fix | Delete
[6083] Fix | Delete
if ( $responsive_size && isset( $responsive_size['width'] ) && isset( $responsive_size['height'] ) ) {
[6084] Fix | Delete
$sizes[ $size_key ]['width'] = $responsive_size['width'];
[6085] Fix | Delete
$sizes[ $size_key ]['height'] = $responsive_size['height'];
[6086] Fix | Delete
} else {
[6087] Fix | Delete
unset( $sizes[ $size_key ] );
[6088] Fix | Delete
}
[6089] Fix | Delete
}
[6090] Fix | Delete
[6091] Fix | Delete
return $sizes;
[6092] Fix | Delete
}
[6093] Fix | Delete
endif;
[6094] Fix | Delete
add_filter( 'intermediate_image_sizes_advanced', 'et_filter_intermediate_image_sizes_advanced', 10, 2 );
[6095] Fix | Delete
[6096] Fix | Delete
if ( ! function_exists( 'et_action_sync_attachment_data_cache' ) ) :
[6097] Fix | Delete
/**
[6098] Fix | Delete
* Sync image data cache
[6099] Fix | Delete
*
[6100] Fix | Delete
* @since 3.29.3
[6101] Fix | Delete
*
[6102] Fix | Delete
* @param int $attachment_id Attachment ID.
[6103] Fix | Delete
* @param array $metadata Image metadata.
[6104] Fix | Delete
*
[6105] Fix | Delete
* @return void
[6106] Fix | Delete
*/
[6107] Fix | Delete
function et_action_sync_attachment_data_cache( $attachment_id, $metadata = null ) {
[6108] Fix | Delete
if ( ! $attachment_id ) {
[6109] Fix | Delete
return;
[6110] Fix | Delete
}
[6111] Fix | Delete
[6112] Fix | Delete
$url_full = wp_get_attachment_url( $attachment_id );
[6113] Fix | Delete
[6114] Fix | Delete
if ( ! $url_full ) {
[6115] Fix | Delete
return;
[6116] Fix | Delete
}
[6117] Fix | Delete
[6118] Fix | Delete
// Normalize image URL to remove the HTTP/S protocol.
[6119] Fix | Delete
$normalized_url_full = et_attachment_normalize_url( $url_full );
[6120] Fix | Delete
[6121] Fix | Delete
if ( ! $normalized_url_full ) {
[6122] Fix | Delete
return;
[6123] Fix | Delete
}
[6124] Fix | Delete
[6125] Fix | Delete
$normalized_urls = array(
[6126] Fix | Delete
$normalized_url_full => $normalized_url_full,
[6127] Fix | Delete
);
[6128] Fix | Delete
[6129] Fix | Delete
if ( is_null( $metadata ) ) {
[6130] Fix | Delete
$metadata = wp_get_attachment_metadata( $attachment_id );
[6131] Fix | Delete
}
[6132] Fix | Delete
[6133] Fix | Delete
if ( ! empty( $metadata ) ) {
[6134] Fix | Delete
foreach( $metadata['sizes'] as $image_size ) {
[6135] Fix | Delete
$normalized_url = str_replace( basename( $normalized_url_full ), $image_size['file'], $normalized_url_full );
[6136] Fix | Delete
[6137] Fix | Delete
if ( ! isset( $normalized_urls[ $normalized_url ] ) ) {
[6138] Fix | Delete
$normalized_urls[ $normalized_url ] = $normalized_url;
[6139] Fix | Delete
}
[6140] Fix | Delete
}
[6141] Fix | Delete
}
[6142] Fix | Delete
[6143] Fix | Delete
$cache_keys = array(
[6144] Fix | Delete
'attachment_id_by_url',
[6145] Fix | Delete
'attachment_size_by_url',
[6146] Fix | Delete
'image_responsive_metadata',
[6147] Fix | Delete
'image_srcset_sizes',
[6148] Fix | Delete
);
[6149] Fix | Delete
[6150] Fix | Delete
foreach ( $cache_keys as $cache_key ) {
[6151] Fix | Delete
$cache = ET_Core_Cache_File::get( $cache_key );
[6152] Fix | Delete
[6153] Fix | Delete
// Skip if the cache data is empty.
[6154] Fix | Delete
if ( ! $cache ) {
[6155] Fix | Delete
continue;
[6156] Fix | Delete
}
[6157] Fix | Delete
[6158] Fix | Delete
foreach ( $normalized_urls as $normalized_url ) {
[6159] Fix | Delete
unset( $cache[ $normalized_url ] );
[6160] Fix | Delete
}
[6161] Fix | Delete
[6162] Fix | Delete
ET_Core_Cache_File::set( $cache_key, $cache );
[6163] Fix | Delete
}
[6164] Fix | Delete
}
[6165] Fix | Delete
endif;
[6166] Fix | Delete
add_action( 'delete_attachment', 'et_action_sync_attachment_data_cache' );
[6167] Fix | Delete
[6168] Fix | Delete
if ( ! function_exists( 'et_filter_wp_generate_attachment_metadata' ) ):
[6169] Fix | Delete
/**
[6170] Fix | Delete
* Sync the cached srcset data when attachment meta data generated/updated.
[6171] Fix | Delete
*
[6172] Fix | Delete
* @since 3.27.1
[6173] Fix | Delete
*
[6174] Fix | Delete
* @param array $metadata An array of attachment meta data.
[6175] Fix | Delete
* @param int $attachment_id Current attachment ID.
[6176] Fix | Delete
*
[6177] Fix | Delete
* @return array
[6178] Fix | Delete
*/
[6179] Fix | Delete
function et_filter_wp_generate_attachment_metadata( $metadata, $attachment_id = 0 ) {
[6180] Fix | Delete
if ( $attachment_id ) {
[6181] Fix | Delete
et_action_sync_attachment_data_cache( $attachment_id, $metadata );
[6182] Fix | Delete
}
[6183] Fix | Delete
[6184] Fix | Delete
return $metadata;
[6185] Fix | Delete
}
[6186] Fix | Delete
endif;
[6187] Fix | Delete
add_filter( 'wp_generate_attachment_metadata', 'et_filter_wp_generate_attachment_metadata', 10, 2 );
[6188] Fix | Delete
[6189] Fix | Delete
/**
[6190] Fix | Delete
* Filter the main query paged arg to avoid pagination clashes with the Blog module pagination.
[6191] Fix | Delete
*
[6192] Fix | Delete
* @since 4.0
[6193] Fix | Delete
*
[6194] Fix | Delete
* @param WP_Query $query
[6195] Fix | Delete
*
[6196] Fix | Delete
* @return void
[6197] Fix | Delete
*/
[6198] Fix | Delete
function et_builder_filter_main_query_paged_for_blog_module( $query ) {
[6199] Fix | Delete
/**
[6200] Fix | Delete
* Utility which holds the current page number for the Blog module.
[6201] Fix | Delete
* Necessary to avoid clashes with the main query pagination.
[6202] Fix | Delete
*
[6203] Fix | Delete
* @var integer
[6204] Fix | Delete
*/
[6205] Fix | Delete
global $__et_blog_module_paged;
[6206] Fix | Delete
[6207] Fix | Delete
if ( isset( $_GET['et_blog'] ) && $query->is_main_query() ) {
[6208] Fix | Delete
$__et_blog_module_paged = $query->get( 'paged' );
[6209] Fix | Delete
$query->set( 'paged', 0 );
[6210] Fix | Delete
}
[6211] Fix | Delete
}
[6212] Fix | Delete
add_filter( 'pre_get_posts', 'et_builder_filter_main_query_paged_for_blog_module' );
[6213] Fix | Delete
[6214] Fix | Delete
if ( ! function_exists( 'et_maybe_enable_embed_shortcode' ) ):
[6215] Fix | Delete
/**
[6216] Fix | Delete
* Maybe enable [embed] shortcode at the content.
[6217] Fix | Delete
*
[6218] Fix | Delete
* @since 4.4.9
[6219] Fix | Delete
*
[6220] Fix | Delete
* @param string $content
[6221] Fix | Delete
* @param boolean $is_content
[6222] Fix | Delete
*
[6223] Fix | Delete
* @return string
[6224] Fix | Delete
*/
[6225] Fix | Delete
function et_maybe_enable_embed_shortcode( $content, $is_content ) {
[6226] Fix | Delete
if ( $is_content && has_shortcode( $content, 'embed' ) ) {
[6227] Fix | Delete
global $wp_embed;
[6228] Fix | Delete
$content = $wp_embed->run_shortcode( $content );
[6229] Fix | Delete
}
[6230] Fix | Delete
[6231] Fix | Delete
return $content;
[6232] Fix | Delete
}
[6233] Fix | Delete
endif;
[6234] Fix | Delete
[6235] Fix | Delete
/**
[6236] Fix | Delete
* Register custom sidebars.
[6237] Fix | Delete
*
[6238] Fix | Delete
* @since 4.4.8 Moved from builder/functions.php, so it can be loaded on wp_ajax_save_widget()
[6239] Fix | Delete
*/
[6240] Fix | Delete
function et_builder_widgets_init() {
[6241] Fix | Delete
$et_pb_widgets = get_theme_mod( 'et_pb_widgets' );
[6242] Fix | Delete
$widget_areas = et_()->array_get( $et_pb_widgets, 'areas', array() );
[6243] Fix | Delete
if ( ! empty( $widget_areas ) ) {
[6244] Fix | Delete
foreach ( $widget_areas as $id => $name ) {
[6245] Fix | Delete
register_sidebar( array(
[6246] Fix | Delete
'name' => sanitize_text_field( $name ),
[6247] Fix | Delete
'id' => sanitize_text_field( $id ),
[6248] Fix | Delete
'before_widget' => '<div id="%1$s" class="et_pb_widget %2$s">',
[6249] Fix | Delete
'after_widget' => '</div> <!-- end .et_pb_widget -->',
[6250] Fix | Delete
'before_title' => '<h4 class="widgettitle">',
[6251] Fix | Delete
'after_title' => '</h4>',
[6252] Fix | Delete
) );
[6253] Fix | Delete
}
[6254] Fix | Delete
}
[6255] Fix | Delete
[6256] Fix | Delete
// Disable built-in's recent comments widget link styling because ET Themes don't need it.
[6257] Fix | Delete
if ( ! et_is_builder_plugin_active() ) {
[6258] Fix | Delete
add_filter( 'show_recent_comments_widget_style', '__return_false' );
[6259] Fix | Delete
}
[6260] Fix | Delete
}
[6261] Fix | Delete
[6262] Fix | Delete
// Call the widgets init at 'init' hook if Divi Builder plugin active because plugin
[6263] Fix | Delete
// loads the Divi builder at 'init' hook and 'widgets_init' is too early.
[6264] Fix | Delete
if ( et_is_builder_plugin_active() ) {
[6265] Fix | Delete
add_action( 'init', 'et_builder_widgets_init', 20 );
[6266] Fix | Delete
} else {
[6267] Fix | Delete
add_action( 'widgets_init', 'et_builder_widgets_init' );
[6268] Fix | Delete
}
[6269] Fix | Delete
[6270] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function