= 30, so that you will not override the plugin default patterns) * - the value must be [_custom_HOW_YOU_CALL_THE_PATTERN] (please note the _custom_ string) * * @param array $tile_pattern The list of defined tile patterns. * @return array */ function my_theme_lps_filter_tile_patterns( $tile_pattern ) { /* Uncomment the line below if you want to restrict the patterns to only these you define here. $tile_pattern = array(); */ $tile_pattern[30] = '[_custom_my_tile_1]'; return $tile_pattern; } } add_filter( 'lps_filter_tile_patterns', 'my_theme_lps_filter_tile_patterns', 1 ); if ( ! function_exists( 'my_theme_lps_filter_display_posts_list' ) ) { /** * Add the theme custom tile patterns descriptions into the 3rd-party plugin. * The rules for defining your custom display list are: * - the key must be one of the tile patterns you already * defined (without the brackets) * - the value must be a meaningful description of the output. * * @param array $display_list The list of defined tile patterns, with their descriptions. * @return array */ function my_theme_lps_filter_display_posts_list( $display_list ) { /* Uncomment the line below if you want to restrict the list to only these you define here. $display_list = array(); */ $display_list['_custom_my_tile_1'] = __( 'My Theme Tile 1', 'text-domain' ); return $display_list; } } add_filter( 'lps_filter_display_posts_list', 'my_theme_lps_filter_display_posts_list', 1 ); if ( ! function_exists( 'my_theme_lps_filter_use_custom_tile_markup' ) ) { /** * Create the custom output of tiles into the 3rd-party plugin (the markup and logic of the tiles). * * @param string $tile_pattern The tile pattern slug. * @param object $object The WP Post object to be rendered. * @param array $args The shortcode usable arguments. * @return string */ function my_theme_lps_filter_use_custom_tile_markup( $tile_pattern, $object, $args ) { global $post; $content = ''; $post = $object; setup_postdata( $post ); switch ( $tile_pattern ) { case '[_custom_my_tile_1]': default: ob_start(); ?>

-
'; $start .= esc_html__( 'Some cool articles', 'text-domain' ); break; } return $start; } } add_filter( 'lps_filter_use_custom_section_markup_start', 'my_theme_lps_filter_use_custom_section_markup_start', 10, 3 ); if ( ! function_exists( 'my_theme_lps_filter_use_custom_section_markup_end' ) ) { /** * Alter the output of section end into the 3rd-party plugin (the markup after the tiles). * * @param string $tile_pattern The tile pattern slug. * @param string $shortcode_id The section element id. * @param string $class Custom class. * @return string */ function my_theme_lps_filter_use_custom_section_markup_end( $tile_pattern, $shortcode_id = '', $class = '' ) { switch ( $tile_pattern ) { case '[_custom_my_tile_1]': default: $end = ''; break; } return $end; } } add_filter( 'lps_filter_use_custom_section_markup_end', 'my_theme_lps_filter_use_custom_section_markup_end', 10, 3 ); ?>