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.../plugins/advanced.../admin/assets/js
File: admin.js
const tbody = jQuery( '#mapi-table-wrap tbody' )
[1500] Fix | Delete
[1501] Fix | Delete
if ( selectedId ) {
[1502] Fix | Delete
const selectedRows = tbody.find( 'tr[data-slotid="' + selectedId + '"]' )
[1503] Fix | Delete
if ( selectedRows.length ) {
[1504] Fix | Delete
return selectedRows
[1505] Fix | Delete
}
[1506] Fix | Delete
}
[1507] Fix | Delete
return null
[1508] Fix | Delete
},
[1509] Fix | Delete
openExternalAdsList: function () {
[1510] Fix | Delete
const network = AdvancedAdsAdmin.AdImporter.adNetwork
[1511] Fix | Delete
network.openSelector()
[1512] Fix | Delete
[1513] Fix | Delete
jQuery( '.mapi-insert-code' ).css( 'display', 'inline' )
[1514] Fix | Delete
jQuery( '.mapi-open-selector' ).css( 'display', 'none' )
[1515] Fix | Delete
jQuery( '.mapi-close-selector-link' ).css( 'display', 'inline' )
[1516] Fix | Delete
jQuery( '.advads-adsense-code' ).css( 'display', 'none' )
[1517] Fix | Delete
jQuery( '#remote-ad-unsupported-ad-type' ).css( 'display', 'none' )
[1518] Fix | Delete
[1519] Fix | Delete
AdvancedAdsAdmin.AdImporter.highlightSelectedRowInExternalAdsList( network.hideIdle )
[1520] Fix | Delete
[1521] Fix | Delete
var SNT = network.getCustomInputs()
[1522] Fix | Delete
SNT.css( 'display', 'none' )
[1523] Fix | Delete
[1524] Fix | Delete
jQuery( '#mapi-wrap' ).css( 'display', 'block' )
[1525] Fix | Delete
[1526] Fix | Delete
if ( ! network.fetchedExternalAds ) {
[1527] Fix | Delete
network.fetchedExternalAds = true
[1528] Fix | Delete
const nbUnits = jQuery( '#mapi-table-wrap tbody tr[data-slotid]' ).length
[1529] Fix | Delete
if ( nbUnits == 0 ) {
[1530] Fix | Delete
//usually we start with a preloaded list.
[1531] Fix | Delete
//only reload, when the count is zero (true for new accounts).
[1532] Fix | Delete
AdvancedAdsAdmin.AdImporter.refreshAds()
[1533] Fix | Delete
}
[1534] Fix | Delete
}
[1535] Fix | Delete
jQuery( '#wpwrap' ).trigger( 'advads-mapi-adlist-opened' );
[1536] Fix | Delete
},
[1537] Fix | Delete
/**
[1538] Fix | Delete
* will be called every time the ad type is changed.
[1539] Fix | Delete
* required for onBlur detection
[1540] Fix | Delete
*/
[1541] Fix | Delete
onChangedAdType: function () {
[1542] Fix | Delete
if ( AdvancedAdsAdmin.AdImporter.adNetwork ) {
[1543] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork.onBlur()
[1544] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork = null
[1545] Fix | Delete
}
[1546] Fix | Delete
},
[1547] Fix | Delete
setup: function ( adNetwork ) {
[1548] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork = adNetwork
[1549] Fix | Delete
adNetwork.onSelected()
[1550] Fix | Delete
if ( AdvancedAdsAdmin.AdImporter.isSetup ) {
[1551] Fix | Delete
AdvancedAdsAdmin.AdImporter.highlightSelectedRowInExternalAdsList()
[1552] Fix | Delete
return
[1553] Fix | Delete
}
[1554] Fix | Delete
AdvancedAdsAdmin.AdImporter.isSetup = true
[1555] Fix | Delete
[1556] Fix | Delete
jQuery( document ).on( 'click', '.prevent-default', function ( ev ) { ev.preventDefault() } )
[1557] Fix | Delete
[1558] Fix | Delete
// handle clicks for the "insert new ... code" anchor
[1559] Fix | Delete
jQuery( document ).on( 'click', '.mapi-insert-code', function ( e ) {
[1560] Fix | Delete
e.preventDefault()
[1561] Fix | Delete
jQuery( '#remote-ad-unsupported-ad-type' ).css( 'display', 'none' );
[1562] Fix | Delete
jQuery( '.advads-adsense-code' ).show()
[1563] Fix | Delete
jQuery( '.mapi-open-selector' ).css( 'display', 'inline' )
[1564] Fix | Delete
jQuery( '.mapi-close-selector-link' ).css( 'display', 'inline' )
[1565] Fix | Delete
jQuery( '.mapi-insert-code' ).css( 'display', 'none' );
[1566] Fix | Delete
jQuery( '#mapi-wrap' ).css( 'display', 'none' )
[1567] Fix | Delete
var SNT = AdvancedAdsAdmin.AdImporter.adNetwork.getCustomInputs()
[1568] Fix | Delete
SNT.css( 'display', 'none' )
[1569] Fix | Delete
} )
[1570] Fix | Delete
[1571] Fix | Delete
// handle clicks for the "get ad code from your linked account" anchor
[1572] Fix | Delete
jQuery( document ).on( 'click', '.mapi-open-selector a', function () {
[1573] Fix | Delete
AdvancedAdsAdmin.AdImporter.openExternalAdsList()
[1574] Fix | Delete
} )
[1575] Fix | Delete
[1576] Fix | Delete
// the close button of the ad unit list
[1577] Fix | Delete
jQuery( document ).on( 'click', '#mapi-close-selector,.mapi-close-selector-link', function () {
[1578] Fix | Delete
jQuery( '#remote-ad-unsupported-ad-type' ).css( 'display', 'none' );
[1579] Fix | Delete
AdvancedAdsAdmin.AdImporter.manualSetup()
[1580] Fix | Delete
} )
[1581] Fix | Delete
[1582] Fix | Delete
//the individual rows of the ad units may contain elements with the mapiaction class
[1583] Fix | Delete
jQuery( document ).on( 'click', '.mapiaction', function ( ev ) {
[1584] Fix | Delete
var action = jQuery( this ).attr( 'data-mapiaction' )
[1585] Fix | Delete
switch ( action ) {
[1586] Fix | Delete
case 'updateList':
[1587] Fix | Delete
AdvancedAdsAdmin.AdImporter.refreshAds()
[1588] Fix | Delete
break
[1589] Fix | Delete
case 'getCode':
[1590] Fix | Delete
if ( jQuery( this ).hasClass( 'disabled' ) ) {
[1591] Fix | Delete
break
[1592] Fix | Delete
}
[1593] Fix | Delete
var slotId = jQuery( this ).attr( 'data-slotid' )
[1594] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork.selectAdFromList( slotId )
[1595] Fix | Delete
break
[1596] Fix | Delete
case 'updateCode':
[1597] Fix | Delete
var slotId = jQuery( this ).attr( 'data-slotid' )
[1598] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork.updateAdFromList( slotId )
[1599] Fix | Delete
break
[1600] Fix | Delete
case 'toggleidle':
[1601] Fix | Delete
if ( 'undefined' != typeof AdvancedAdsAdmin.AdImporter.adNetwork.getMapiAction && 'function' == typeof AdvancedAdsAdmin.AdImporter.adNetwork.getMapiAction( 'toggleidle' ) ) {
[1602] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork.getMapiAction( 'toggleidle' )( ev, this );
[1603] Fix | Delete
} else {
[1604] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork.hideIdle = ! AdvancedAdsAdmin.AdImporter.adNetwork.hideIdle
[1605] Fix | Delete
AdvancedAdsAdmin.AdImporter.toggleIdleAds( AdvancedAdsAdmin.AdImporter.adNetwork.hideIdle )
[1606] Fix | Delete
const $inactiveNotice = jQuery( '#mapi-notice-inactive' );
[1607] Fix | Delete
if ( $inactiveNotice.length ) {
[1608] Fix | Delete
$inactiveNotice.toggle( AdvancedAdsAdmin.AdImporter.adNetwork.hideIdle );
[1609] Fix | Delete
}
[1610] Fix | Delete
break;
[1611] Fix | Delete
}
[1612] Fix | Delete
default:
[1613] Fix | Delete
}
[1614] Fix | Delete
} )
[1615] Fix | Delete
[1616] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork.onDomReady()
[1617] Fix | Delete
// AdvancedAdsAdmin.AdImporter.openExternalAdsList();
[1618] Fix | Delete
[1619] Fix | Delete
},
[1620] Fix | Delete
[1621] Fix | Delete
/**
[1622] Fix | Delete
* call this method to display the manual setup (if available for the current ad network)
[1623] Fix | Delete
* this method is an equivalent to the close ad list button.
[1624] Fix | Delete
*/
[1625] Fix | Delete
manualSetup () {
[1626] Fix | Delete
jQuery( '.mapi-open-selector,.advads-adsense-show-code' ).css( 'display', 'inline' )
[1627] Fix | Delete
jQuery( '.mapi-insert-code' ).css( 'display', 'inline' )
[1628] Fix | Delete
jQuery( '.mapi-close-selector-link' ).css( 'display', 'none' )
[1629] Fix | Delete
jQuery( '#mapi-wrap' ).css( 'display', 'none' )
[1630] Fix | Delete
[1631] Fix | Delete
var SNT = AdvancedAdsAdmin.AdImporter.adNetwork.getCustomInputs()
[1632] Fix | Delete
SNT.css( 'display', 'block' )
[1633] Fix | Delete
// hide custom layout key if type is not in-feed
[1634] Fix | Delete
if (jQuery('#unit-type').val() !== 'in-feed') {
[1635] Fix | Delete
jQuery('.advads-adsense-layout-key').css('display', 'none')
[1636] Fix | Delete
.next('div').css('display', 'none');
[1637] Fix | Delete
}
[1638] Fix | Delete
AdvancedAdsAdmin.AdImporter.adNetwork.onManualSetup()
[1639] Fix | Delete
},
[1640] Fix | Delete
[1641] Fix | Delete
setRemoteErrorMessage ( msg ) {
[1642] Fix | Delete
if ( ! msg ) jQuery( '#remote-ad-code-msg' ).empty()
[1643] Fix | Delete
else jQuery( '#remote-ad-code-msg' ).html( msg )
[1644] Fix | Delete
},
[1645] Fix | Delete
[1646] Fix | Delete
/**
[1647] Fix | Delete
* legacy method
[1648] Fix | Delete
*/
[1649] Fix | Delete
closeAdSelector: function () {
[1650] Fix | Delete
// close the ad unit selector
[1651] Fix | Delete
setTimeout( function () {
[1652] Fix | Delete
jQuery( '#mapi-wrap' ).animate(
[1653] Fix | Delete
{ height: 0, },
[1654] Fix | Delete
360,
[1655] Fix | Delete
function () {
[1656] Fix | Delete
jQuery( '.mapi-open-selector,.advads-adsense-show-code' ).css( 'display', 'inline' )
[1657] Fix | Delete
jQuery( '.mapi-close-selector-link' ).css( 'display', 'none' )
[1658] Fix | Delete
jQuery( '#mapi-wrap' ).css( {
[1659] Fix | Delete
display: 'none',
[1660] Fix | Delete
height: 'auto',
[1661] Fix | Delete
} )
[1662] Fix | Delete
const SNT = AdvancedAdsAdmin.AdImporter.adNetwork.getCustomInputs()
[1663] Fix | Delete
SNT.css( 'display', 'block' )
[1664] Fix | Delete
}
[1665] Fix | Delete
)
[1666] Fix | Delete
}, 80 )
[1667] Fix | Delete
[1668] Fix | Delete
},
[1669] Fix | Delete
[1670] Fix | Delete
/**
[1671] Fix | Delete
* legacy method
[1672] Fix | Delete
* updates the UI, (call if the selected unit is supported)
[1673] Fix | Delete
*/
[1674] Fix | Delete
unitIsNotSupported: function ( slotID ) {
[1675] Fix | Delete
jQuery( '#remote-ad-unsupported-ad-type' ).css( 'display', 'block' );
[1676] Fix | Delete
AdsenseMAPI.unsupportedUnits[ slotID ] = 1;
[1677] Fix | Delete
jQuery( '#unit-code' ).val( '' );
[1678] Fix | Delete
jQuery( '#unit-type' ).val( 'normal' );
[1679] Fix | Delete
jQuery( '#ad-layout-key' ).val( '' );
[1680] Fix | Delete
jQuery( 'tr[data-slotid^="ca-"]' ).removeClass( 'selected error' );
[1681] Fix | Delete
var $selectedRow = jQuery('tr[data-slotid="' + slotID + '"]');
[1682] Fix | Delete
$selectedRow.addClass('selected error').css('background-color', '');
[1683] Fix | Delete
this.scrollToSelectedRow($selectedRow);
[1684] Fix | Delete
},
[1685] Fix | Delete
[1686] Fix | Delete
/**
[1687] Fix | Delete
* legacy method
[1688] Fix | Delete
* updates the UI, (call if the selected unit is NOT supported)
[1689] Fix | Delete
*/
[1690] Fix | Delete
unitIsSupported: function ( slotID ) {
[1691] Fix | Delete
jQuery( '#remote-ad-unsupported-ad-type' ).css( 'display', 'none' )
[1692] Fix | Delete
if ( 'undefined' != typeof AdsenseMAPI.unsupportedUnits[ slotID ] ) {
[1693] Fix | Delete
delete AdsenseMAPI.unsupportedUnits[ slotID ]
[1694] Fix | Delete
}
[1695] Fix | Delete
jQuery( 'i[data-mapiaction="getCode"][data-slotid="' + slotID + '"]' ).removeClass( 'disabled' )
[1696] Fix | Delete
if ( jQuery( 'tr[data-slotid="' + slotID + '"] .unittype a' ).length ) {
[1697] Fix | Delete
var td = jQuery( 'tr[data-slotid="' + slotID + '"] .unittype' )
[1698] Fix | Delete
var content = jQuery( 'tr[data-slotid="' + slotID + '"] .unittype a' ).attr( 'data-type' )
[1699] Fix | Delete
td.text( content )
[1700] Fix | Delete
}
[1701] Fix | Delete
if ( jQuery( 'tr[data-slotid="' + slotID + '"] .unitsize a' ).length ) {
[1702] Fix | Delete
var td = jQuery( 'tr[data-slotid="' + slotID + '"] .unitsize' )
[1703] Fix | Delete
var content = jQuery( 'tr[data-slotid="' + slotID + '"] .unitsize a' ).attr( 'data-size' )
[1704] Fix | Delete
td.text( content )
[1705] Fix | Delete
}
[1706] Fix | Delete
},
[1707] Fix | Delete
[1708] Fix | Delete
/**
[1709] Fix | Delete
* legacy method
[1710] Fix | Delete
* updates the UI, (call if the selected unit is NOT supported)
[1711] Fix | Delete
*/
[1712] Fix | Delete
emptyMapiSelector: function ( msg ) {
[1713] Fix | Delete
const nag = '<div class="advads-notice-inline advads-error"><p>' + msg + '</p></div>'
[1714] Fix | Delete
jQuery( '#mapi-loading-overlay' ).css( 'display', 'none' )
[1715] Fix | Delete
jQuery( '#mapi-wrap' ).html( jQuery( nag ) )
[1716] Fix | Delete
},
[1717] Fix | Delete
[1718] Fix | Delete
/**
[1719] Fix | Delete
* legacy method
[1720] Fix | Delete
*/
[1721] Fix | Delete
refreshAds: function () {
[1722] Fix | Delete
const adNetwork = AdvancedAdsAdmin.AdImporter.adNetwork
[1723] Fix | Delete
jQuery( '#mapi-loading-overlay' ).css( 'display', 'block' );
[1724] Fix | Delete
jQuery.ajax( {
[1725] Fix | Delete
type: 'post',
[1726] Fix | Delete
url: ajaxurl,
[1727] Fix | Delete
data: adNetwork.getRefreshAdsParameters(),
[1728] Fix | Delete
success: function ( response, status, XHR ) {
[1729] Fix | Delete
if ( 'undefined' != typeof response.html ) {
[1730] Fix | Delete
jQuery( '#mapi-wrap' ).replaceWith( jQuery( response.html ) )
[1731] Fix | Delete
AdvancedAdsAdmin.AdImporter.openExternalAdsList()
[1732] Fix | Delete
} else if ( 'undefined' != typeof response.msg ) {
[1733] Fix | Delete
AdvancedAdsAdmin.AdImporter.emptyMapiSelector( response.msg )
[1734] Fix | Delete
}
[1735] Fix | Delete
if ( 'undefined' != typeof response.raw ) {
[1736] Fix | Delete
console.log( response.raw )
[1737] Fix | Delete
}
[1738] Fix | Delete
jQuery( '#mapi-loading-overlay' ).css( 'display', 'none' )
[1739] Fix | Delete
},
[1740] Fix | Delete
error: function ( request, status, err ) {
[1741] Fix | Delete
jQuery( '#mapi-loading-overlay' ).css( 'display', 'none' )
[1742] Fix | Delete
},
[1743] Fix | Delete
} )
[1744] Fix | Delete
[1745] Fix | Delete
},
[1746] Fix | Delete
[1747] Fix | Delete
toggleIdleAds: function ( hide ) {
[1748] Fix | Delete
if ( 'undefined' == typeof hide ) {
[1749] Fix | Delete
hide = true
[1750] Fix | Delete
}
[1751] Fix | Delete
AdvancedAdsAdmin.AdImporter.highlightSelectedRowInExternalAdsList( hide )
[1752] Fix | Delete
}
[1753] Fix | Delete
}
[1754] Fix | Delete
[1755] Fix | Delete
/**
[1756] Fix | Delete
* The "abstract" base class for handling external ad units
[1757] Fix | Delete
* Every ad unit will provide you with a set of methods to control the GUI and trigger requests to the server
[1758] Fix | Delete
* while editing an ad that is backed by this network. The main logic takes place in admin/assets/admin.js,
[1759] Fix | Delete
* and the methods in this class are the ones that needed abstraction, depending on the ad network. When you
[1760] Fix | Delete
* need new network-dependant features in the frontend, this is the place to add new methods.
[1761] Fix | Delete
*
[1762] Fix | Delete
* An AdvancedAdsAdNetwork uses these fields:
[1763] Fix | Delete
* id string The identifier, that is used for this network. Must match with the one used in the PHP code of Advanced Ads
[1764] Fix | Delete
* units array Holds the ad units of this network.
[1765] Fix | Delete
* vars map These are the variables that were transmitted from the underlying PHP class (method: append_javascript_data)
[1766] Fix | Delete
* hideIdle Remembers, wheter idle ads should be displayed in the list;
[1767] Fix | Delete
* fetchedExternalAds Remembers if the external ads list has already been loaded to prevent unneccesary requests
[1768] Fix | Delete
*/
[1769] Fix | Delete
class AdvancedAdsAdNetwork {
[1770] Fix | Delete
/**
[1771] Fix | Delete
* @param id string representing the id of this network. has to match the identifier of the PHP class
[1772] Fix | Delete
*/
[1773] Fix | Delete
constructor ( id ) {
[1774] Fix | Delete
this.id = id
[1775] Fix | Delete
this.units = []
[1776] Fix | Delete
this.vars = window[ id + 'AdvancedAdsJS' ]
[1777] Fix | Delete
this.hideIdle = true
[1778] Fix | Delete
this.fetchedExternalAds = false
[1779] Fix | Delete
}
[1780] Fix | Delete
[1781] Fix | Delete
/**
[1782] Fix | Delete
* will be called when an ad network is selected (ad type in edit ad)
[1783] Fix | Delete
*/
[1784] Fix | Delete
onSelected () {
[1785] Fix | Delete
console.error( 'Please override onSelected.' )
[1786] Fix | Delete
}
[1787] Fix | Delete
[1788] Fix | Delete
/**
[1789] Fix | Delete
* will be called when an ad network deselected (ad type in edit ad)
[1790] Fix | Delete
*/
[1791] Fix | Delete
onBlur () {
[1792] Fix | Delete
console.error( 'Please override onBlur.' )
[1793] Fix | Delete
}
[1794] Fix | Delete
[1795] Fix | Delete
/**
[1796] Fix | Delete
* opens the selector list containing the external ad units
[1797] Fix | Delete
*/
[1798] Fix | Delete
openSelector () {
[1799] Fix | Delete
console.error( 'Please override openSelector.' )
[1800] Fix | Delete
}
[1801] Fix | Delete
[1802] Fix | Delete
/**
[1803] Fix | Delete
* returns the network specific id of the currently selected ad unit
[1804] Fix | Delete
*/
[1805] Fix | Delete
getSelectedId () {
[1806] Fix | Delete
console.error( 'Please override getSelectedId.' )
[1807] Fix | Delete
}
[1808] Fix | Delete
[1809] Fix | Delete
/**
[1810] Fix | Delete
* will be called when an external ad unit has been selected from the selector list
[1811] Fix | Delete
* @param slotId string the external ad unit id
[1812] Fix | Delete
*/
[1813] Fix | Delete
selectAdFromList ( slotId ) {
[1814] Fix | Delete
console.error( 'Please override selectAdFromList.' )
[1815] Fix | Delete
}
[1816] Fix | Delete
[1817] Fix | Delete
/**
[1818] Fix | Delete
* will be called when an the update button of an external ad unit has been clicked
[1819] Fix | Delete
* TODO: decide wheter to remove this method. not required anymore - the button was removed.
[1820] Fix | Delete
* @param slotId string the external ad unit id
[1821] Fix | Delete
*/
[1822] Fix | Delete
updateAdFromList ( slotId ) {
[1823] Fix | Delete
console.error( 'Please override updateAdFromList.' )
[1824] Fix | Delete
}
[1825] Fix | Delete
[1826] Fix | Delete
/**
[1827] Fix | Delete
* return the POST params that you want to send to the server when requesting a refresh of the external ad units
[1828] Fix | Delete
* (like nonce and action and everything else that is required)
[1829] Fix | Delete
*/
[1830] Fix | Delete
getRefreshAdsParameters () {
[1831] Fix | Delete
console.error( 'Please override getRefreshAdsParameters.' )
[1832] Fix | Delete
}
[1833] Fix | Delete
[1834] Fix | Delete
/**
[1835] Fix | Delete
* return the jquery objects for all the custom html elements of this ad type
[1836] Fix | Delete
*/
[1837] Fix | Delete
getCustomInputs () {
[1838] Fix | Delete
console.error( 'Please override getCustomInputs.' )
[1839] Fix | Delete
}
[1840] Fix | Delete
[1841] Fix | Delete
/**
[1842] Fix | Delete
* what to do when the DOM is ready
[1843] Fix | Delete
*/
[1844] Fix | Delete
onDomReady () {
[1845] Fix | Delete
console.error( 'Please override onDomReady.' )
[1846] Fix | Delete
}
[1847] Fix | Delete
[1848] Fix | Delete
/**
[1849] Fix | Delete
* when you need custom behaviour for ad networks that support manual setup of ad units, override this method
[1850] Fix | Delete
*/
[1851] Fix | Delete
onManualSetup () {
[1852] Fix | Delete
//no console logging. this is optional
[1853] Fix | Delete
}
[1854] Fix | Delete
}
[1855] Fix | Delete
[1856] Fix | Delete
class AdvancedAdsExternalAdUnit {
[1857] Fix | Delete
[1858] Fix | Delete
}
[1859] Fix | Delete
[1860] Fix | Delete
/**
[1861] Fix | Delete
* todo: this looks like something we could use in general, but where to put it?
[1862] Fix | Delete
*/
[1863] Fix | Delete
jQuery( document ).ready( function () {
[1864] Fix | Delete
// delete an existing row by removing the parent tr tag
[1865] Fix | Delete
// todo: this could be moved to a general file
[1866] Fix | Delete
jQuery( document ).on( 'click', '.advads-tr-remove', function(){
[1867] Fix | Delete
jQuery( this ).closest( 'tr' ).remove();
[1868] Fix | Delete
});
[1869] Fix | Delete
});
[1870] Fix | Delete
[1871] Fix | Delete
/**
[1872] Fix | Delete
* If the jQuery function `escapeSelector` does not exist (add in jQuery 3.0) then add it.
[1873] Fix | Delete
*/
[1874] Fix | Delete
if ( typeof jQuery.escapeSelector === 'undefined' ) {
[1875] Fix | Delete
jQuery.escapeSelector = function ( selector ) {
[1876] Fix | Delete
return selector.replace(
[1877] Fix | Delete
// phpcs:ignore WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore,WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter,WordPress.WhiteSpace.OperatorSpacing.NoSpaceBeforeAmp,WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfterAmp -- PHPCS incorrectly reports whitespace errors for this regex
[1878] Fix | Delete
/([$%&()*+,./:;<=>?@\[\\\]^{|}~])/g,
[1879] Fix | Delete
'\\$1'
[1880] Fix | Delete
);
[1881] Fix | Delete
};
[1882] Fix | Delete
}
[1883] Fix | Delete
[1884] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function