LLMS_Form_Templates::find_reusable_block( string $field_id )
Locates an existing wp_block post by field id
Parameters Parameters
- $field_id
-
(string) (Required) The field's identifier as found in the block schema list returned by LLMS_Form_Templates::get_reusable_block_schema().
Return Return
(WP_Post|boolean) Returns the post object or false if not found.
Source Source
File: includes/forms/class-llms-form-templates.php
public static function find_reusable_block( $field_id ) {
$query = new WP_Query(
array(
'posts_per_page' => 1,
'no_found_rows' => true,
'post_type' => 'wp_block',
'meta_key' => '_llms_field_id',
'meta_value' => $field_id,
)
);
return $query->posts ? $query->posts[0] : false;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.1.0 | Method access changed from private to public. |
| 5.0.0 | Introduced. |