• Resolved shorelinechrism

    (@shorelinechrism)


    This plugin looks very promising, but is there any way you might be able to add a filter for the default template parts? The filter might be applied to the CF7HETE_Module_Cf7->get_default_template() function.

    A useful example would be if you also provided a $name argument as well:

    
    return apply_filters( 'cf7hete-default-template', file_get_contents( CF7HETE_PLUGIN_PATH . '/modules/cf7/includes/templates/default-' . $name . '.htm' ), $name );
    

    This would allow theme and plugin developers to preload customized HTML templates for use with CF7.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter shorelinechrism

    (@shorelinechrism)

    Actually, it would probably be best just to filter the path, not the file contents:

    `
    return file_get_contents( apply_filters( 'cf7hete-default-template', CF7HETE_PLUGIN_PATH . '/modules/cf7/includes/templates/default-' . $name . '.htm', $name ) );
    

    `

    Plugin Author Mário Valney

    (@mariovalney)

    Hi.

    Version 2.1.0 has been released with this filter.
    I put it before “file_get_contents” to allow developers override content and avoiding calling the file unnecessarily.

    Added a preview button to this version too.

    Thread Starter shorelinechrism

    (@shorelinechrism)

    Thank you so much for the quick response! I’ll take a look now.

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

The topic ‘Feature Request: Filter for default templates’ is closed to new replies.