Support » Plugin: YITH WooCommerce Request A Quote » i believe the yit_plugin_locate_template is using the wrong $template_path

  • is not really an error more so something that could lead to unncessary folder structure this code

    function yit_plugin_locate_template ( $plugin_basename, $path, $var = NULL ) {
    
            $template_path = '/theme/templates/' . $path;
    
            $located = locate_template ( array (
                $template_path,
            ) );
    
            if ( ! $located ) {
                $located = $plugin_basename . '/templates/' . $path;
            }
    
            return $located;
        }

    should really be like this in order to have the theme template overrides go into theme-name/templates instead of theme-name/theme/templates

    function yit_plugin_locate_template ( $plugin_basename, $path, $var = NULL ) {
    
            $template_path = '/templates/' . $path;
    
            $located = locate_template ( array (
                $template_path,
            ) );
    
            if ( ! $located ) {
                $located = $plugin_basename . '/templates/' . $path;
            }
    
            return $located;
        }
  • The topic ‘i believe the yit_plugin_locate_template is using the wrong $template_path’ is closed to new replies.