php - Custom element is always full width in WPBakery / Visual Composer
问题描述
I'm using the WordPress plugin WPBakery (was Visual Composer), where I've created custom elements.
In the editor side, any element can be placed in a row and it's columns can be defined from there, Is there a way to stop that?
For example, I have a custom element called hero
. This block will always be col-12
and prevent anything from being places besides this block.
Trying to prevent this:
Is this possible?
解决方案
我找到了解决方案。
我添加了“ob_start”和“return ob_get_clean();” 在文件包含之间,这对我有用。
public static function output($atts, $content = null)
{
extract(vc_map_get_attributes('myModule', $atts));
ob_start();
include_once('partials/public-display.php');
return ob_get_clean();
}
推荐阅读
- javascript - 这个 ES6 箭头功能代码块是做什么的?
- javascript - JS - 每次创建类时都会重新定义类成员函数吗?
- java - Javac 编译总是必须从包的顶部开始吗?(将包的路径传递给 javac ?)
- c++ - 使用 OpenCV 和 C++ 从图像中提取每个 HSV 值
- c# - 如何正确配置身份验证以在 ASP.NET Core 2.0 中使用外部 Restful API?
- html - 没有控件的移动视频不起作用
- marklogic - 没有单词限制的建议
- google-maps - 数据未从 KML 文件中显示
- kotlin - 将枚举成员转换为相应的文本
- hibernate - Criteria API Real time 在 Java 项目中的使用