'3703', 'slug' => 'acf-blocks', 'type' => 'plugin', 'public_key' => 'pk_5e62b729dd843294873241dcc6402', 'is_premium' => false, 'has_addons' => false, 'has_paid_plans' => false, 'menu' => array( 'first-path' => 'plugins.php', 'account' => false, 'support' => false, ), ) ); } return $acfb_fs; } // Init Freemius. acfb_fs(); // Signal that SDK was initiated. do_action( 'acfb_fs_loaded' ); } // Add Custom Blocks Panel in Gutenberg function acfb_block_categories( $categories, $post ) { return array_merge( $categories, array( array( 'slug' => 'acfb-blocks', 'title' => __( 'ACF Blocks', 'acfblocks-master' ), ), ) ); } add_filter( 'block_categories', 'acfb_block_categories', 10, 2 ); // Register Blocks add_action('acf/init', 'acfb_blocks'); function acfb_blocks() { // check function exists. if( function_exists('acf_register_block') ) { // register a testimonial block. acf_register_block(array( 'name' => 'acfb-testimonial', 'mode' => 'preview', 'title' => __('Testimonial'), 'description' => __('Let others know what your clients or customers say about you.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/testimonial.php', 'category' => 'acfb-blocks', 'icon' => '', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); // register a team block. acf_register_block(array( 'name' => 'acfb-team', 'mode' => 'preview', 'title' => __('Team'), 'description' => __('Introduce your team to your site visitors in style.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/team.php', 'category' => 'acfb-blocks', 'icon' => '', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); // register a multi buttons block. acf_register_block(array( 'name' => 'acfb-multibuttons', 'mode' => 'preview', 'title' => __('Multi Buttons'), 'description' => __('Display multiple buttons inline with ease.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/multi-buttons.php', 'category' => 'acfb-blocks', 'icon' => '', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); // register a pricing box block. acf_register_block(array( 'name' => 'acfb-pricingbox', 'mode' => 'preview', 'title' => __('Pricing Box'), 'description' => __('Display your plans and offers in style.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/pricing-box.php', 'category' => 'acfb-blocks', 'icon' => '', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); // register a Star Rating block. acf_register_block(array( 'name' => 'acfb-starrating', 'mode' => 'preview', 'title' => __('Star Rating'), 'description' => __('Add start ratings anywhere easily.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/star-rating.php', 'category' => 'acfb-blocks', 'icon' => '', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); // register a Progress Bar block. acf_register_block(array( 'name' => 'acfb-progressbar', 'mode' => 'preview', 'title' => __('Progress Bar'), 'description' => __('Show your progress using percentage defined progress bars.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/progress-bar.php', 'category' => 'acfb-blocks', 'icon' => ' ', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); // register a Counter Number block. acf_register_block(array( 'name' => 'acfb-counternumber', 'mode' => 'preview', 'title' => __('Counter Number'), 'description' => __('Display stats with animated counter numbers.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/counter-number.php', 'category' => 'acfb-blocks', 'icon' => '', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); wp_enqueue_script( 'acfb-blocks-js', plugin_dir_url( __FILE__ ) . 'js/acfblocks.js', array('jquery'), '', false ); }, )); // register a Price List block. acf_register_block(array( 'name' => 'acfb-pricelist', 'mode' => 'preview', 'title' => __('Price List'), 'description' => __('Display price list for any product easily.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/price-list.php', 'category' => 'acfb-blocks', 'icon' => '', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); // register a Click To Tweet block. acf_register_block(array( 'name' => 'acfb-clicktotweet', 'mode' => 'preview', 'title' => __('Click To Tweet'), 'description' => __('Add a tweet-able quote to let your reader tweet with 1-click.'), 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/click-to-tweet.php', 'category' => 'acfb-blocks', 'icon' => ' ', 'enqueue_assets' => function(){ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' ); }, )); } } add_filter('acf/settings/save_json', 'acfb_json_save_point'); function acfb_json_save_point( $acfb_path ) { // update path $acfb_path = plugin_dir_path( __FILE__ ) . '/acf-json'; // return return $acfb_path; } add_filter('acf/settings/load_json', 'acfb_json_load_point'); function acfb_json_load_point( $acfb_path ) { // remove original path (optional) unset($acfb_path[0]); // append path $acfb_path[] = plugin_dir_path( __FILE__ ) . '/acf-json'; // return return $acfb_path; }