文件操作 - csg_gutenberg.php
返回文件管理
返回主菜单
删除本文件
文件: /root/Desktop/OLD/plugin-wordpress/companion-sitemap-generator/csg_gutenberg.php
编辑文件内容
<?php // Let's set up the gutenberg block :) function csg_sitemap_block() { $block_dir = dirname( __FILE__ ); $block_file = 'backend/block.js'; // Script wp_register_script( 'sitemap_block_script', plugins_url( $block_file, __FILE__ ), array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor' ), filemtime( "$block_dir/$block_file" ) ); // Styles wp_register_style( 'sitemap_block_style', plugins_url( 'backend/editor.css', __FILE__ ), array( 'wp-edit-blocks' ) ); // wp_register_style( // 'sitemap_block_frontend_style', // plugins_url( 'frontend/style.css', __FILE__ ), // array() // ); // Register the block register_block_type( 'sitemap/block', array( 'editor_script' => 'sitemap_block_script', 'editor_style' => 'sitemap_block_style', 'style' => 'sitemap_block_frontend_style', 'render_callback' => 'htmlsitemap_block_handler', 'attributes' => [ 'columns' => [ 'default' => '1', 'type' => 'string' ], 'orderby' => [ 'default' => 'date', 'type' => 'string' ], 'sort' => [ 'default' => 'asc', 'type' => 'string' ] ] ) ); } add_action( 'init', 'csg_sitemap_block' ); // Block handler function htmlsitemap_block_handler( $attributes ) { return htmlsitemap( $attributes['columns'], $attributes['orderby'], $attributes['sort'] ); }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件