mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-14 03:56:09 +09:00
Add a getter for the widget form class
This commit is contained in:
@@ -80,7 +80,7 @@ class DisplayFeaturedImageGenesisWidgetsBlocksFields {
|
||||
* @return array
|
||||
*/
|
||||
protected function cpt_fields() {
|
||||
$form = new DisplayFeaturedImageGenesisWidgetsForm( $this, array() );
|
||||
$form = $this->get_form_class();
|
||||
|
||||
return array_merge(
|
||||
include 'fields/cpt-post_type.php',
|
||||
@@ -94,7 +94,7 @@ class DisplayFeaturedImageGenesisWidgetsBlocksFields {
|
||||
* @return array
|
||||
*/
|
||||
protected function author_fields() {
|
||||
$form = new DisplayFeaturedImageGenesisWidgetsForm( $this, array() );
|
||||
$form = $this->get_form_class();
|
||||
$user = array(
|
||||
array(
|
||||
'method' => 'select',
|
||||
@@ -179,4 +179,18 @@ class DisplayFeaturedImageGenesisWidgetsBlocksFields {
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the widget builder form class.
|
||||
*
|
||||
* @return \DisplayFeaturedImageGenesisWidgetsForm
|
||||
*/
|
||||
private function get_form_class() {
|
||||
if ( isset( $this->form ) ) {
|
||||
return $this->form;
|
||||
}
|
||||
$this->form = new DisplayFeaturedImageGenesisWidgetsForm( $this, array() );
|
||||
|
||||
return $this->form;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user