Request: Hooking the cell contents
-
Is it possible to add an “arbitrary” filter to
$cell_content
inside the_render_row()
method?I want to apply Markdown to the cell contents and I’ve already created a filter that does all that, so that’s not an issue. Also, you do have a filter
tablepress_cell_content
around the content which can be hooked. But the issue here is that your span triggers#colspan#
and things like that, get caught inside the Markdown and are rendered as headers instead of expanding to a column span.What I’ve done is added a filter just before line 606
$row_cells[] = "<{$tag}{$span_attr}{$class_attr}{$style_attr}>{$cell_content}</{$tag}>";
after all the span trigger logic e.g.
$cell_content = apply_filters('tablepress_extra_formatting', $cell_content);
Since your span triggers are processed before this point, all the content that’s left is content that needs to be formatted. However this will obviously disappear if you update the plug-in.
Let me know what you think :). Thanks.
- The topic ‘Request: Hooking the cell contents’ is closed to new replies.