Skip to content

Commit

Permalink
Bricks Builder style is not rendering for GD Archive Item template - …
Browse files Browse the repository at this point in the history
…FIXED
  • Loading branch information
kprajapatii committed Oct 16, 2024
1 parent 4357443 commit 16695d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 17 additions & 2 deletions includes/integrations/bricks/class-geodir-bricks.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public static function overwrite_archive_template_content( $content, $original_c
* @return string Filtered content.
*/
public static function overwrite_archive_item_template_content( $content, $original_content, $page_id ) {
global $gd_post;
global $gd_post, $geodir_brocks_css;

$post_type = ! empty( $gd_post->post_type ) ? '_' . $gd_post->post_type : '';

Expand All @@ -222,11 +222,26 @@ public static function overwrite_archive_item_template_content( $content, $origi
if ( ! empty( $bricks_data ) ) {
remove_filter( 'geodir_bypass_archive_item_template_content', array( __CLASS__, 'overwrite_archive_item_template_content' ), 10, 3 );

if ( empty( $geodir_brocks_css ) ) {
$geodir_brocks_css = array();
}

ob_start();
Bricks\Frontend::render_content( $bricks_data );
$_content = ob_get_clean();

$content = trim( $_content );
$content = $_content ? trim( $_content ) : '';

// Render inline CSS.
if ( $content && empty( $geodir_brocks_css[ $page_id ] ) ) {
$additional_data = Bricks\Element_Template::get_builder_call_additional_data( $page_id );

if ( ! empty( $additional_data['css'] ) ) {
$content .= "<style type=\"text/css\" data-template-id=\"" . (int) $page_id . "\">" . trim( Bricks\Assets::minify_css( $additional_data['css'] ) ) . "</style>";
}

$geodir_brocks_css[ $page_id ] = true;
}

add_filter( 'geodir_bypass_archive_item_template_content', array( __CLASS__, 'overwrite_archive_item_template_content' ), 10, 3 );
}
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ We don't offer free trials, but we have a 30-day money-back guarantee if you are

__WARNING: GDv2 is a significant update over GDv1 and may require manual work, such as adding widgets to sidebars to recreate your current layout. As always, we recommend trying this on a staging site first. [Learn more](https://docs.wpgeodirectory.com/article/260-upgrading-from-gdv1-to-gdv2)__

= GeoDirectory v2.3.83 - TBD =
* Bricks Builder style is not rendering for GD Archive Item template - FIXED

= GeoDirectory v2.3.82 - 2024-10-10 =
* Elementor editor GD > Listings - Category & CPT options are not changing on CPT change - FIXED
* GD > Dynamic Content remove CSS class setting added by WP default - CHANGED
Expand Down

0 comments on commit 16695d5

Please sign in to comment.