Skip to content

Commit

Permalink
Fix #9 undefined acf function error
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMayerhofer committed Jun 28, 2021
1 parent e2685bb commit 225f09e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
36 changes: 19 additions & 17 deletions inc/blocks/block-accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ public static function get_name(): string {
}

public static function register_block_type(): void {
acf_register_block_type(
[
'name' => self::get_name(),
'title' => __( 'Accordion', 'foundationpress' ),
'render_template' => 'template-parts/blocks/' . self::get_name() . '.php',
'enqueue_style' => get_template_directory_uri() . '/dist/assets/css/blocks/' . self::get_name() . '.css',
'enqueue_script' => get_template_directory_uri() . '/dist/assets/js/blocks/' . self::get_name() . '.js',
'category' => 'foundationpress',
'icon' => 'editor-help',
'keywords' => [ self::get_name(), 'faq', 'akkordion' ],
'supports' => [
'align' => false,
'anchor' => true,
'classNames' => true,
],
]
);
if ( function_exists( 'acf_register_block_type' ) ) {
acf_register_block_type(
[
'name' => self::get_name(),
'title' => __( 'Accordion', 'foundationpress' ),
'render_template' => 'template-parts/blocks/' . self::get_name() . '.php',
'enqueue_style' => get_template_directory_uri() . '/dist/assets/css/blocks/' . self::get_name() . '.css',
'enqueue_script' => get_template_directory_uri() . '/dist/assets/js/blocks/' . self::get_name() . '.js',
'category' => 'foundationpress',
'icon' => 'editor-help',
'keywords' => [ self::get_name(), 'faq', 'akkordion' ],
'supports' => [
'align' => false,
'anchor' => true,
'classNames' => true,
],
]
);
}
}
}

Expand Down
36 changes: 19 additions & 17 deletions inc/blocks/block-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ public static function get_name(): string {
}

public static function register_block_type(): void {
acf_register_block_type(
[
'name' => self::get_name(),
'title' => __( 'FP Button', 'foundationpress' ),
'render_template' => 'template-parts/blocks/' . self::get_name() . '.php',
'enqueue_style' => get_template_directory_uri() . '/dist/assets/css/blocks/' . self::get_name() . '.css',
// 'enqueue_script' => get_template_directory_uri() . '/dist/assets/js/blocks/' . self::get_name() . '.js',
'category' => 'foundationpress',
'icon' => 'shield-alt',
'keywords' => [ self::get_name() ],
'supports' => [
'align' => true,
'anchor' => true,
'classNames' => true,
],
]
);
if ( function_exists( 'acf_register_block_type' ) ) {
acf_register_block_type(
[
'name' => self::get_name(),
'title' => __( 'FP Button', 'foundationpress' ),
'render_template' => 'template-parts/blocks/' . self::get_name() . '.php',
'enqueue_style' => get_template_directory_uri() . '/dist/assets/css/blocks/' . self::get_name() . '.css',
// 'enqueue_script' => get_template_directory_uri() . '/dist/assets/js/blocks/' . self::get_name() . '.js',
'category' => 'foundationpress',
'icon' => 'shield-alt',
'keywords' => [ self::get_name() ],
'supports' => [
'align' => true,
'anchor' => true,
'classNames' => true,
],
]
);
}
}
}

Expand Down

0 comments on commit 225f09e

Please sign in to comment.