apply_filters( 'lp__load_template_parts/{template}/{type}', $parts )

Allow filtering of template parts to be rendered on a page for a specific template and type.


Plugin


Namespace

Launchpad


Parameters

array

$parts

The template parts.


Return

array

The filtered template parts


Example

In this example, we’re filtering the template parts to be rendered specifically for a template named your_template and a type named your_type. You would replace 'your_template' and 'your_type' with the slugs or names of your specific template and type.

// Add the filter hook for customizing the template parts loading for a specific template and type
add_filter( 'lp__load_template_parts/your_template/your_type', function( $template_parts ) {
    // Customize the template parts based on specific conditions or requirements for your_template and your_type
    // Example: Add a custom template part
    $template_parts['custom_template_part'] = 'path/to/custom-template.php';

    return $template_parts;
} );

After applying this customization, the template parts loaded for the your_template template and your_type type will be filtered based on the specified conditions. You can modify the $template_parts array inside the filter callback function to include or exclude specific template parts as needed.

Feel free to adjust the template name, type, and modifications inside the filter callback function according to your specific use case.

Related

Allow filter for specific admin pages.

Allow filter for specific admin pages arguments.

Allow filter for all admin sub views arguments.

Allow filter for admin views arguments of specific admin page and view.

Allow filter for admin sub views arguments of specific admin page, view, and sub view.

Allow filter for admin sub views arguments of specific admin page.

Allow filter for specific admin sub view arguments.

Allow filter for admin sub view arguments of specific admin view.

Allow filter for admin sub views param.

Allow filter for admin sub views param of specific admin page.

Allow filter for admin sub views param of specific admin page and view.

Allow filter for admin sub views param of specific admin page view.

Allow filter for all admin toolbar arguments.

Allow filter for specific admin toolbar arguments.

Allow filter for all admin toolbar arguments.

Allow filter for specific admin toolbar arguments.

Allow filter for all admin views arguments.

Allow filter for admin views arguments of specific admin page and view.

Allow filter for admin views arguments of specific admin page.

Allow filter for specific admin view arguments.

Allow filter for all admin views param.

Allow filter for admin views param of specific admin page.

Allow filtering the button HTML text to render.

Allow filter for customizing the HTML items for contact details.

Allow filter for all field group arguments.

Allow filter for specific field group arguments.

Allow field value filter.

Allow filtering the link HTML text to render.

Allow filtering of template parts to be rendered on a page.

Allow filtering of template parts to be rendered on a page for a specific template.

Allow filter to customize the option of submit button HTML.

Allow filter for the HTML structure of price.

Allow filter for the price HTML arguments.

Allow filter for customizing the HTML items for social media links.