Created
January 16, 2021 11:33
-
-
Save gvgvgvijayan/be0bae954fbfb92d4d4a029c425b67cb to your computer and use it in GitHub Desktop.
This gist is used in the tutorial https://www.vijayan.in/how-to-create-custom-table-list-in-wordpress-admin-page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
/** | |
* Column cb. | |
* | |
* @param array $item Item data. | |
* @return string | |
*/ | |
public function column_cb( $item ) { | |
return sprintf( | |
'<input type="checkbox" name="%1$s_id[]" value="%2$s" />', | |
esc_attr( $this->_args['singular'] ), | |
esc_attr( $item['id'] ) | |
); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment