• Resolved simonpatterson

    (@simonpatterson)


    Hi,

    The ‘gdpr-modules’ folder can be copied/moved into your theme folder and modified to override the default plugin templates.

    That’s all good, but if you use a child theme and move the ‘gdpr-modules’ folder into your child theme, it fails and doesn’t display anything.

    This is because ‘moove-modules-view.php’ uses ‘locate_template()’ and ‘get_template_directory()’. It checks if the template file exists in either the parent or child theme, but then ASSUMES that it is in the parent theme.

    A quick and dirty re-write of the ‘load()’ function to fix this problem:

    public static function load( $view, $content ) {
    	$view_name = 'gdpr-modules' . DIRECTORY_SEPARATOR . str_replace( '.' , DIRECTORY_SEPARATOR , $view ) . '.php';
    	$view_file_plugin = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . $view_name;
    	$view_file_theme = locate_template( $view_name );
    	ob_start();
    	if ( file_exists( $view_file_theme ) && is_readable( $view_file_theme ) ) {
    		include $view_file_theme;
    	} else if ( file_exists( $view_file_plugin ) && is_readable( $view_file_plugin ) ) {
    		include $view_file_plugin;
    	}
    	return ob_get_clean();
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi there,

    Thanks for using our plugins, and for highlighting the loading issue with child themes.

    This is fixed in the latest version, please update your plugin to the version 1.1.9

    I hope this helps.

    Thread Starter simonpatterson

    (@simonpatterson)

    You missed the obstart() !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug: Doesn’t include ‘gdpr-modules’ template from child theme’ is closed to new replies.