Skip to content

bw_table - a nested bw_table shortcode changes the table columns  #181

Description

@bobbingwide

While testing the Dynamic content block using the [bw_table] rendering to tabulate page, the first page listed didn't have an excerpt and contained multiple [bw_table] shortcodes with the parameter fields=title,status,post_date
This caused the table on the calling page to use the wrong table fields - it should have been fields=title,excerpt.

The calling page was Blog, post ID 1433 ( https://s.b/cwiccer/wp-admin/post.php?post=1433&action=edit )

The first page was entitled Future page, post ID 1743 ( https://s.b/cwiccer/wp-admin/post.php?post=1743&action=edit )

image

The table header is correct but the columns are incorrect.

Writing a hand written excerpt for the Future page resolved the problem
image

Analysis

  • The problem is that the [bw_table] shortcode is not expected to be nested.
  • bw_query_table_columns() uses a global called $field_arr which gets overridden by any nested [bw_table] shortcode/block.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions