fewbricks\acf\fields\flexible_content::get_sub_field_brick_instance PHP Method

get_sub_field_brick_instance() public static method

public static get_sub_field_brick_instance ( ) : fewbricks\brick
return fewbricks\brick
    public static function get_sub_field_brick_instance()
    {
        $row_layout = get_row_layout();
        $class_name = 'fewbricks\\bricks\\' . self::get_sub_field_brick_class_name();
        $instance = new $class_name($row_layout);
        /** @noinspection PhpUndefinedMethodInspection */
        $instance->set_is_layout(true);
        return $instance;
    }

Usage Example

コード例 #1
0
 /**
  * @return string
  */
 protected function get_brick_html()
 {
     $html = '';
     while ($this->have_rows('modules')) {
         $this->the_row();
         $html .= acf_fields\flexible_content::get_sub_field_brick_instance()->get_html();
     }
     return $html;
 }
All Usage Examples Of fewbricks\acf\fields\flexible_content::get_sub_field_brick_instance