• Hello, I’m making theme for my customer and i needed time picker field.
    But i installed it in theme’s folder. There i’v had first problem: js and css files was enquired with wrong path.
    So i came with solution ( for v5 ):

    $this->dir = str_replace( wp_normalize_path( WP_CONTENT_DIR ), WP_CONTENT_URL, trailingslashit( wp_normalize_path( dirname( __FILE__ ) ) ) );
    		$this->path = trailingslashit( wp_normalize_path( dirname( __FILE__ ) ) );;

    Now path and dir is correct, not important where you place your plugin.

    The seccond problem i had – with flexible content – after adding a row to flex. content the time picker field didn’t worked.
    Solution was to make it like acf documentation suggests, not like you did ( for v5 ):

    acf.add_action('ready append', function( $el ){
    
    			acf.get_fields({ type : 'date_time_picker'}, $el).each(function(){
    
    				var input = $(this).find( 'input.ps_timepicker' )

    Othere lines are fine.

    Please fix these trobles.

    https://wordpress.org/plugins/acf-field-date-time-picker/

Viewing 1 replies (of 1 total)
  • Does anyone have the updated code to fix this problem? I don’t know what lines to add the code snippets to..?

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin not working if required from theme and if in flexible field. SOLUTION’ is closed to new replies.