how do I render a bulk edit checkbox on wp_list_table
<p>I'm trying to use wp_list_table by making an extended class.  I have two actions to run through on the bulk-update functionality provided.  However I don't quite know how to write the proper case switch statement to set the resulting checkbox to apply for either array actions based on the action taken...(see I know what I need to do, but I don't quite know how to do it).</p>

<p>This is the smallest bit of relatable code I have to work with:</p>

<pre><code>  /**
   * Render the bulk edit checkbox
   *
   * @param array $item
   *
   * @return string
   */
  function column_cb( $item ) {
    return sprintf(
      '&lt;input type="checkbox" name="bulk-reset[]" value="%s" /&gt;', $item['id']

    );
  }


  /**
   * Method for name column
   *
   * @param array $item an array of DB data
   *
   * @return string
   */
  function column_name( $item ) {

    $delete_nonce = wp_create_nonce( 'sp_delete_customer' );
    $reset_nonce = wp_create_nonce( 'sp_reset_payouts' );

    $title = '&lt;strong&gt;' . $item['name'] . '&lt;/strong&gt;';

    $actions = [
      'delete' =&gt; sprintf( '&lt;a href="?page=%s&amp;action=%s&amp;customer=%s&amp;_wpnonce=%s"&gt;Delete&lt;/a&gt;', esc_attr( $_REQUEST['page'] ), 'delete', absint( $item['id'] ), $delete_nonce ),

      'reset' =&gt; sprintf( '&lt;a href="?page=%s&amp;action=%s&amp;customer=%s&amp;_wpnonce=%s"&gt;Reset&lt;/a&gt;', esc_attr( $_REQUEST['page'] ), 'reset', absint( $item['id'] ), $reset_nonce )

    ];

    return $title . $this-&gt;row_actions( $actions );
  }

  /**
   * Returns an associative array containing the bulk action
   *
   * @return array
   */
  public function get_bulk_actions() {
    $actions = array(
      'bulk-delete' =&gt; 'Delete',
      'bulk-reset' =&gt; 'Reset'
    );

    return $actions;
  }
</code></pre>

<p>Reviewing this one last time, I think I need a function that is called on the name property as an escaped php echo right? Then that function should return either bulk-reset[] or bulk-delete[] based on <code>$_post['delete-*']</code> right???</p>

<p>Since mulling this over, I've tried to pen together the solution, but for whatever reason that <code>action_type</code> function I made does not get called:</p>

<pre><code>  /**
   * Render the bulk edit checkbox
   *
   * @param array $item
   *
   * @return string
   */
  function column_cb( $item ) {

    global $action_type;

    return sprintf(
      '&lt;input type="checkbox" name="'.$action_type.'" value="%s" /&gt;', $item['id']

    );
  }



  /**
   * Pick the Checkbox Value based on post Value
   *
   * 
   * @return string
   *
   */

  public function action_type() {

     if ( ( isset( $_POST['action'] ) &amp;&amp; $_POST['action'] == 'bulk-delete' )
         || ( isset( $_POST['action2'] ) &amp;&amp; $_POST['action2'] == 'bulk-delete' )
    ) {
      $output = "bulk-delete[]";

     } else {
      $output = "bulk-reset[]";
     }
     return $output;

  }
</code></pre>

<p>Edit 2: realizing that won't work because this sets the value post and I needed it set before page load...I guess this means I need to have the array name be generic and the post action handles how to deal with the data... maybe for simplicity sake I should set the edit action to the same bulk-delete data set as its ultimately the same set of checkboxes.</p>

<p>Edit 3: I can't do what I suggest at the end of edit2 because the portion of code to run the actions depends on the array name of the post and that array name is set on page load.  I don't quite know what to do.</p>