• File: TextBlockType.php
  • Full Path: /home/bravrvjk/itiministry.org/wp-content/plugins/give/src/FormBuilder/BlockTypes/TextBlockType.php
  • Date Modified: 02/14/2025 12:36 AM
  • File size: 594 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace Give\FormBuilder\BlockTypes;

use Give\FormBuilder\BlockTypes\Concerns\HasDefaultFieldAttributes;
use Give\Framework\Blocks\BlockType;

/**
 * @since 3.8.0
 */
class TextBlockType extends BlockType
{
    use HasDefaultFieldAttributes;

    /**
     * @since 3.8.0
     */
    public static function name(): string
    {
        return 'givewp/text';
    }

    /**
     * @since 3.21.0
     */
    public function getFieldName(int $blockIndex): string
    {
        return !empty($this->fieldName) ? $this->fieldName : $this->block->getShortName() . '-' . $blockIndex;
    }
}