BeaverBuilder Wordpress更改幻灯片标题文本长度



我试图调整BeaverBuilder幻灯片属性,以阻止captionTextLength在默认200字符后被截断。我已经确定了控制这些变化的Plugin/bb-plugin/js/fl- slidesshow .js文件行8671中的行,但我不确定如何修改它,因为当更新被推送时,直接更改和上传到插件文件夹将被覆盖。似乎需要在function.php文件中添加一个自定义过滤函数,或者从下面的支持链接中添加自定义模块文件夹,但我真的不知道。

fl-slideshow.js文件中的代码片段。

/**
* The length of the caption to show. If greater than -1,
* the text will be truncated and a read more link will
* be displayed. If set to -1, the entire caption will be shown.
*
* @attribute captionTextLength
* @type Number
* @default 200
*/
captionTextLength: {
value: -1
},

我已经按照这里的方向- https://docs.wpbeaverbuilder.com/beaver-builder/developer/custom-modules/cmdg-18-override-built-in-modules/-修改模块,但没有说明方向来帮助修改模块目录外的js文件。如果你能给我指出正确的方向,我将不胜感激。

问题解决....解决方案-按照beaverbuilder文档- https://docs.wpbeaverbuilder.com/beaver-builder/developer/custom-modules/cmdg-18-override-built-in-modules上的说明创建自定义模块

CMDG 18:覆盖内置模块

任何内置模块都可以按照以下步骤在主题中重写。

Create a new folder in your theme's folder named fl-builder.
Create a new folder within your theme's fl-builder folder named modules.
Copy the entire module folder you wish to override from wp-content/plugins/bb-plugin/modules to your theme's fl-builder/modules folder.

注意

复制整个模块文件夹及其内容,而不仅仅是要覆盖的文件。

$this->add_js('fl-slideshow');像普通的wp_enqueue_script函数一样,通过添加wp_register_script来覆盖加载的js文件,以加载新的js脚本来代替旧的。

参考链接- https://docs.wpbeaverbuilder.com/beaver-builder/developer/custom-modules/cmdg-09-module-method-reference/

最新更新