1
我已經在divi生成器中創建了自定義模塊。下面給出的是代碼:如何在divi builder插件中爲自定義模塊添加字段
function ex_divi_child_theme_setup() {
if (class_exists('ET_Builder_Module')) {
class ET_Builder_Module_Image2 extends ET_Builder_Module {
function init() {
$this->name = __('Image_1', 'et_builder');
$this->slug = 'et_pb_image2';
// a whole bunch of php code that defines how the class functions
}
}
$et_builder_module_image2 = new ET_Builder_Module_Image2();
add_shortcode('et_pb_image2', array($et_builder_module_image2, '_shortcode_callback'));
}
}
add_action('et_builder_ready', 'ex_divi_child_theme_setup');
我需要添加字段到這個自定義模塊。我怎麼能做到這一點。
我試過了,它不適合我。 – Sandra