Support » Plugin: TablePress » Undefined Variable:row_idx error

  • Resolved lukewarm2019

    (@lukewarm2019)


    I am getting this error after setting up a simple table in WP. the error reads:
    Notice: Undefined variable: row_idx in /srv/bindings/246c701ad8d54926b82c6cf2e13cc6af/code/wp-content/themes/ccc/resources/functions.php on line 117

    I’ve redone the table to look like TablePress until this is remedied.

    Please advise.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    What’s the code around line 117 in that file? This seems to be a theme PHP file…

    Regards,
    Tobias

    lukewarm2019

    (@lukewarm2019)

    function ada_tablepress_add_scope(  $tag_attributes, $table_id, $cell_content, $row_number, $col_number, $colspan, $rowspan ) {
    row 117 -->    if ( $row_idx === 1 ) {
            $tag_attributes['scope'] = "col";
        }
        return $tag_attributes;
    }
    add_filter( 'tablepress_cell_tag_attributes', 'ada_tablepress_add_scope', 10, 7 );
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ok, that PHP function contains a bug. Please try changing that line to

    if ( $row_number === 1 ) {
    

    Regards,
    Tobias

    lukewarm2019

    (@lukewarm2019)

    That fixed it.
    Thank you!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Undefined Variable:row_idx error’ is closed to new replies.