$this->attributes(), 'render_callback' => [$this, 'render'] ) ); } function attributes(){ return array( 'align' => array( 'type' => 'string', 'default' => '' ), 'cId' => array( 'type' => 'string', 'default' => '' ), 'gif' => array( 'type' => 'object', 'default' => NULL ), 'gifAlign' => array( 'type' => 'string', 'default' => 'center' ), 'gifWidth' => array( 'type' => 'string', 'default' => '0px' ) ); } function render( $attributes ){ extract( $attributes ); // Generate Styles $gifStyle = new BBlocksStyleGenerator(); $gifStyle::addStyle( "#bBlocksGif-$cId .bBlocksGif", array( 'text-align' => $gifAlign ) ); $gifStyle::addStyle( "#bBlocksGif-$cId .bBlocksGif figure", array( 'width' => '0px' === $gifWidth || '0%' === $gifWidth || '0em' === $gifWidth ? 'auto' : $gifWidth ) ); ob_start(); ?>