• rexreed

    (@rexreed)


    Hello —

    I’m applying a fix to the Countdown elementor widget since it doesn’t support Dynamic Tags. However, it looks like the Dynamic Conditions plugin might be preventing the suggested code from working.

    Here’s what is suggested to add to the code to enable server-side customization of the Countdown widget (from https://github.com/elementor/elementor/issues/7737):

    add_action( ‘init’, function(){
    add_action( ‘elementor/frontend/widget/before_render’, function ( \Elementor\Element_Base $element ) {
    if ( ! $element->get_settings( ‘due_date’ ) ) {
    return;
    }
    // field name goes here
    $countdown_date = get_field(‘ending_date’);
    $element->set_settings( ‘due_date’, date(‘Y-m-d H:i’,strtotime($countdown_date))) ;
    } );
    });

    This should be working and the code does indeed do what it’s supposed to, but set_settings doesn’t seem to have any effect.

    Is Dynamic Conditions interfering with element->set_settings?

Viewing 1 replies (of 1 total)
  • Plugin Author crazypsycho

    (@crazypsycho)

    Hello @rexreed

    as I seen in the github-link, someone posted a solution for this issues.
    DynamicConditions uses the same before_render hook, so you need to change the priority, like this:

    add_action( 'elementor/frontend/widget/before_render', function(\Elementor\Element_Base $element){
    	if ( ! $element->get_settings( 'due_date' ) ) return;
    
    	$countdown_date = get_field('ending_date');
    	$element->set_settings( 'due_date', date('Y-m-d H:i',strtotime($countdown_date))) ;
    }, 5 , 1);
Viewing 1 replies (of 1 total)
  • The topic ‘Possible conflict with Countdown elementor fix’ is closed to new replies.