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
/home/sportsfe.../httpdocs/wp-conte.../plugins/content-.../inc/freemius/template...
File: tabs.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @package Freemius
[2] Fix | Delete
* @copyright Copyright (c) 2015, Freemius, Inc.
[3] Fix | Delete
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
[4] Fix | Delete
* @since 1.2.2.7
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[8] Fix | Delete
exit;
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* @var array $VARS
[13] Fix | Delete
* @var Freemius $fs
[14] Fix | Delete
*/
[15] Fix | Delete
$fs = freemius( $VARS['id'] );
[16] Fix | Delete
[17] Fix | Delete
$slug = $fs->get_slug();
[18] Fix | Delete
[19] Fix | Delete
$menu_items = $fs->get_menu_items();
[20] Fix | Delete
[21] Fix | Delete
$show_settings_with_tabs = $fs->show_settings_with_tabs();
[22] Fix | Delete
[23] Fix | Delete
$tabs = array();
[24] Fix | Delete
foreach ( $menu_items as $priority => $items ) {
[25] Fix | Delete
foreach ( $items as $item ) {
[26] Fix | Delete
if ( ! $item['show_submenu'] ) {
[27] Fix | Delete
$submenu_name = ('wp-support-forum' === $item['menu_slug']) ?
[28] Fix | Delete
'support' :
[29] Fix | Delete
$item['menu_slug'];
[30] Fix | Delete
[31] Fix | Delete
if ( 'pricing' === $submenu_name && ! $fs->is_pricing_page_visible() ) {
[32] Fix | Delete
continue;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
if ( ! $show_settings_with_tabs || ! $fs->is_submenu_item_visible( $submenu_name, true ) ) {
[36] Fix | Delete
continue;
[37] Fix | Delete
}
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
$url = $fs->_get_admin_page_url( $item['menu_slug'] );
[41] Fix | Delete
$title = $item['menu_title'];
[42] Fix | Delete
[43] Fix | Delete
$tab = array(
[44] Fix | Delete
'label' => $title,
[45] Fix | Delete
'href' => $url,
[46] Fix | Delete
'slug' => $item['menu_slug'],
[47] Fix | Delete
);
[48] Fix | Delete
[49] Fix | Delete
if ( 'pricing' === $item['menu_slug'] && $fs->is_in_trial_promotion() ) {
[50] Fix | Delete
$tab['href'] .= '&trial=true';
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
$tabs[] = $tab;
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
?>
[57] Fix | Delete
<script type="text/javascript">
[58] Fix | Delete
(function ($) {
[59] Fix | Delete
$(document).ready(function () {
[60] Fix | Delete
var $wrap = $('.wrap');
[61] Fix | Delete
if (0 === $wrap.length) {
[62] Fix | Delete
$wrap = $('<div class="wrap">');
[63] Fix | Delete
$wrap.insertBefore($('#wpbody-content .clear'));
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
var
[67] Fix | Delete
$tabsWrapper = $('.nav-tab-wrapper'),
[68] Fix | Delete
$tabs = $tabsWrapper.find('.nav-tab'),
[69] Fix | Delete
$tab = null;
[70] Fix | Delete
[71] Fix | Delete
if (0 < $tabs.length) {
[72] Fix | Delete
// Tries to set $tab to the first inactive tab.
[73] Fix | Delete
for (var i = 0; i < $tabs.length; i++) {
[74] Fix | Delete
$tab = $($tabs[i]);
[75] Fix | Delete
[76] Fix | Delete
if (!$tab.hasClass('nav-tab-active')) {
[77] Fix | Delete
break;
[78] Fix | Delete
}
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
<?php if (0 < count( $tabs )) : ?>
[83] Fix | Delete
if (null == $tab) {
[84] Fix | Delete
// No tabs found, therefore, create new tabs section if required.
[85] Fix | Delete
var $h1 = $wrap.find('h1');
[86] Fix | Delete
[87] Fix | Delete
$tabsWrapper = $('<h2 class="nav-tab-wrapper"></h2>');
[88] Fix | Delete
[89] Fix | Delete
if (0 < $h1.length) {
[90] Fix | Delete
$tabsWrapper.insertAfter($h1);
[91] Fix | Delete
} else if (0 < $wrap.length) {
[92] Fix | Delete
$wrap.prepend($tabsWrapper);
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
$tab = $('<a href="#" class="nav-tab"></a>');
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
// Create a clone.
[99] Fix | Delete
$tab = $tab.clone();
[100] Fix | Delete
// Open in current page.
[101] Fix | Delete
$tab.removeAttr('target');
[102] Fix | Delete
$tab.removeClass('nav-tab-active');
[103] Fix | Delete
$tab.addClass('fs-tab');
[104] Fix | Delete
$tab.addClass('<?php echo $fs->get_unique_affix() ?>');
[105] Fix | Delete
[106] Fix | Delete
var $tabClone = null;
[107] Fix | Delete
[108] Fix | Delete
<?php $freemius_context_page = null ?>
[109] Fix | Delete
[110] Fix | Delete
<?php foreach ($tabs as $tab) : ?>
[111] Fix | Delete
<?php $is_support_tab = ( 'wp-support-forum' == $tab['slug'] ) ?>
[112] Fix | Delete
// Add the Freemius tabs.
[113] Fix | Delete
$tabClone = $tab.clone();
[114] Fix | Delete
$tabClone.html(<?php echo json_encode( $tab['label'] ) ?>)
[115] Fix | Delete
.attr('href', '<?php echo $is_support_tab ? $fs->get_support_forum_url() : $tab['href'] ?>')
[116] Fix | Delete
.appendTo($tabsWrapper)
[117] Fix | Delete
// Remove any custom click events.
[118] Fix | Delete
.off('click', '**')
[119] Fix | Delete
.addClass('<?php echo $tab['slug'] ?>')
[120] Fix | Delete
// Avoid tab click triggering parent events.
[121] Fix | Delete
.click(function (e) {
[122] Fix | Delete
e.stopPropagation();
[123] Fix | Delete
});
[124] Fix | Delete
[125] Fix | Delete
<?php if ($is_support_tab) : ?>
[126] Fix | Delete
// Open support in a new tab/page.
[127] Fix | Delete
$tabClone.attr('target', '_blank');
[128] Fix | Delete
<?php endif ?>
[129] Fix | Delete
[130] Fix | Delete
<?php if ($fs->is_admin_page( $tab['slug'] )) : ?>
[131] Fix | Delete
<?php $freemius_context_page = $tab['slug'] ?>
[132] Fix | Delete
// Select the relevant Freemius tab.
[133] Fix | Delete
$tabs.removeClass('nav-tab-active');
[134] Fix | Delete
$tabClone.addClass('nav-tab-active');
[135] Fix | Delete
[136] Fix | Delete
<?php if (in_array( $freemius_context_page, array( 'pricing', 'contact', 'checkout' ) )) : ?>
[137] Fix | Delete
// Add AJAX loader.
[138] Fix | Delete
$tabClone.prepend('<i class="fs-ajax-spinner"></i>');
[139] Fix | Delete
// Hide loader after content fully loaded.
[140] Fix | Delete
$('.wrap i' + 'frame').load(function () {
[141] Fix | Delete
$(".fs-ajax-spinner").hide();
[142] Fix | Delete
});
[143] Fix | Delete
<?php endif ?>
[144] Fix | Delete
[145] Fix | Delete
// Fix URLs that are starting with a hashtag.
[146] Fix | Delete
$tabs.each(function (j, tab) {
[147] Fix | Delete
if (0 === $(tab).attr('href').indexOf('#')) {
[148] Fix | Delete
$(tab).attr('href', '<?php echo esc_js( $fs->main_menu_url() ) ?>' + $(tab).attr('href'));
[149] Fix | Delete
}
[150] Fix | Delete
});
[151] Fix | Delete
<?php endif ?>
[152] Fix | Delete
<?php endforeach ?>
[153] Fix | Delete
[154] Fix | Delete
var selectTab = function ($tab) {
[155] Fix | Delete
$(window).load(function () {
[156] Fix | Delete
$tab.click();
[157] Fix | Delete
[158] Fix | Delete
// Scroll to the top since the browser will auto scroll to the anchor.
[159] Fix | Delete
document.body.scrollTop = 0;
[160] Fix | Delete
document.body.scrollLeft = 0;
[161] Fix | Delete
// window.scrollTo(0,0);
[162] Fix | Delete
});
[163] Fix | Delete
};
[164] Fix | Delete
[165] Fix | Delete
// If the URL is loaded with a hashtag, find the context tab and select it.
[166] Fix | Delete
if (window.location.hash) {
[167] Fix | Delete
for (var j = 0; j < $tabs.length; j++) {
[168] Fix | Delete
if (window.location.hash === $($tabs[j]).attr('href')) {
[169] Fix | Delete
selectTab($($tabs[j]));
[170] Fix | Delete
break;
[171] Fix | Delete
}
[172] Fix | Delete
}
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
<?php if (is_string( $freemius_context_page ) && in_array( $freemius_context_page, array(
[176] Fix | Delete
'pricing',
[177] Fix | Delete
'contact',
[178] Fix | Delete
'checkout'
[179] Fix | Delete
) )) : ?>
[180] Fix | Delete
// Add margin to the upper section of the tabs to give extra space for the HTTPS header.
[181] Fix | Delete
// @todo This code assumes that the wrapper style is fully loaded, if there's a stylesheet that is not loaded via the HTML head, it may cause unpredicted margin-top.
[182] Fix | Delete
var $tabsWrap = $tabsWrapper.parents('.wrap');
[183] Fix | Delete
$tabsWrap.css('marginTop', (parseInt($tabsWrap.css('marginTop'), 10) + 30) + 'px');
[184] Fix | Delete
<?php endif ?>
[185] Fix | Delete
<?php endif ?>
[186] Fix | Delete
});
[187] Fix | Delete
})(jQuery);
[188] Fix | Delete
</script>
[189] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function