This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • laGraficalaGrafica
    Participant

    Thank for reply, about language datepicker I find this code
    https://docs.gravityforms.com/translating-the-datepicker/

    add_action( 'gform_enqueue_scripts', 'add_datepicker_regional', 11 );
    function add_datepicker_regional() {
        if ( wp_script_is( 'gform_datepicker_init' ) ) {
            wp_enqueue_script( 'datepicker-regional', get_stylesheet_directory_uri() . '/js/datepicker-your-lang.js', array( 'gform_datepicker_init' ), false, true );
            remove_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
        }
    }

    Do you think it could be adapted to Ajax Search pro?

    I’ve even thought about adding this feature to the snippet to make it multilingual,

    https://wpml.org/forums/topic/only-include-javascript-snippet-on-1-language/

    // Get the current language
    $current_language = apply_filters( 'wpml_current_language', NULL );
      
    // Check if the current language is the desired one
    if ( $current_language === 'your_desired_language_code' ) {
        // Add your code here to be applied for the specific language
    }

    it would be a very good solution for those of us who need a datepicker in several languages

Viewing 1 post (of 1 total)