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.../public_h.../wp-admin/js
File: updates.js
if ( wp.updates.maybeHandleCredentialError( response, 'delete-plugin' ) ) {
[1500] Fix | Delete
return;
[1501] Fix | Delete
}
[1502] Fix | Delete
[1503] Fix | Delete
// Add a plugin update row if it doesn't exist yet.
[1504] Fix | Delete
if ( ! $pluginUpdateRow.length ) {
[1505] Fix | Delete
$plugin.addClass( 'update' ).after(
[1506] Fix | Delete
pluginUpdateRow( {
[1507] Fix | Delete
slug: response.slug,
[1508] Fix | Delete
plugin: response.plugin || response.slug,
[1509] Fix | Delete
colspan: $( '#bulk-action-form' ).find( 'thead th:not(.hidden), thead td' ).length,
[1510] Fix | Delete
content: noticeContent
[1511] Fix | Delete
} )
[1512] Fix | Delete
);
[1513] Fix | Delete
} else {
[1514] Fix | Delete
[1515] Fix | Delete
// Remove previous error messages, if any.
[1516] Fix | Delete
$pluginUpdateRow.find( '.notice-error' ).remove();
[1517] Fix | Delete
[1518] Fix | Delete
$pluginUpdateRow.find( '.plugin-update' ).append( noticeContent );
[1519] Fix | Delete
}
[1520] Fix | Delete
[1521] Fix | Delete
$document.trigger( 'wp-plugin-delete-error', response );
[1522] Fix | Delete
};
[1523] Fix | Delete
[1524] Fix | Delete
/**
[1525] Fix | Delete
* Sends an Ajax request to the server to update a theme.
[1526] Fix | Delete
*
[1527] Fix | Delete
* @since 4.6.0
[1528] Fix | Delete
*
[1529] Fix | Delete
* @param {Object} args Arguments.
[1530] Fix | Delete
* @param {string} args.slug Theme stylesheet.
[1531] Fix | Delete
* @param {updateThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.updateThemeSuccess
[1532] Fix | Delete
* @param {updateThemeError=} args.error Optional. Error callback. Default: wp.updates.updateThemeError
[1533] Fix | Delete
* @return {$.promise} A jQuery promise that represents the request,
[1534] Fix | Delete
* decorated with an abort() method.
[1535] Fix | Delete
*/
[1536] Fix | Delete
wp.updates.updateTheme = function( args ) {
[1537] Fix | Delete
var $notice;
[1538] Fix | Delete
[1539] Fix | Delete
args = _.extend( {
[1540] Fix | Delete
success: wp.updates.updateThemeSuccess,
[1541] Fix | Delete
error: wp.updates.updateThemeError
[1542] Fix | Delete
}, args );
[1543] Fix | Delete
[1544] Fix | Delete
if ( 'themes-network' === pagenow ) {
[1545] Fix | Delete
$notice = $( '[data-slug="' + args.slug + '"]' ).find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
[1546] Fix | Delete
[1547] Fix | Delete
} else if ( 'customize' === pagenow ) {
[1548] Fix | Delete
[1549] Fix | Delete
// Update the theme details UI.
[1550] Fix | Delete
$notice = $( '[data-slug="' + args.slug + '"].notice' ).removeClass( 'notice-large' );
[1551] Fix | Delete
[1552] Fix | Delete
$notice.find( 'h3' ).remove();
[1553] Fix | Delete
[1554] Fix | Delete
// Add the top-level UI, and update both.
[1555] Fix | Delete
$notice = $notice.add( $( '#customize-control-installed_theme_' + args.slug ).find( '.update-message' ) );
[1556] Fix | Delete
$notice = $notice.addClass( 'updating-message' ).find( 'p' );
[1557] Fix | Delete
[1558] Fix | Delete
} else {
[1559] Fix | Delete
$notice = $( '#update-theme' ).closest( '.notice' ).removeClass( 'notice-large' );
[1560] Fix | Delete
[1561] Fix | Delete
$notice.find( 'h3' ).remove();
[1562] Fix | Delete
[1563] Fix | Delete
$notice = $notice.add( $( '[data-slug="' + args.slug + '"]' ).find( '.update-message' ) );
[1564] Fix | Delete
$notice = $notice.addClass( 'updating-message' ).find( 'p' );
[1565] Fix | Delete
}
[1566] Fix | Delete
[1567] Fix | Delete
if ( $notice.html() !== __( 'Updating...' ) ) {
[1568] Fix | Delete
$notice.data( 'originaltext', $notice.html() );
[1569] Fix | Delete
}
[1570] Fix | Delete
[1571] Fix | Delete
wp.a11y.speak( __( 'Updating... please wait.' ) );
[1572] Fix | Delete
$notice.text( __( 'Updating...' ) );
[1573] Fix | Delete
[1574] Fix | Delete
$document.trigger( 'wp-theme-updating', args );
[1575] Fix | Delete
[1576] Fix | Delete
return wp.updates.ajax( 'update-theme', args );
[1577] Fix | Delete
};
[1578] Fix | Delete
[1579] Fix | Delete
/**
[1580] Fix | Delete
* Updates the UI appropriately after a successful theme update.
[1581] Fix | Delete
*
[1582] Fix | Delete
* @since 4.6.0
[1583] Fix | Delete
* @since 5.5.0 Auto-update "time to next update" text cleared.
[1584] Fix | Delete
*
[1585] Fix | Delete
* @param {Object} response
[1586] Fix | Delete
* @param {string} response.slug Slug of the theme to be updated.
[1587] Fix | Delete
* @param {Object} response.theme Updated theme.
[1588] Fix | Delete
* @param {string} response.oldVersion Old version of the theme.
[1589] Fix | Delete
* @param {string} response.newVersion New version of the theme.
[1590] Fix | Delete
*/
[1591] Fix | Delete
wp.updates.updateThemeSuccess = function( response ) {
[1592] Fix | Delete
var isModalOpen = $( 'body.modal-open' ).length,
[1593] Fix | Delete
$theme = $( '[data-slug="' + response.slug + '"]' ),
[1594] Fix | Delete
updatedMessage = {
[1595] Fix | Delete
className: 'updated-message notice-success notice-alt',
[1596] Fix | Delete
message: _x( 'Updated!', 'theme' )
[1597] Fix | Delete
},
[1598] Fix | Delete
$notice, newText;
[1599] Fix | Delete
[1600] Fix | Delete
if ( 'customize' === pagenow ) {
[1601] Fix | Delete
$theme = $( '.updating-message' ).siblings( '.theme-name' );
[1602] Fix | Delete
[1603] Fix | Delete
if ( $theme.length ) {
[1604] Fix | Delete
[1605] Fix | Delete
// Update the version number in the row.
[1606] Fix | Delete
newText = $theme.html().replace( response.oldVersion, response.newVersion );
[1607] Fix | Delete
$theme.html( newText );
[1608] Fix | Delete
}
[1609] Fix | Delete
[1610] Fix | Delete
$notice = $( '.theme-info .notice' ).add( wp.customize.control( 'installed_theme_' + response.slug ).container.find( '.theme' ).find( '.update-message' ) );
[1611] Fix | Delete
} else if ( 'themes-network' === pagenow ) {
[1612] Fix | Delete
$notice = $theme.find( '.update-message' );
[1613] Fix | Delete
[1614] Fix | Delete
// Update the version number in the row.
[1615] Fix | Delete
newText = $theme.find( '.theme-version-author-uri' ).html().replace( response.oldVersion, response.newVersion );
[1616] Fix | Delete
$theme.find( '.theme-version-author-uri' ).html( newText );
[1617] Fix | Delete
[1618] Fix | Delete
// Clear the "time to next auto-update" text.
[1619] Fix | Delete
$theme.find( '.auto-update-time' ).empty();
[1620] Fix | Delete
} else {
[1621] Fix | Delete
$notice = $( '.theme-info .notice' ).add( $theme.find( '.update-message' ) );
[1622] Fix | Delete
[1623] Fix | Delete
// Focus on Customize button after updating.
[1624] Fix | Delete
if ( isModalOpen ) {
[1625] Fix | Delete
$( '.load-customize:visible' ).trigger( 'focus' );
[1626] Fix | Delete
$( '.theme-info .theme-autoupdate' ).find( '.auto-update-time' ).empty();
[1627] Fix | Delete
} else {
[1628] Fix | Delete
$theme.find( '.load-customize' ).trigger( 'focus' );
[1629] Fix | Delete
}
[1630] Fix | Delete
}
[1631] Fix | Delete
[1632] Fix | Delete
wp.updates.addAdminNotice( _.extend( { selector: $notice }, updatedMessage ) );
[1633] Fix | Delete
wp.a11y.speak( __( 'Update completed successfully.' ) );
[1634] Fix | Delete
[1635] Fix | Delete
wp.updates.decrementCount( 'theme' );
[1636] Fix | Delete
[1637] Fix | Delete
$document.trigger( 'wp-theme-update-success', response );
[1638] Fix | Delete
[1639] Fix | Delete
// Show updated message after modal re-rendered.
[1640] Fix | Delete
if ( isModalOpen && 'customize' !== pagenow ) {
[1641] Fix | Delete
$( '.theme-info .theme-author' ).after( wp.updates.adminNotice( updatedMessage ) );
[1642] Fix | Delete
}
[1643] Fix | Delete
};
[1644] Fix | Delete
[1645] Fix | Delete
/**
[1646] Fix | Delete
* Updates the UI appropriately after a failed theme update.
[1647] Fix | Delete
*
[1648] Fix | Delete
* @since 4.6.0
[1649] Fix | Delete
*
[1650] Fix | Delete
* @param {Object} response Response from the server.
[1651] Fix | Delete
* @param {string} response.slug Slug of the theme to be updated.
[1652] Fix | Delete
* @param {string} response.errorCode Error code for the error that occurred.
[1653] Fix | Delete
* @param {string} response.errorMessage The error that occurred.
[1654] Fix | Delete
*/
[1655] Fix | Delete
wp.updates.updateThemeError = function( response ) {
[1656] Fix | Delete
var $theme = $( '[data-slug="' + response.slug + '"]' ),
[1657] Fix | Delete
errorMessage = sprintf(
[1658] Fix | Delete
/* translators: %s: Error string for a failed update. */
[1659] Fix | Delete
__( 'Update failed: %s' ),
[1660] Fix | Delete
response.errorMessage
[1661] Fix | Delete
),
[1662] Fix | Delete
$notice;
[1663] Fix | Delete
[1664] Fix | Delete
if ( ! wp.updates.isValidResponse( response, 'update' ) ) {
[1665] Fix | Delete
return;
[1666] Fix | Delete
}
[1667] Fix | Delete
[1668] Fix | Delete
if ( wp.updates.maybeHandleCredentialError( response, 'update-theme' ) ) {
[1669] Fix | Delete
return;
[1670] Fix | Delete
}
[1671] Fix | Delete
[1672] Fix | Delete
if ( 'customize' === pagenow ) {
[1673] Fix | Delete
$theme = wp.customize.control( 'installed_theme_' + response.slug ).container.find( '.theme' );
[1674] Fix | Delete
}
[1675] Fix | Delete
[1676] Fix | Delete
if ( 'themes-network' === pagenow ) {
[1677] Fix | Delete
$notice = $theme.find( '.update-message ' );
[1678] Fix | Delete
} else {
[1679] Fix | Delete
$notice = $( '.theme-info .notice' ).add( $theme.find( '.notice' ) );
[1680] Fix | Delete
[1681] Fix | Delete
$( 'body.modal-open' ).length ? $( '.load-customize:visible' ).trigger( 'focus' ) : $theme.find( '.load-customize' ).trigger( 'focus');
[1682] Fix | Delete
}
[1683] Fix | Delete
[1684] Fix | Delete
wp.updates.addAdminNotice( {
[1685] Fix | Delete
selector: $notice,
[1686] Fix | Delete
className: 'update-message notice-error notice-alt is-dismissible',
[1687] Fix | Delete
message: errorMessage
[1688] Fix | Delete
} );
[1689] Fix | Delete
[1690] Fix | Delete
wp.a11y.speak( errorMessage );
[1691] Fix | Delete
[1692] Fix | Delete
$document.trigger( 'wp-theme-update-error', response );
[1693] Fix | Delete
};
[1694] Fix | Delete
[1695] Fix | Delete
/**
[1696] Fix | Delete
* Sends an Ajax request to the server to install a theme.
[1697] Fix | Delete
*
[1698] Fix | Delete
* @since 4.6.0
[1699] Fix | Delete
*
[1700] Fix | Delete
* @param {Object} args
[1701] Fix | Delete
* @param {string} args.slug Theme stylesheet.
[1702] Fix | Delete
* @param {installThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.installThemeSuccess
[1703] Fix | Delete
* @param {installThemeError=} args.error Optional. Error callback. Default: wp.updates.installThemeError
[1704] Fix | Delete
* @return {$.promise} A jQuery promise that represents the request,
[1705] Fix | Delete
* decorated with an abort() method.
[1706] Fix | Delete
*/
[1707] Fix | Delete
wp.updates.installTheme = function( args ) {
[1708] Fix | Delete
var $message = $( '.theme-install[data-slug="' + args.slug + '"]' );
[1709] Fix | Delete
[1710] Fix | Delete
args = _.extend( {
[1711] Fix | Delete
success: wp.updates.installThemeSuccess,
[1712] Fix | Delete
error: wp.updates.installThemeError
[1713] Fix | Delete
}, args );
[1714] Fix | Delete
[1715] Fix | Delete
$message.addClass( 'updating-message' );
[1716] Fix | Delete
$message.parents( '.theme' ).addClass( 'focus' );
[1717] Fix | Delete
if ( $message.html() !== __( 'Installing...' ) ) {
[1718] Fix | Delete
$message.data( 'originaltext', $message.html() );
[1719] Fix | Delete
}
[1720] Fix | Delete
[1721] Fix | Delete
$message
[1722] Fix | Delete
.attr(
[1723] Fix | Delete
'aria-label',
[1724] Fix | Delete
sprintf(
[1725] Fix | Delete
/* translators: %s: Theme name and version. */
[1726] Fix | Delete
_x( 'Installing %s...', 'theme' ),
[1727] Fix | Delete
$message.data( 'name' )
[1728] Fix | Delete
)
[1729] Fix | Delete
)
[1730] Fix | Delete
.text( __( 'Installing...' ) );
[1731] Fix | Delete
[1732] Fix | Delete
wp.a11y.speak( __( 'Installing... please wait.' ) );
[1733] Fix | Delete
[1734] Fix | Delete
// Remove previous error messages, if any.
[1735] Fix | Delete
$( '.install-theme-info, [data-slug="' + args.slug + '"]' ).removeClass( 'theme-install-failed' ).find( '.notice.notice-error' ).remove();
[1736] Fix | Delete
[1737] Fix | Delete
$document.trigger( 'wp-theme-installing', args );
[1738] Fix | Delete
[1739] Fix | Delete
return wp.updates.ajax( 'install-theme', args );
[1740] Fix | Delete
};
[1741] Fix | Delete
[1742] Fix | Delete
/**
[1743] Fix | Delete
* Updates the UI appropriately after a successful theme install.
[1744] Fix | Delete
*
[1745] Fix | Delete
* @since 4.6.0
[1746] Fix | Delete
*
[1747] Fix | Delete
* @param {Object} response Response from the server.
[1748] Fix | Delete
* @param {string} response.slug Slug of the theme to be installed.
[1749] Fix | Delete
* @param {string} response.customizeUrl URL to the Customizer for the just installed theme.
[1750] Fix | Delete
* @param {string} response.activateUrl URL to activate the just installed theme.
[1751] Fix | Delete
*/
[1752] Fix | Delete
wp.updates.installThemeSuccess = function( response ) {
[1753] Fix | Delete
var $card = $( '.wp-full-overlay-header, [data-slug=' + response.slug + ']' ),
[1754] Fix | Delete
$message;
[1755] Fix | Delete
[1756] Fix | Delete
$document.trigger( 'wp-theme-install-success', response );
[1757] Fix | Delete
[1758] Fix | Delete
$message = $card.find( '.button-primary' )
[1759] Fix | Delete
.removeClass( 'updating-message' )
[1760] Fix | Delete
.addClass( 'updated-message disabled' )
[1761] Fix | Delete
.attr(
[1762] Fix | Delete
'aria-label',
[1763] Fix | Delete
sprintf(
[1764] Fix | Delete
/* translators: %s: Theme name and version. */
[1765] Fix | Delete
_x( '%s installed!', 'theme' ),
[1766] Fix | Delete
response.themeName
[1767] Fix | Delete
)
[1768] Fix | Delete
)
[1769] Fix | Delete
.text( _x( 'Installed!', 'theme' ) );
[1770] Fix | Delete
[1771] Fix | Delete
wp.a11y.speak( __( 'Installation completed successfully.' ) );
[1772] Fix | Delete
[1773] Fix | Delete
setTimeout( function() {
[1774] Fix | Delete
[1775] Fix | Delete
if ( response.activateUrl ) {
[1776] Fix | Delete
[1777] Fix | Delete
// Transform the 'Install' button into an 'Activate' button.
[1778] Fix | Delete
$message
[1779] Fix | Delete
.attr( 'href', response.activateUrl )
[1780] Fix | Delete
.removeClass( 'theme-install updated-message disabled' )
[1781] Fix | Delete
.addClass( 'activate' );
[1782] Fix | Delete
[1783] Fix | Delete
if ( 'themes-network' === pagenow ) {
[1784] Fix | Delete
$message
[1785] Fix | Delete
.attr(
[1786] Fix | Delete
'aria-label',
[1787] Fix | Delete
sprintf(
[1788] Fix | Delete
/* translators: %s: Theme name. */
[1789] Fix | Delete
_x( 'Network Activate %s', 'theme' ),
[1790] Fix | Delete
response.themeName
[1791] Fix | Delete
)
[1792] Fix | Delete
)
[1793] Fix | Delete
.text( __( 'Network Enable' ) );
[1794] Fix | Delete
} else {
[1795] Fix | Delete
$message
[1796] Fix | Delete
.attr(
[1797] Fix | Delete
'aria-label',
[1798] Fix | Delete
sprintf(
[1799] Fix | Delete
/* translators: %s: Theme name. */
[1800] Fix | Delete
_x( 'Activate %s', 'theme' ),
[1801] Fix | Delete
response.themeName
[1802] Fix | Delete
)
[1803] Fix | Delete
)
[1804] Fix | Delete
.text( _x( 'Activate', 'theme' ) );
[1805] Fix | Delete
}
[1806] Fix | Delete
}
[1807] Fix | Delete
[1808] Fix | Delete
if ( response.customizeUrl ) {
[1809] Fix | Delete
[1810] Fix | Delete
// Transform the 'Preview' button into a 'Live Preview' button.
[1811] Fix | Delete
$message.siblings( '.preview' ).replaceWith( function () {
[1812] Fix | Delete
return $( '<a>' )
[1813] Fix | Delete
.attr( 'href', response.customizeUrl )
[1814] Fix | Delete
.addClass( 'button load-customize' )
[1815] Fix | Delete
.text( __( 'Live Preview' ) );
[1816] Fix | Delete
} );
[1817] Fix | Delete
}
[1818] Fix | Delete
}, 1000 );
[1819] Fix | Delete
};
[1820] Fix | Delete
[1821] Fix | Delete
/**
[1822] Fix | Delete
* Updates the UI appropriately after a failed theme install.
[1823] Fix | Delete
*
[1824] Fix | Delete
* @since 4.6.0
[1825] Fix | Delete
*
[1826] Fix | Delete
* @param {Object} response Response from the server.
[1827] Fix | Delete
* @param {string} response.slug Slug of the theme to be installed.
[1828] Fix | Delete
* @param {string} response.errorCode Error code for the error that occurred.
[1829] Fix | Delete
* @param {string} response.errorMessage The error that occurred.
[1830] Fix | Delete
*/
[1831] Fix | Delete
wp.updates.installThemeError = function( response ) {
[1832] Fix | Delete
var $card, $button,
[1833] Fix | Delete
errorMessage = sprintf(
[1834] Fix | Delete
/* translators: %s: Error string for a failed installation. */
[1835] Fix | Delete
__( 'Installation failed: %s' ),
[1836] Fix | Delete
response.errorMessage
[1837] Fix | Delete
),
[1838] Fix | Delete
$message = wp.updates.adminNotice( {
[1839] Fix | Delete
className: 'update-message notice-error notice-alt',
[1840] Fix | Delete
message: errorMessage
[1841] Fix | Delete
} );
[1842] Fix | Delete
[1843] Fix | Delete
if ( ! wp.updates.isValidResponse( response, 'install' ) ) {
[1844] Fix | Delete
return;
[1845] Fix | Delete
}
[1846] Fix | Delete
[1847] Fix | Delete
if ( wp.updates.maybeHandleCredentialError( response, 'install-theme' ) ) {
[1848] Fix | Delete
return;
[1849] Fix | Delete
}
[1850] Fix | Delete
[1851] Fix | Delete
if ( 'customize' === pagenow ) {
[1852] Fix | Delete
if ( $document.find( 'body' ).hasClass( 'modal-open' ) ) {
[1853] Fix | Delete
$button = $( '.theme-install[data-slug="' + response.slug + '"]' );
[1854] Fix | Delete
$card = $( '.theme-overlay .theme-info' ).prepend( $message );
[1855] Fix | Delete
} else {
[1856] Fix | Delete
$button = $( '.theme-install[data-slug="' + response.slug + '"]' );
[1857] Fix | Delete
$card = $button.closest( '.theme' ).addClass( 'theme-install-failed' ).append( $message );
[1858] Fix | Delete
}
[1859] Fix | Delete
wp.customize.notifications.remove( 'theme_installing' );
[1860] Fix | Delete
} else {
[1861] Fix | Delete
if ( $document.find( 'body' ).hasClass( 'full-overlay-active' ) ) {
[1862] Fix | Delete
$button = $( '.theme-install[data-slug="' + response.slug + '"]' );
[1863] Fix | Delete
$card = $( '.install-theme-info' ).prepend( $message );
[1864] Fix | Delete
} else {
[1865] Fix | Delete
$card = $( '[data-slug="' + response.slug + '"]' ).removeClass( 'focus' ).addClass( 'theme-install-failed' ).append( $message );
[1866] Fix | Delete
$button = $card.find( '.theme-install' );
[1867] Fix | Delete
}
[1868] Fix | Delete
}
[1869] Fix | Delete
[1870] Fix | Delete
$button
[1871] Fix | Delete
.removeClass( 'updating-message' )
[1872] Fix | Delete
.attr(
[1873] Fix | Delete
'aria-label',
[1874] Fix | Delete
sprintf(
[1875] Fix | Delete
/* translators: %s: Theme name and version. */
[1876] Fix | Delete
_x( '%s installation failed', 'theme' ),
[1877] Fix | Delete
$button.data( 'name' )
[1878] Fix | Delete
)
[1879] Fix | Delete
)
[1880] Fix | Delete
.text( __( 'Installation failed.' ) );
[1881] Fix | Delete
[1882] Fix | Delete
wp.a11y.speak( errorMessage, 'assertive' );
[1883] Fix | Delete
[1884] Fix | Delete
$document.trigger( 'wp-theme-install-error', response );
[1885] Fix | Delete
};
[1886] Fix | Delete
[1887] Fix | Delete
/**
[1888] Fix | Delete
* Sends an Ajax request to the server to delete a theme.
[1889] Fix | Delete
*
[1890] Fix | Delete
* @since 4.6.0
[1891] Fix | Delete
*
[1892] Fix | Delete
* @param {Object} args
[1893] Fix | Delete
* @param {string} args.slug Theme stylesheet.
[1894] Fix | Delete
* @param {deleteThemeSuccess=} args.success Optional. Success callback. Default: wp.updates.deleteThemeSuccess
[1895] Fix | Delete
* @param {deleteThemeError=} args.error Optional. Error callback. Default: wp.updates.deleteThemeError
[1896] Fix | Delete
* @return {$.promise} A jQuery promise that represents the request,
[1897] Fix | Delete
* decorated with an abort() method.
[1898] Fix | Delete
*/
[1899] Fix | Delete
wp.updates.deleteTheme = function( args ) {
[1900] Fix | Delete
var $button;
[1901] Fix | Delete
[1902] Fix | Delete
if ( 'themes' === pagenow ) {
[1903] Fix | Delete
$button = $( '.theme-actions .delete-theme' );
[1904] Fix | Delete
} else if ( 'themes-network' === pagenow ) {
[1905] Fix | Delete
$button = $( '[data-slug="' + args.slug + '"]' ).find( '.row-actions a.delete' );
[1906] Fix | Delete
}
[1907] Fix | Delete
[1908] Fix | Delete
args = _.extend( {
[1909] Fix | Delete
success: wp.updates.deleteThemeSuccess,
[1910] Fix | Delete
error: wp.updates.deleteThemeError
[1911] Fix | Delete
}, args );
[1912] Fix | Delete
[1913] Fix | Delete
if ( $button && $button.html() !== __( 'Deleting...' ) ) {
[1914] Fix | Delete
$button
[1915] Fix | Delete
.data( 'originaltext', $button.html() )
[1916] Fix | Delete
.text( __( 'Deleting...' ) );
[1917] Fix | Delete
}
[1918] Fix | Delete
[1919] Fix | Delete
wp.a11y.speak( __( 'Deleting...' ) );
[1920] Fix | Delete
[1921] Fix | Delete
// Remove previous error messages, if any.
[1922] Fix | Delete
$( '.theme-info .update-message' ).remove();
[1923] Fix | Delete
[1924] Fix | Delete
$document.trigger( 'wp-theme-deleting', args );
[1925] Fix | Delete
[1926] Fix | Delete
return wp.updates.ajax( 'delete-theme', args );
[1927] Fix | Delete
};
[1928] Fix | Delete
[1929] Fix | Delete
/**
[1930] Fix | Delete
* Updates the UI appropriately after a successful theme deletion.
[1931] Fix | Delete
*
[1932] Fix | Delete
* @since 4.6.0
[1933] Fix | Delete
*
[1934] Fix | Delete
* @param {Object} response Response from the server.
[1935] Fix | Delete
* @param {string} response.slug Slug of the theme that was deleted.
[1936] Fix | Delete
*/
[1937] Fix | Delete
wp.updates.deleteThemeSuccess = function( response ) {
[1938] Fix | Delete
var $themeRows = $( '[data-slug="' + response.slug + '"]' );
[1939] Fix | Delete
[1940] Fix | Delete
if ( 'themes-network' === pagenow ) {
[1941] Fix | Delete
[1942] Fix | Delete
// Removes the theme and updates rows.
[1943] Fix | Delete
$themeRows.css( { backgroundColor: '#faafaa' } ).fadeOut( 350, function() {
[1944] Fix | Delete
var $views = $( '.subsubsub' ),
[1945] Fix | Delete
$themeRow = $( this ),
[1946] Fix | Delete
themes = settings.themes,
[1947] Fix | Delete
deletedRow = wp.template( 'item-deleted-row' );
[1948] Fix | Delete
[1949] Fix | Delete
if ( ! $themeRow.hasClass( 'plugin-update-tr' ) ) {
[1950] Fix | Delete
$themeRow.after(
[1951] Fix | Delete
deletedRow( {
[1952] Fix | Delete
slug: response.slug,
[1953] Fix | Delete
colspan: $( '#bulk-action-form' ).find( 'thead th:not(.hidden), thead td' ).length,
[1954] Fix | Delete
name: $themeRow.find( '.theme-title strong' ).text()
[1955] Fix | Delete
} )
[1956] Fix | Delete
);
[1957] Fix | Delete
}
[1958] Fix | Delete
[1959] Fix | Delete
$themeRow.remove();
[1960] Fix | Delete
[1961] Fix | Delete
// Remove theme from update count.
[1962] Fix | Delete
if ( -1 !== _.indexOf( themes.upgrade, response.slug ) ) {
[1963] Fix | Delete
themes.upgrade = _.without( themes.upgrade, response.slug );
[1964] Fix | Delete
wp.updates.decrementCount( 'theme' );
[1965] Fix | Delete
}
[1966] Fix | Delete
[1967] Fix | Delete
// Remove from views.
[1968] Fix | Delete
if ( -1 !== _.indexOf( themes.disabled, response.slug ) ) {
[1969] Fix | Delete
themes.disabled = _.without( themes.disabled, response.slug );
[1970] Fix | Delete
if ( themes.disabled.length ) {
[1971] Fix | Delete
$views.find( '.disabled .count' ).text( '(' + themes.disabled.length + ')' );
[1972] Fix | Delete
} else {
[1973] Fix | Delete
$views.find( '.disabled' ).remove();
[1974] Fix | Delete
}
[1975] Fix | Delete
}
[1976] Fix | Delete
[1977] Fix | Delete
if ( -1 !== _.indexOf( themes['auto-update-enabled'], response.slug ) ) {
[1978] Fix | Delete
themes['auto-update-enabled'] = _.without( themes['auto-update-enabled'], response.slug );
[1979] Fix | Delete
if ( themes['auto-update-enabled'].length ) {
[1980] Fix | Delete
$views.find( '.auto-update-enabled .count' ).text( '(' + themes['auto-update-enabled'].length + ')' );
[1981] Fix | Delete
} else {
[1982] Fix | Delete
$views.find( '.auto-update-enabled' ).remove();
[1983] Fix | Delete
}
[1984] Fix | Delete
}
[1985] Fix | Delete
[1986] Fix | Delete
if ( -1 !== _.indexOf( themes['auto-update-disabled'], response.slug ) ) {
[1987] Fix | Delete
themes['auto-update-disabled'] = _.without( themes['auto-update-disabled'], response.slug );
[1988] Fix | Delete
if ( themes['auto-update-disabled'].length ) {
[1989] Fix | Delete
$views.find( '.auto-update-disabled .count' ).text( '(' + themes['auto-update-disabled'].length + ')' );
[1990] Fix | Delete
} else {
[1991] Fix | Delete
$views.find( '.auto-update-disabled' ).remove();
[1992] Fix | Delete
}
[1993] Fix | Delete
}
[1994] Fix | Delete
[1995] Fix | Delete
themes.all = _.without( themes.all, response.slug );
[1996] Fix | Delete
[1997] Fix | Delete
// There is always at least one theme available.
[1998] Fix | Delete
$views.find( '.all .count' ).text( '(' + themes.all.length + ')' );
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function