Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bobbingwide opened this issue Aug 16, 2021 · 0 comments
Open
Assignees
Labels

Comments

@bobbingwide
Copy link
Owner

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.
@bobbingwide bobbingwide self-assigned this Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant