wp_atom_server
云策文档标注
概述
本文档介绍了 WordPress 中已弃用的 wp_atom_server 类及其魔术方法 __call 和 __callStatic,这些方法在 3.5.0 版本后被标记为过时,建议使用 Atom Publishing Protocol 插件替代。
关键要点
- wp_atom_server 类包含 __call 和 __callStatic 两个魔术方法,用于处理未定义的方法调用。
- 这些方法在调用时会触发 _deprecated_function 函数,提示从 WordPress 3.5.0 起已弃用,并推荐使用 Atom Publishing Protocol 插件。
- 开发者应避免直接使用 wp_atom_server 类,转而采用插件或其他现代方法来实现相关功能。
代码示例
public function __call( $name, $arguments ) {
_deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' );
}
public static function __callStatic( $name, $arguments ) {
_deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' );
}
原文内容
Methods
| Name | Description |
|---|---|
| wp_atom_server::__call | – |
| wp_atom_server::__callStatic | – |
Source
class wp_atom_server {
public function __call( $name, $arguments ) {
_deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' );
}
public static function __callStatic( $name, $arguments ) {
_deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' );
}
}