-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Description
Version
- Carbon Fields: 3.6
- WordPress: latest (but irrelevant for this issue)
- PHP: 8.1
Expected Behavior
Make all possible methods chained to a Field::make()
which yields a Carbon_Fields\Field\Field
available in IDE, by applying all possible methods and definitions to themain class.
Actual Behavior
In VSCODE with Intelephense, methods ->set_value_type()
, ->set_layout()
and ->add_fields()
chained to a Field::make( 'image' ... )
or Field::make( 'complex', ...)
are not recognised as available methods for Carbon_Fields\Field\Field
.
Container definition
Container::make( 'post_meta', __('Home Page') )
->where( 'post_type', '=', 'page' )
->where( 'post_template', '=', 'templates/page-home.php' )
->add_tab(__('Banner'), array(
Field::make( 'complex', 'banner_elements', 'Banner Elements' )->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make( 'image', 'banner_bg_image', 'Banner Background Image' )->set_value_type( 'url' )->set_width(33),
Field::make('text', 'banner_heading', 'Banner Heading')->set_width(33),
Field::make('rich_text', 'banner_sub_heading', 'Banner Sub Heading')->set_width(33),
))
->set_header_template('
<% if (banner_heading) { %>
<%- banner_heading %>
<% } else { %>
empty
<% } %>
')
))
Steps to Reproduce the Problem
none, this is an IDE issue
Comments
This issue does not cause failures when running the code, however it would be great that the IDE would not indicate these methods, that are in fact available, as problematic/errors.
jacobrastad and ggedde
Metadata
Metadata
Assignees
Labels
No labels