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/epanel
File: custom_functions.php
$thumb_array['fullpath'] = $et_fullpath[0];
[500] Fix | Delete
$thumb_array['thumb'] = $thumb_array['fullpath'];
[501] Fix | Delete
}
[502] Fix | Delete
}
[503] Fix | Delete
[504] Fix | Delete
if ( empty( $thumb_array['thumb'] ) ) {
[505] Fix | Delete
if ( empty( $custom_field ) ) $thumb_array['thumb'] = esc_attr( get_post_meta( $post->ID, 'Thumbnail', $single = true ) );
[506] Fix | Delete
else {
[507] Fix | Delete
$thumb_array['thumb'] = esc_attr( get_post_meta( $post->ID, $custom_field, $single = true ) );
[508] Fix | Delete
if ( empty( $thumb_array['thumb'] ) ) $thumb_array['thumb'] = esc_attr( get_post_meta( $post->ID, 'Thumbnail', $single = true ) );
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
if ( '' === $thumb_array['thumb'] && et_grab_image_setting() ) {
[512] Fix | Delete
$thumb_array['thumb'] = esc_attr( et_first_image() );
[513] Fix | Delete
if ( $fullpath ) $thumb_array['fullpath'] = $thumb_array['thumb'];
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
#if custom field used for small pre-cropped image, open Thumbnail custom field image in lightbox
[517] Fix | Delete
if ($fullpath) {
[518] Fix | Delete
$thumb_array['fullpath'] = $thumb_array['thumb'];
[519] Fix | Delete
if ( empty( $custom_field ) ) $thumb_array['fullpath'] = apply_filters( 'et_fullpath', et_path_reltoabs( esc_attr( $thumb_array['thumb'] ) ) );
[520] Fix | Delete
elseif ( ! empty( $custom_field ) && get_post_meta( $post->ID, 'Thumbnail', $single = true ) ) $thumb_array['fullpath'] = apply_filters( 'et_fullpath', et_path_reltoabs( esc_attr( get_post_meta( $post->ID, 'Thumbnail', $single = true ) ) ) );
[521] Fix | Delete
}
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
return $thumb_array;
[525] Fix | Delete
}
[526] Fix | Delete
[527] Fix | Delete
}
[528] Fix | Delete
[529] Fix | Delete
if ( ! function_exists( 'et_grab_image_setting' ) ) :
[530] Fix | Delete
/**
[531] Fix | Delete
* Filterable "Grab the first post image" setting.
[532] Fix | Delete
* "Grab the first post image" needs to be filterable so it can be disabled forcefully.
[533] Fix | Delete
* It uses et_first_image() which uses apply_filters( 'the_content' ) which could cause
[534] Fix | Delete
* a conflict with third party plugin which extensively uses 'the_content' filter (ie. BuddyPress)
[535] Fix | Delete
* @return bool
[536] Fix | Delete
*/
[537] Fix | Delete
function et_grab_image_setting() {
[538] Fix | Delete
global $shortname;
[539] Fix | Delete
[540] Fix | Delete
// Force disable "Grab the first post image" in BuddyPress component page
[541] Fix | Delete
$is_buddypress_component = function_exists( 'bp_current_component' ) && bp_current_component();
[542] Fix | Delete
[543] Fix | Delete
$setting = 'on' === et_get_option( "{$shortname}_grab_image" ) && ! $is_buddypress_component;
[544] Fix | Delete
[545] Fix | Delete
return apply_filters( 'et_grab_image_setting', $setting );
[546] Fix | Delete
}
[547] Fix | Delete
endif;
[548] Fix | Delete
[549] Fix | Delete
/* this function prints thumbnail from Post Thumbnail or Custom field or First post image */
[550] Fix | Delete
if ( ! function_exists( 'print_thumbnail' ) ) {
[551] Fix | Delete
[552] Fix | Delete
function print_thumbnail($thumbnail = '', $use_timthumb = true, $alttext = '', $width = 100, $height = 100, $class = '', $echoout = true, $forstyle = false, $resize = true, $post='', $et_post_id = '' ) {
[553] Fix | Delete
if ( is_array( $thumbnail ) ) {
[554] Fix | Delete
extract( $thumbnail );
[555] Fix | Delete
}
[556] Fix | Delete
[557] Fix | Delete
if ( empty( $post ) ) global $post, $et_theme_image_sizes;
[558] Fix | Delete
[559] Fix | Delete
$output = '';
[560] Fix | Delete
$raw = false;
[561] Fix | Delete
$thumbnail_orig = $thumbnail;
[562] Fix | Delete
[563] Fix | Delete
$et_post_id = ! empty( $et_post_id ) ? (int) $et_post_id : $post->ID;
[564] Fix | Delete
[565] Fix | Delete
if ( has_post_thumbnail( $et_post_id ) ) {
[566] Fix | Delete
$thumb_array['use_timthumb'] = false;
[567] Fix | Delete
[568] Fix | Delete
$image_size_name = $width . 'x' . $height;
[569] Fix | Delete
$et_size = isset( $et_theme_image_sizes ) && array_key_exists( $image_size_name, $et_theme_image_sizes ) ? $et_theme_image_sizes[$image_size_name] : array( $width, $height );
[570] Fix | Delete
[571] Fix | Delete
$et_attachment_image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $et_post_id ), $et_size );
[572] Fix | Delete
$thumbnail = $et_attachment_image_attributes[0];
[573] Fix | Delete
} else {
[574] Fix | Delete
$thumbnail = et_multisite_thumbnail( $thumbnail );
[575] Fix | Delete
[576] Fix | Delete
$cropPosition = '';
[577] Fix | Delete
[578] Fix | Delete
$allow_new_thumb_method = false;
[579] Fix | Delete
[580] Fix | Delete
$new_method = true;
[581] Fix | Delete
$new_method_thumb = '';
[582] Fix | Delete
$external_source = false;
[583] Fix | Delete
[584] Fix | Delete
$allow_new_thumb_method = !$external_source && $new_method && empty( $cropPosition );
[585] Fix | Delete
[586] Fix | Delete
if ( $allow_new_thumb_method && !empty( $thumbnail ) ) {
[587] Fix | Delete
if ( 'data:image' === substr( $thumbnail, 0, 10 ) ) {
[588] Fix | Delete
$new_method_thumb = $thumbnail;
[589] Fix | Delete
$raw = true;
[590] Fix | Delete
} else {
[591] Fix | Delete
$et_crop = get_post_meta( $post->ID, 'et_nocrop', true );
[592] Fix | Delete
$et_crop = empty( $et_crop ) ? true : false;
[593] Fix | Delete
$new_method_thumb = et_resize_image( et_path_reltoabs( $thumbnail ), $width, $height, $et_crop );
[594] Fix | Delete
if ( is_wp_error( $new_method_thumb ) ) {
[595] Fix | Delete
$new_method_thumb = '';
[596] Fix | Delete
}
[597] Fix | Delete
}
[598] Fix | Delete
}
[599] Fix | Delete
[600] Fix | Delete
$thumbnail = $new_method_thumb;
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
if ( false === $forstyle && $resize ) {
[604] Fix | Delete
if ( $width < 480 && et_is_responsive_images_enabled() && ! $raw ) {
[605] Fix | Delete
$output = sprintf(
[606] Fix | Delete
'<img src="%1$s" alt="%2$s" class="%3$s" srcset="%4$s " sizes="%5$s " %6$s />',
[607] Fix | Delete
esc_url( $thumbnail ),
[608] Fix | Delete
esc_attr( wp_strip_all_tags( $alttext ) ),
[609] Fix | Delete
empty( $class ) ? '' : esc_attr( $class ),
[610] Fix | Delete
$thumbnail_orig . ' 479w, ' . $thumbnail . ' 480w',
[611] Fix | Delete
'(max-width:479px) 479px, 100vw',
[612] Fix | Delete
apply_filters( 'et_print_thumbnail_dimensions', " width='" . esc_attr( $width ) . "' height='" . esc_attr( $height ) . "'" )
[613] Fix | Delete
);
[614] Fix | Delete
} else {
[615] Fix | Delete
$output = sprintf(
[616] Fix | Delete
'<img src="%1$s" alt="%2$s" class="%3$s"%4$s />',
[617] Fix | Delete
$raw ? $thumbnail : esc_url( $thumbnail ),
[618] Fix | Delete
esc_attr( wp_strip_all_tags( $alttext ) ),
[619] Fix | Delete
empty( $class ) ? '' : esc_attr( $class ),
[620] Fix | Delete
apply_filters( 'et_print_thumbnail_dimensions', " width='" . esc_attr( $width ) . "' height='" . esc_attr( $height ) . "'" )
[621] Fix | Delete
);
[622] Fix | Delete
[623] Fix | Delete
if ( ! $raw ) {
[624] Fix | Delete
$output = et_image_add_srcset_and_sizes( $output );
[625] Fix | Delete
}
[626] Fix | Delete
}
[627] Fix | Delete
} else {
[628] Fix | Delete
$output = $thumbnail;
[629] Fix | Delete
}
[630] Fix | Delete
[631] Fix | Delete
if ($echoout) echo et_core_intentionally_unescaped( $output, 'html' );
[632] Fix | Delete
else return $output;
[633] Fix | Delete
}
[634] Fix | Delete
[635] Fix | Delete
}
[636] Fix | Delete
[637] Fix | Delete
if ( ! function_exists( 'et_new_thumb_resize' ) ) {
[638] Fix | Delete
[639] Fix | Delete
function et_new_thumb_resize( $thumbnail, $width, $height, $alt='', $forstyle = false ){
[640] Fix | Delete
global $shortname;
[641] Fix | Delete
[642] Fix | Delete
$new_method = true;
[643] Fix | Delete
$new_method_thumb = '';
[644] Fix | Delete
$external_source = false;
[645] Fix | Delete
[646] Fix | Delete
$allow_new_thumb_method = !$external_source && $new_method;
[647] Fix | Delete
[648] Fix | Delete
if ( $allow_new_thumb_method && ! empty( $thumbnail ) ) {
[649] Fix | Delete
$et_crop = true;
[650] Fix | Delete
$new_method_thumb = et_resize_image( $thumbnail, $width, $height, $et_crop );
[651] Fix | Delete
if ( is_wp_error( $new_method_thumb ) ) $new_method_thumb = '';
[652] Fix | Delete
}
[653] Fix | Delete
[654] Fix | Delete
$thumb = esc_attr( $new_method_thumb );
[655] Fix | Delete
[656] Fix | Delete
// Bail early when $forstyle argument is true.
[657] Fix | Delete
if ( $forstyle ) {
[658] Fix | Delete
return $thumb;
[659] Fix | Delete
}
[660] Fix | Delete
[661] Fix | Delete
$output = sprintf(
[662] Fix | Delete
'<img src="%1$s" alt="%2$s" width="%3$s" height="%4$s" />',
[663] Fix | Delete
esc_url( $thumb ),
[664] Fix | Delete
esc_attr( $alt ),
[665] Fix | Delete
esc_attr( $width ),
[666] Fix | Delete
esc_attr( $height )
[667] Fix | Delete
);
[668] Fix | Delete
[669] Fix | Delete
return et_image_add_srcset_and_sizes( $output );
[670] Fix | Delete
}
[671] Fix | Delete
[672] Fix | Delete
}
[673] Fix | Delete
[674] Fix | Delete
if ( ! function_exists( 'et_multisite_thumbnail' ) ) {
[675] Fix | Delete
[676] Fix | Delete
function et_multisite_thumbnail( $thumbnail = '' ) {
[677] Fix | Delete
// do nothing if it's not a Multisite installation or current site is the main one
[678] Fix | Delete
if ( is_main_site() ) return $thumbnail;
[679] Fix | Delete
[680] Fix | Delete
# get the real image url
[681] Fix | Delete
preg_match( '#([_0-9a-zA-Z-]+/)?files/(.+)#', $thumbnail, $matches );
[682] Fix | Delete
[683] Fix | Delete
if ( isset( $matches[2] ) ) {
[684] Fix | Delete
$file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $matches[2] );
[685] Fix | Delete
if ( is_file( $file ) ) $thumbnail = str_replace( ABSPATH, trailingslashit( get_site_url( 1 ) ), $file );
[686] Fix | Delete
else $thumbnail = '';
[687] Fix | Delete
}
[688] Fix | Delete
[689] Fix | Delete
return $thumbnail;
[690] Fix | Delete
}
[691] Fix | Delete
[692] Fix | Delete
}
[693] Fix | Delete
[694] Fix | Delete
if ( ! function_exists( 'et_is_portrait' ) ) {
[695] Fix | Delete
[696] Fix | Delete
function et_is_portrait($imageurl, $post='', $ignore_cfields = false){
[697] Fix | Delete
if ( empty( $post ) ) global $post;
[698] Fix | Delete
[699] Fix | Delete
if ( get_post_meta( $post->ID, 'et_disable_portrait', true ) === '1' ) return false;
[700] Fix | Delete
[701] Fix | Delete
if ( !$ignore_cfields ) {
[702] Fix | Delete
if ( get_post_meta( $post->ID, 'et_imagetype', true ) === 'l' ) return false;
[703] Fix | Delete
if ( get_post_meta( $post->ID, 'et_imagetype', true ) === 'p' ) return true;
[704] Fix | Delete
}
[705] Fix | Delete
[706] Fix | Delete
$imageurl = et_path_reltoabs( et_multisite_thumbnail( $imageurl ) );
[707] Fix | Delete
[708] Fix | Delete
$et_thumb_size = @getimagesize( $imageurl );
[709] Fix | Delete
if ( empty( $et_thumb_size ) ) {
[710] Fix | Delete
$et_thumb_size = @getimagesize( str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $imageurl ) );
[711] Fix | Delete
if ( empty( $et_thumb_size ) ) return false;
[712] Fix | Delete
}
[713] Fix | Delete
$et_thumb_width = $et_thumb_size[0];
[714] Fix | Delete
$et_thumb_height = $et_thumb_size[1];
[715] Fix | Delete
[716] Fix | Delete
$result = ($et_thumb_width < $et_thumb_height) ? true : false;
[717] Fix | Delete
[718] Fix | Delete
return $result;
[719] Fix | Delete
}
[720] Fix | Delete
[721] Fix | Delete
}
[722] Fix | Delete
[723] Fix | Delete
if ( ! function_exists( 'et_path_reltoabs' ) ) {
[724] Fix | Delete
[725] Fix | Delete
function et_path_reltoabs( $imageurl ){
[726] Fix | Delete
if ( strpos( strtolower( $imageurl ), 'http://' ) !== false || strpos( strtolower( $imageurl ), 'https://' ) !== false ) return $imageurl;
[727] Fix | Delete
[728] Fix | Delete
if ( strpos( strtolower( $imageurl ), $_SERVER['HTTP_HOST'] ) !== false )
[729] Fix | Delete
return $imageurl;
[730] Fix | Delete
else {
[731] Fix | Delete
$imageurl = esc_url( apply_filters( 'et_path_relative_image', site_url() . '/' ) . $imageurl );
[732] Fix | Delete
}
[733] Fix | Delete
[734] Fix | Delete
return $imageurl;
[735] Fix | Delete
}
[736] Fix | Delete
[737] Fix | Delete
}
[738] Fix | Delete
[739] Fix | Delete
if ( ! function_exists( 'in_subcat' ) ) {
[740] Fix | Delete
[741] Fix | Delete
function in_subcat($blogcat,$current_cat='') {
[742] Fix | Delete
$in_subcategory = false;
[743] Fix | Delete
[744] Fix | Delete
if (cat_is_ancestor_of( $blogcat, $current_cat ) || $blogcat === $current_cat) $in_subcategory = true;
[745] Fix | Delete
[746] Fix | Delete
return $in_subcategory;
[747] Fix | Delete
}
[748] Fix | Delete
[749] Fix | Delete
}
[750] Fix | Delete
[751] Fix | Delete
if ( ! function_exists( 'show_page_menu' ) ) {
[752] Fix | Delete
[753] Fix | Delete
function show_page_menu($customClass = 'nav clearfix', $addUlContainer = true, $addHomeLink = true){
[754] Fix | Delete
global $shortname, $themename, $exclude_pages, $strdepth, $page_menu, $is_footer;
[755] Fix | Delete
[756] Fix | Delete
//excluded pages
[757] Fix | Delete
if ( $menupages = et_get_option( $shortname.'_menupages' ) ) {
[758] Fix | Delete
$exclude_pages = implode( ",", $menupages );
[759] Fix | Delete
}
[760] Fix | Delete
[761] Fix | Delete
//dropdown for pages
[762] Fix | Delete
$strdepth = '';
[763] Fix | Delete
if ( et_get_option( $shortname.'_enable_dropdowns' ) === 'on' ) {
[764] Fix | Delete
$strdepth = "depth=".et_get_option( $shortname.'_tiers_shown_pages' );
[765] Fix | Delete
}
[766] Fix | Delete
[767] Fix | Delete
if ( empty( $strdepth ) ) {
[768] Fix | Delete
$strdepth = "depth=1";
[769] Fix | Delete
}
[770] Fix | Delete
[771] Fix | Delete
if ( $is_footer ) {
[772] Fix | Delete
$strdepth = "depth=1";
[773] Fix | Delete
$strdepth2 = $strdepth;
[774] Fix | Delete
}
[775] Fix | Delete
[776] Fix | Delete
$page_menu = wp_list_pages( "sort_column=".et_get_option( $shortname.'_sort_pages' )."&sort_order=".et_get_option( $shortname.'_order_page' )."&".$strdepth."&exclude=".$exclude_pages."&title_li=&echo=0" );
[777] Fix | Delete
[778] Fix | Delete
if ( $addUlContainer ) echo '<ul class="' . esc_attr( $customClass ) . '">';
[779] Fix | Delete
if (et_get_option( $shortname . '_home_link' ) === 'on' && $addHomeLink) { ?>
[780] Fix | Delete
<li <?php if ( is_front_page() || is_home() ) echo 'class="current_page_item"' ?>><a href="<?php echo esc_url( home_url() ); ?>"><?php esc_html_e( 'Home', $themename ); ?></a></li>
[781] Fix | Delete
<?php };
[782] Fix | Delete
[783] Fix | Delete
echo et_core_esc_wp( $page_menu );
[784] Fix | Delete
if ( $addUlContainer ) echo '</ul>';
[785] Fix | Delete
}
[786] Fix | Delete
[787] Fix | Delete
}
[788] Fix | Delete
[789] Fix | Delete
if ( ! function_exists( 'show_categories_menu' ) ) {
[790] Fix | Delete
[791] Fix | Delete
function show_categories_menu($customClass = 'nav clearfix', $addUlContainer = true){
[792] Fix | Delete
global $shortname, $themename, $category_menu, $exclude_cats, $hide, $strdepth2, $projects_cat;
[793] Fix | Delete
[794] Fix | Delete
//excluded categories
[795] Fix | Delete
if ( $menucats = et_get_option( $shortname.'_menucats' ) ) {
[796] Fix | Delete
$exclude_cats = implode( ",", $menucats );
[797] Fix | Delete
}
[798] Fix | Delete
[799] Fix | Delete
//hide empty categories
[800] Fix | Delete
if (et_get_option( $shortname.'_categories_empty' ) === 'on') $hide = '1';
[801] Fix | Delete
else $hide = '0';
[802] Fix | Delete
[803] Fix | Delete
//dropdown for categories
[804] Fix | Delete
$strdepth2 = '';
[805] Fix | Delete
if ( et_get_option( $shortname.'_enable_dropdowns_categories' ) === 'on' ) $strdepth2 = "depth=".et_get_option( $shortname.'_tiers_shown_categories' );
[806] Fix | Delete
if ( empty( $strdepth2 ) ) $strdepth2 = "depth=1";
[807] Fix | Delete
[808] Fix | Delete
$args = "orderby=".et_get_option( $shortname.'_sort_cat' )."&order=".et_get_option( $shortname.'_order_cat' )."&".$strdepth2."&exclude=".$exclude_cats."&hide_empty=".$hide."&title_li=&echo=0";
[809] Fix | Delete
[810] Fix | Delete
$categories = get_categories( $args );
[811] Fix | Delete
[812] Fix | Delete
if ( !empty( $categories ) ) {
[813] Fix | Delete
$args_array = wp_parse_args( $args );
[814] Fix | Delete
[815] Fix | Delete
if ( isset( $args_array['exclude'] ) && '' !== $args_array['exclude'] ) {
[816] Fix | Delete
$args_array['exclude'] = explode( ',', $args_array['exclude'] );
[817] Fix | Delete
}
[818] Fix | Delete
[819] Fix | Delete
$category_menu = wp_list_categories( $args_array );
[820] Fix | Delete
if ( $addUlContainer ) echo '<ul class="' . esc_attr( $customClass ) . '">';
[821] Fix | Delete
echo et_core_esc_wp( $category_menu );
[822] Fix | Delete
if ( $addUlContainer ) echo '</ul>';
[823] Fix | Delete
}
[824] Fix | Delete
}
[825] Fix | Delete
[826] Fix | Delete
}
[827] Fix | Delete
[828] Fix | Delete
function head_addons(){
[829] Fix | Delete
global $shortname, $default_colorscheme;
[830] Fix | Delete
[831] Fix | Delete
// phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
[832] Fix | Delete
$color_scheme = apply_filters( 'et_get_additional_color_scheme', et_get_option( $shortname.'_color_scheme' ) );
[833] Fix | Delete
if ( !empty( $color_scheme ) && $color_scheme !== $default_colorscheme ) { ?>
[834] Fix | Delete
<link rel="stylesheet" href="<?php echo esc_url( get_template_directory_uri() . '/style-' . et_get_option( $shortname.'_color_scheme' ) . '.css' ); ?>" type="text/css" media="screen" />
[835] Fix | Delete
<?php }
[836] Fix | Delete
[837] Fix | Delete
$child_cssurl = et_get_option( $shortname.'_child_cssurl' );
[838] Fix | Delete
if ( et_get_option( $shortname.'_child_css' ) === 'on' && ! empty( $child_cssurl ) ) { //Enable child stylesheet ?>
[839] Fix | Delete
<link rel="stylesheet" href="<?php echo esc_url( $child_cssurl ); ?>" type="text/css" media="screen" />
[840] Fix | Delete
<?php }
[841] Fix | Delete
[842] Fix | Delete
//prints the theme name, version in meta tag
[843] Fix | Delete
$theme_info = wp_get_theme();
[844] Fix | Delete
echo '<meta content="' . esc_attr( $theme_info->display( 'Name' ) . ' v.' . $theme_info->display( 'Version' ) ) . '" name="generator"/>';
[845] Fix | Delete
[846] Fix | Delete
if ( et_get_option( $shortname . '_custom_colors' ) === 'on' ) et_epanel_custom_colors_css();
[847] Fix | Delete
// phpcs:enable
[848] Fix | Delete
}// end function head_addons()
[849] Fix | Delete
[850] Fix | Delete
add_action( 'wp_head', 'head_addons', 7 );
[851] Fix | Delete
[852] Fix | Delete
function integration_head(){
[853] Fix | Delete
global $shortname;
[854] Fix | Delete
[855] Fix | Delete
/** @see ET_Core_SupportCenter::toggle_safe_mode */
[856] Fix | Delete
if ( et_core_is_safe_mode_active() ) {
[857] Fix | Delete
return;
[858] Fix | Delete
}
[859] Fix | Delete
[860] Fix | Delete
$integration_head = et_get_option( $shortname . '_integration_head' );
[861] Fix | Delete
if ( ! empty( $integration_head ) && et_get_option( $shortname . '_integrate_header_enable' ) === 'on' ) {
[862] Fix | Delete
[863] Fix | Delete
$integration_head = et_core_fix_unclosed_html_tags( $integration_head );
[864] Fix | Delete
echo et_core_intentionally_unescaped( $integration_head, 'html' );
[865] Fix | Delete
}
[866] Fix | Delete
}
[867] Fix | Delete
[868] Fix | Delete
add_action( 'wp_head', 'integration_head', 12 );
[869] Fix | Delete
[870] Fix | Delete
function integration_body(){
[871] Fix | Delete
global $shortname;
[872] Fix | Delete
[873] Fix | Delete
/** @see ET_Core_SupportCenter::toggle_safe_mode */
[874] Fix | Delete
if ( et_core_is_safe_mode_active() ) {
[875] Fix | Delete
return;
[876] Fix | Delete
}
[877] Fix | Delete
[878] Fix | Delete
$integration_body = et_get_option( $shortname . '_integration_body' );
[879] Fix | Delete
if ( ! empty( $integration_body ) && et_get_option( $shortname . '_integrate_body_enable' ) === 'on' ) {
[880] Fix | Delete
[881] Fix | Delete
$integration_body = et_core_fix_unclosed_html_tags( $integration_body );
[882] Fix | Delete
echo et_core_intentionally_unescaped( $integration_body, 'html' );
[883] Fix | Delete
}
[884] Fix | Delete
}
[885] Fix | Delete
[886] Fix | Delete
add_action( 'wp_footer', 'integration_body', 12 );
[887] Fix | Delete
[888] Fix | Delete
function integration_single_top(){
[889] Fix | Delete
global $shortname;
[890] Fix | Delete
[891] Fix | Delete
/** @see ET_Core_SupportCenter::toggle_safe_mode */
[892] Fix | Delete
if ( et_core_is_safe_mode_active() ) {
[893] Fix | Delete
return;
[894] Fix | Delete
}
[895] Fix | Delete
[896] Fix | Delete
$integration_single_top = et_get_option( $shortname . '_integration_single_top' );
[897] Fix | Delete
if ( ! empty( $integration_single_top ) && et_get_option( $shortname . '_integrate_singletop_enable' ) === 'on' ) {
[898] Fix | Delete
[899] Fix | Delete
$integration_single_top = et_core_fix_unclosed_html_tags( $integration_single_top );
[900] Fix | Delete
echo et_core_intentionally_unescaped( $integration_single_top, 'html' );
[901] Fix | Delete
}
[902] Fix | Delete
}
[903] Fix | Delete
[904] Fix | Delete
add_action( 'et_before_post', 'integration_single_top', 12 );
[905] Fix | Delete
[906] Fix | Delete
function integration_single_bottom(){
[907] Fix | Delete
global $shortname;
[908] Fix | Delete
[909] Fix | Delete
/** @see ET_Core_SupportCenter::toggle_safe_mode */
[910] Fix | Delete
if ( et_core_is_safe_mode_active() ) {
[911] Fix | Delete
return;
[912] Fix | Delete
}
[913] Fix | Delete
[914] Fix | Delete
$integration_single_bottom = et_get_option( $shortname . '_integration_single_bottom' );
[915] Fix | Delete
if ( ! empty( $integration_single_bottom ) && et_get_option( $shortname . '_integrate_singlebottom_enable' ) === 'on' ) {
[916] Fix | Delete
[917] Fix | Delete
$integration_single_bottom = et_core_fix_unclosed_html_tags( $integration_single_bottom );
[918] Fix | Delete
echo et_core_intentionally_unescaped( $integration_single_bottom, 'html' );
[919] Fix | Delete
}
[920] Fix | Delete
}
[921] Fix | Delete
[922] Fix | Delete
add_action( 'et_after_post', 'integration_single_bottom', 12 );
[923] Fix | Delete
[924] Fix | Delete
/*this function gets page name by its id*/
[925] Fix | Delete
if ( ! function_exists( 'get_pagename' ) ) {
[926] Fix | Delete
[927] Fix | Delete
function get_pagename( $page_id )
[928] Fix | Delete
{
[929] Fix | Delete
$page_object = get_page( $page_id );
[930] Fix | Delete
[931] Fix | Delete
return apply_filters( 'the_title', $page_object->post_title, $page_id );
[932] Fix | Delete
}
[933] Fix | Delete
[934] Fix | Delete
}
[935] Fix | Delete
[936] Fix | Delete
/*this function gets category name by its id*/
[937] Fix | Delete
if ( ! function_exists( 'get_categname' ) ) {
[938] Fix | Delete
[939] Fix | Delete
function get_categname( $cat_id )
[940] Fix | Delete
{
[941] Fix | Delete
return get_cat_name( $cat_id );
[942] Fix | Delete
}
[943] Fix | Delete
[944] Fix | Delete
}
[945] Fix | Delete
[946] Fix | Delete
/*this function gets category id by its name*/
[947] Fix | Delete
if ( ! function_exists( 'get_catId' ) ) {
[948] Fix | Delete
[949] Fix | Delete
function get_catId( $cat_name, $taxonomy = 'category' )
[950] Fix | Delete
{
[951] Fix | Delete
$cat_name_id = is_numeric( $cat_name ) ? (int) $cat_name : (int) get_cat_ID( html_entity_decode( $cat_name, ENT_QUOTES ) );
[952] Fix | Delete
[953] Fix | Delete
// wpml compatibility
[954] Fix | Delete
if ( function_exists( 'icl_object_id' ) ) {
[955] Fix | Delete
$cat_name_id = (int) icl_object_id( $cat_name_id, $taxonomy, true );
[956] Fix | Delete
}
[957] Fix | Delete
[958] Fix | Delete
return $cat_name_id;
[959] Fix | Delete
}
[960] Fix | Delete
[961] Fix | Delete
}
[962] Fix | Delete
[963] Fix | Delete
/*this function gets page id by its name*/
[964] Fix | Delete
if ( ! function_exists( 'get_pageId' ) ) {
[965] Fix | Delete
[966] Fix | Delete
function get_pageId( $page_name )
[967] Fix | Delete
{
[968] Fix | Delete
if ( is_numeric( $page_name ) ) {
[969] Fix | Delete
$page_id = intval( $page_name );
[970] Fix | Delete
} else {
[971] Fix | Delete
$page_name = html_entity_decode( $page_name, ENT_QUOTES );
[972] Fix | Delete
$page = get_page_by_title( $page_name );
[973] Fix | Delete
$page_id = intval( $page->ID );
[974] Fix | Delete
}
[975] Fix | Delete
[976] Fix | Delete
// wpml compatibility
[977] Fix | Delete
if ( function_exists( 'icl_object_id' ) )
[978] Fix | Delete
$page_id = (int) icl_object_id( $page_id, 'page', true );
[979] Fix | Delete
[980] Fix | Delete
return $page_id;
[981] Fix | Delete
}
[982] Fix | Delete
[983] Fix | Delete
}
[984] Fix | Delete
[985] Fix | Delete
/**
[986] Fix | Delete
* Transforms an array of posts, pages, post_tags or categories ids
[987] Fix | Delete
* into corresponding "objects" ids, if WPML plugin is installed
[988] Fix | Delete
*
[989] Fix | Delete
* @param array $ids_array Posts, pages, post_tags or categories ids.
[990] Fix | Delete
* @param string $type "Object" type.
[991] Fix | Delete
* @return array IDs.
[992] Fix | Delete
*/
[993] Fix | Delete
if ( ! function_exists( 'et_generate_wpml_ids' ) ) {
[994] Fix | Delete
[995] Fix | Delete
function et_generate_wpml_ids( $ids_array, $type ) {
[996] Fix | Delete
if ( function_exists( 'icl_object_id' ) ) {
[997] Fix | Delete
$wpml_ids = array();
[998] Fix | Delete
foreach ( $ids_array as $id ) {
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function