文件操作 - utils.js
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/give/src/Promotions/InPluginUpsells/resources/js/utils.js
编辑文件内容
/** * Replaces double asterisks with `<strong>` tags. * * @param {string} text * @returns {string} */ export function transformStrong(text) { // Keep track of whether we're inside a <strong> tag. let startingTag = false; return text.replaceAll('**', () => { // Reverse the starting tag state to determine the current state. startingTag = !startingTag; // Return the appropriate tag. return startingTag ? '<strong>' : '</strong>'; }); } /** * Replaces double asterisks with `<em>` tags. * * @param {string} text * @returns {string} */ export function transformEmphasis(text) { // Keep track of whether we're inside an <em> tag. let startingTag = false; return text.replaceAll('**', () => { // Reverse the starting tag state to determine the current state. startingTag = !startingTag; // Return the appropriate tag. return startingTag ? '<em>' : '</em>'; }); } /** * Get an asset URL. * * @param {string} filename (without leading slash). * @returns {string} asset URL */ export const assetUrl = (filename) => `${window.GiveAddons.assetsUrl}${filename}`;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件