I need to trim the title after the first comma. Remove all the words after the first comma. How can I title any code snippet?
Screenshots: https://prntscr.com/tt5x6i Code shorts: https://prntscr.com/tt5xa7
<td class="aawp-table__td-title" data-label="<?php _e('Product', 'aawp'); ?>">
<?php echo $this->truncate( $this->get_product_title(), 100 ); ?>
</td>
Someone solved this:
<?php echo stristr($this->truncate($this->get_product_title(), 100), ',', true); ?>
But its not working somewhere, Error screenshot: https://prntscr.com/tt6fdj
Anyone here to help me, please?