文件操作 - syncPageTitleTemplate.js
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/extendify/src/PageCreator/util/syncPageTitleTemplate.js
编辑文件内容
import { updatePageTitlePattern } from '@page-creator/api/WPApi'; import apiFetch from '@wordpress/api-fetch'; import { decodeEntities } from '@wordpress/html-entities'; /** * Overwrite the theme’s default “page-with-title” template with the * stored page-title pattern, but only if the template has never been */ export const syncPageTitleTemplate = async (pageTitlePattern) => { if (!pageTitlePattern) return; const tpl = await apiFetch({ path: '/wp/v2/templates/extendable//page-with-title', }); if (tpl.source === 'theme') { await updatePageTitlePattern(decodeEntities(pageTitlePattern)); } };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件