Skip to content

Instantly share code, notes, and snippets.

@palmiak
Created October 28, 2018 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palmiak/68224a18acab87951d64859a6f659a09 to your computer and use it in GitHub Desktop.
Save palmiak/68224a18acab87951d64859a6f659a09 to your computer and use it in GitHub Desktop.
<?php
add_action('acf/init', 'my_acf_init');
function my_acf_init() {
// sprawdzamy czy funkcja istnieje
if( function_exists('acf_register_block') ) {
// rejestrujemy blok
acf_register_block(array(
'name' => 'testimonial',
'title' => __('Testimonial'),
'description' => __('A custom testimonial block.'),
'render_callback' => 'my_acf_block_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'testimonial', 'quote' ),
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment