У меня есть два файла "my-plugin.php" и "test.view.php" в корне пользовательского плагина.Содержимое файла «my-plugin.php»:
/*
Plugin Name: test
Plugin URI: test.com
Description: test
Version: 1.0
Author: test
Author URI: test
License: GPLv2+
Text Domain: conference
*/
class Test{
function __construct() {
add_shortcode('testShortCode' , array( $this, 'shortCode'));
}
function shortCode() {
return include 'test.view.php';
}
}
new Test();
И «test.view.php»:
<h1>Test</h1>
Я помещаю [testShortCode] на страницу, но после печатиТест я вижу "1" после него.![enter image description here](https://i.stack.imgur.com/qlvko.png)