Remove unneeded nickname

This commit is contained in:
Robin Cornett
2019-06-25 13:18:45 -04:00
parent bc20b03c56
commit cbb6974cf2
3 changed files with 2 additions and 8 deletions
@@ -26,9 +26,6 @@ class DisplayFeaturedImageGenesisWidgetsBlocksFields {
);
$blocks = include 'fields/blocks.php';
foreach ( $blocks as $block => $data ) {
if ( empty( $data['nickname'] ) ) {
continue;
}
$common['panels'] = array(
'main' => array(
'title' => __( 'Block Settings', 'display-featured-image-genesis' ),
@@ -31,7 +31,7 @@ class DisplayFeaturedImageGenesisWidgetsBlocks {
$output = new DisplayFeaturedImageGenesisWidgetsBlocksOutput();
$fields = $this->get_fields_class();
foreach ( $this->blocks() as $block => $data ) {
if ( empty( $data['nickname'] ) || ! is_callable( array( $output, "render_{$data['nickname']}" ) ) ) {
if ( ! is_callable( array( $output, "render_{$block}" ) ) ) {
continue;
}
register_block_type(
@@ -40,7 +40,7 @@ class DisplayFeaturedImageGenesisWidgetsBlocks {
'editor_script' => "{$this->block}block",
'editor_style' => "{$this->block}block",
'attributes' => $fields->fields( $block ),
'render_callback' => array( $output, "render_{$data['nickname']}" ),
'render_callback' => array( $output, "render_{$block}" ),
)
);
}
-3
View File
@@ -8,7 +8,6 @@ return array(
__( 'Term', 'display-featured-image-genesis' ),
__( 'Featured Image', 'display-featured-image-genesis' ),
),
'nickname' => 'term',
),
'author' => array(
'title' => __( 'Display Featured Author Profile', 'display-featured-image-genesis' ),
@@ -17,7 +16,6 @@ return array(
__( 'Author', 'display-featured-image-genesis' ),
__( 'Featured Image', 'display-featured-image-genesis' ),
),
'nickname' => 'author',
),
'cpt' => array(
'title' => __( 'Display Featured Post Type Archive Image', 'display-featured-image-genesis' ),
@@ -26,6 +24,5 @@ return array(
__( 'Post Type', 'display-featured-image-genesis' ),
__( 'Featured Image', 'display-featured-image-genesis' ),
),
'nickname' => 'cpt',
),
);