我的错误日志中有一条警告
使用未定义的常量PLUGIN\\u PATH-假定为“PLUGIN\\u PATH”(这将在PHP的未来版本中引发错误)
当我在google上搜索时,我找不到答案,但似乎很多网站都公开显示了这个警告?
add_filter(\'single_template\', \'my_custom_template\');
function my_custom_template($single) {
global $post;
/* Checks for single template by post type */
if ( $post->post_type == \'POST TYPE NAME\' ) {
if ( file_exists( PLUGIN_PATH . \'/Custom_File.php\' ) ) {
return PLUGIN_PATH . \'/Custom_File.php\';
}
}
return $single;
}
这是我使用的代码:Custom Post Type Templates from Plugin Folder?有什么办法吗?