Support

Account

Forum Replies Created

  • If anyone finds this as I did, I got it working by basically “unslicking” and reslicking my slides:

    (function($){
    
        var initializeBlock = function( $block ) {
    		var sliders = $block.find('.testimonial-quotes');
    		if (window.acf) {
    			if (sliders.hasClass('slick-initialized')) {
    				sliders.slick('unslick');
    			}
    		}
    		sliders.slick({
    			dots: true,
    			infinite: true,
    			speed: 800,
    			slidesToShow: 1,
    			slidesToScroll: 1,
    			draggable: true,
    			fade: true,
    			cssEase: 'linear',
    			arrows: false,
    			dotsClass: 'ep-block-dots',
    			autoplay: true,
    			autoplaySpeed: 5000,
    		});
        }
    
        // Initialize dynamic block preview (editor).
        if( window.acf ) {
            window.acf.addAction( 'render_block_preview/type=wed-testimonials', initializeBlock );
    		//window.acf.addAction('remount/type=wed-testimonials', initializetestimonials );
        }
    
    })(jQuery);

    Hope that helps someone!

  • Hi – I know this is super old, but did you ever figure out a solution? I too am able to get it work if jsx => false, but not if it’s set to true (therefore anything with innerblocks is bombing). Thank you!

  • UPDATE: This is solved. In case anyone wants to register a taxonomy based upon an option field, here’s how to do it:

    function register_my_cpts_wed_vendors() {
    	$labels = array(
    		"name" => __( "Vendors", "wed" ),
    		"singular_name" => __( "Vendors", "wed" ),
    	);
    
    	$args = array(
    		"label" => __( "Vendors", "wed" ),
    		"labels" => $labels,
    		"public" => true,
    		"publicly_queryable" => true,
    		"hierarchical" => false,
    		"show_ui" => true,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"query_var" => true,
    		"rewrite" => array( 'slug' => 'vendors', 'with_front' => true, ),
    		"show_admin_column" => true,
    		"show_in_rest" => true,
    		"rest_base" => "wed_vendors",
    		"rest_controller_class" => "WP_REST_Terms_Controller",
    		"show_in_quick_edit" => false,
    	);
    	register_taxonomy( "wed_vendors", array( "post", "wed_vendor"), $args );
    }
    
    add_action( 'register_wed_vendors','register_my_cpts_wed_vendors', 10, 2 );
    
    function wed_get_vendor_enable() {
    	$enablevendortax = get_field('enable_vendor_tax', 'option');
    	
    	if($enablevendortax=='1') {	
    		do_action('register_wed_vendors' );
    	}
    }
    
    add_action( 'init', 'wed_get_vendor_enable' );
  • I think what you want to do is to add a load point to load json files from the plugin and here you want a priority of > 10 to allow the acf-json folder in the theme to be loaded first. This will mean that the JSON file from the plugin will only be loaded if that JSON file does not exist in the theme. Create an acf-json folder in the theme folder. When you sync and then save the field group it will save it to the theme folder and override the json file in the plugin. But doing this will also mean that if you ever updated this field group in the plugin that those changes till not effect any site where they have been changed.

    This is perfect and points me in the right direction, thank you so much!

  • It’s a custom plugin. Here’s the function I’m using to load the JSON files with the field groups:

    /** Start: Create JSON save point */
      add_filter('acf/settings/save_json', 'wed_acf_json_save_point');
      function wed_acf_json_save_point( $path ) {
        $path = plugin_dir_path( __FILE__ ) . 'acf-json/';
        return $path;
      }
      /** End: Create JSON save point */
      /** Start: Create JSON load point */
      add_filter('acf/settings/load_json', 'wed_acf_json_load_point');
      /** End: Create JSON load point */
  • Ha! Thanks for the quick response, and sorry if I was unclear!

    Here’s the steps:
    – load JSON file via plugin
    – sync field group
    – make changes to field group (for example: allow a custom user role to see the fields)
    – WISH that changes to field group would work on the site but they don’t. 🙂
    – delete JSON file from plugin and the field group changes now work

    Does that make more sense? Basically I’m looking for the field group to drive everything, not the JSON (but no, I don’t need/want the JSON file for the plugin to be edited at all).

  • Thanks so much Keith! Much appreciated.

  • @mrkeithy did you ever figure this one out? exactly what i’m looking to do. thank you!

  • I have a very similar issue too. Hoping this is possible!

Viewing 9 posts - 1 through 9 (of 9 total)