Hi, I’m experiencing a problem after going through this tutorial: https://kb.wpbeaverbuilder.com/article/688-tutorial-add-a-custom-shape-layer
Where did I break this?
Here’s the svg file code:
<?php
/*Contents of the <svg> element with fl-shape class added */
?>
<g class="fl-shape" transform="matrix(1,0,0,1,-10,-38)">
<style type="text/css">
.st0{fill:#BA1C14;}
.st1{fill:#FFFFFF;}
</style>
<polygon class="st0" points="0,0 1556,289 1920,0 1920,328 0,328 "/>
<polygon class="st1" points="0,0 1370,319 1919.5,0.5 1919.5,329 0,329 "/>
</g>
and implementation function:
<?php
/*
Plugin Name: Hero V Custom Shape for Beaver Builder
Description: Adds a V shape to the list of custom shapes in Beaver Builder
Author: <Daniel Furfaro>
Version: 1.6
*/
if ( ! class_exists( 'FLBuilder' ) ) {
return;
}
function bb_register_custom_shapes() {
FLBuilder::register_shape(array(
'label' => __( 'Hero V', 'bb-custom-shapes-hero-v' ),
'name' => 'herov',
/* Optional x and y origin values, from SVG viewBox
ex: viewBox="x y width height" */
// 'x' => 0,
// 'y' => 0,
/* Required width and height values from SVG definition */
'width' => 347,
'height' => 85,
/* Optional aspect ratio setting, from the SVG element - see svg spec */
// 'preserve_aspect_ratio' => 'none'
/* Include the path to your artwork */
'render' => dirname(__FILE__) . '/shapes/hero-v.svg.php',
));
}
add_action('init', 'bb_register_custom_shapes');