mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-14 03:56:09 +09:00
Add the featured term block
This commit is contained in:
@@ -19,7 +19,10 @@ class DisplayFeaturedImageGenesisWidgetsBlocksFields {
|
||||
'icon' => 'format-image',
|
||||
'category' => 'widgets',
|
||||
);
|
||||
$output = array();
|
||||
$output = array(
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'security' => wp_create_nonce( 'displayfeaturedimagegenesis-block-nonce' ),
|
||||
);
|
||||
$blocks = include 'fields/blocks.php';
|
||||
foreach ( $blocks as $block => $data ) {
|
||||
if ( empty( $data['nickname'] ) ) {
|
||||
@@ -61,6 +64,14 @@ class DisplayFeaturedImageGenesisWidgetsBlocksFields {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the block term action callback here since this class already has a getter for the form class.
|
||||
*/
|
||||
public function term_action_callback() {
|
||||
$form = $this->get_form_class();
|
||||
$form->term_action_callback();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $block
|
||||
*
|
||||
@@ -111,6 +122,20 @@ class DisplayFeaturedImageGenesisWidgetsBlocksFields {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function term_fields() {
|
||||
$form = $this->get_form_class();
|
||||
|
||||
return array_merge(
|
||||
include 'fields/text.php',
|
||||
include 'fields/term-taxonomy.php',
|
||||
include 'fields/image.php',
|
||||
include 'fields/archive.php'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of attributes for an individual field.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user