✏️ 编辑:class-export-logger.php
路径:
/home/forge/kingkrunch.com/wp/wp-content/plugins/simple-history/loggers/class-export-logger.php
大小:1.4 KB · 修改:2026-09-25 00:42:29 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php namespace Simple_History\Loggers; use Simple_History\Helpers; /** * Logs WordPress exports */ class Export_Logger extends Logger { /** @var string Logger slug */ public $slug = 'SimpleExportLogger'; /** * Get array with information about this logger * * @return array */ public function get_info() { return array( 'name' => __( 'Export Logger', 'simple-history' ), 'description' => __( 'Logs updates to WordPress export', 'simple-history' ), 'capability' => 'export', 'messages' => array( 'created_export' => __( 'Created XML export', 'simple-history' ), ), 'labels' => array( 'search' => array( 'label' => _x( 'Export', 'Export logger: search', 'simple-history' ), 'options' => array( _x( 'Created exports', 'Export logger: search', 'simple-history' ) => array( 'created_export', ), ), ), ), ); } /** * Called when logger is loaded */ public function loaded() { add_action( 'export_wp', array( $this, 'on_export_wp' ), 10, 1 ); } /** * Called when export is created. * Fired from filter "export_wp". * * @param array $args Arguments passed to export_wp(). */ public function on_export_wp( $args ) { $content = $args['content'] ?? ''; $this->info_message( 'created_export', array( 'export_content' => $content, 'export_args' => Helpers::json_encode( $args ), ) ); } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF