Export blocks with php code not working
-
I have created my own custom blocks and tried to export them to another theme with the php code and I have added it to functions.php. The code runs, but no actual importing happens.
edit: I love your plugin btw.
edit2: This is the actual code i added to functions.php:
if ( function_exists( ‘lazyblocks’ ) ) :lazyblocks()->add_block( array(
‘id’ => 341,
‘title’ => ‘Location’,
‘icon’ => ‘<svg xmlns=”http://www.w3.org/2000/svg” width=”24″ height=”24″ viewBox=”0 0 24 24″><path d=”M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z” /></svg>’,
‘keywords’ => array(
),
‘slug’ => ‘lazyblock/location’,
‘description’ => ‘Where to find us’,
‘category’ => ‘lazyblocks’,
‘category_label’ => ‘lazyblocks’,
‘supports’ => array(
‘customClassName’ => true,
‘anchor’ => false,
‘align’ => array(
0 => ‘wide’,
1 => ‘full’,
),
‘html’ => false,
‘multiple’ => true,
‘inserter’ => true,
),
‘ghostkit’ => array(
‘supports’ => array(
‘spacings’ => false,
‘display’ => false,
‘scrollReveal’ => false,
‘frame’ => false,
‘customCSS’ => false,
),
),
‘controls’ => array(
‘control_d8b8e247ce’ => array(
‘type’ => ‘text’,
‘name’ => ‘otsikko’,
‘default’ => ”,
‘label’ => ‘Otsikko’,
‘help’ => ”,
‘child_of’ => ”,
‘placement’ => ‘content’,
‘width’ => ‘100’,
‘hide_if_not_selected’ => ‘true’,
‘save_in_meta’ => ‘false’,
‘save_in_meta_name’ => ”,
‘required’ => ‘false’,
‘placeholder’ => ”,
‘characters_limit’ => ”,
),
‘control_2feb434f48’ => array(
‘type’ => ‘textarea’,
‘name’ => ‘osoiterivi_1’,
‘default’ => ”,
‘label’ => ‘Osoiterivi 1’,
‘help’ => ”,
‘child_of’ => ”,
‘placement’ => ‘content’,
‘width’ => ‘100’,
‘hide_if_not_selected’ => ‘true’,
‘save_in_meta’ => ‘false’,
‘save_in_meta_name’ => ”,
‘required’ => ‘false’,
‘placeholder’ => ”,
‘characters_limit’ => ”,
),
‘control_948bc1401e’ => array(
‘type’ => ‘textarea’,
‘name’ => ‘osoiterivi_2’,
‘default’ => ”,
‘label’ => ‘Osoiterivi 2’,
‘help’ => ”,
‘child_of’ => ”,
‘placement’ => ‘content’,
‘width’ => ‘100’,
‘hide_if_not_selected’ => ‘true’,
‘save_in_meta’ => ‘false’,
‘save_in_meta_name’ => ”,
‘required’ => ‘false’,
‘placeholder’ => ”,
‘characters_limit’ => ”,
),
‘control_c218f54faa’ => array(
‘type’ => ‘image’,
‘name’ => ‘kartta_1’,
‘default’ => ”,
‘label’ => ‘Kartta 1’,
‘help’ => ”,
‘child_of’ => ”,
‘placement’ => ‘content’,
‘width’ => ‘100’,
‘hide_if_not_selected’ => ‘true’,
‘save_in_meta’ => ‘false’,
‘save_in_meta_name’ => ”,
‘required’ => ‘false’,
‘placeholder’ => ”,
‘characters_limit’ => ”,
),
‘control_331a8240be’ => array(
‘type’ => ‘image’,
‘name’ => ‘kartta_2’,
‘default’ => ”,
‘label’ => ‘Kartta 2’,
‘help’ => ”,
‘child_of’ => ”,
‘placement’ => ‘content’,
‘width’ => ‘100’,
‘hide_if_not_selected’ => ‘true’,
‘save_in_meta’ => ‘false’,
‘save_in_meta_name’ => ”,
‘required’ => ‘false’,
‘placeholder’ => ”,
‘characters_limit’ => ”,
),
),
‘code’ => array(
‘output_method’ => ‘template’,
‘editor_html’ => ”,
‘editor_callback’ => ”,
‘editor_css’ => ”,
‘frontend_html’ => ”,
‘frontend_callback’ => ”,
‘frontend_css’ => ”,
‘show_preview’ => ‘always’,
‘single_output’ => false,
),
‘condition’ => array(
),
) );endif;
The topic ‘Export blocks with php code not working’ is closed to new replies.