From 8fce6309e0a8327c6434d03179fe8d1224940c4c Mon Sep 17 00:00:00 2001 From: Prasath Nadarajah <n.prasath.002@gmail.com> Date: Fri, 3 Aug 2012 02:17:57 -0700 Subject: [PATCH] dynamic tables to display tables --- .../push-syndication-server.php | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/push-syndication-server/push-syndication-server.php b/push-syndication-server/push-syndication-server.php index 44fad79..ae9b978 100644 --- a/push-syndication-server/push-syndication-server.php +++ b/push-syndication-server/push-syndication-server.php @@ -413,23 +413,38 @@ class Push_Syndication_Server { $selected_siteoptions = !empty( $selected_siteoptions ) ? $selected_siteoptions : array() ; $site_options = wp_load_alloptions(); + $chunked_arrays = array_chunk( $site_options, 5, true ); - foreach( $site_options as $key => $value ) { + echo '<table border="1">'; + echo '<tbody>'; + + foreach( $chunked_arrays as $chunked_array ) { + + echo '<tr>'; + + foreach( $chunked_array as $key => $value ) { if( $key[0] == '_' ) continue; ?> - <p> - <label> - <input type="checkbox" name="syn_selected_siteoptions[]" value="<?php echo esc_html( $key ); ?>" <?php $this->checked_array( $key, $selected_siteoptions ) ?> /> - <?php echo esc_html( $key ); ?> - </label> - </p> + <td> + <label> + <input type="checkbox" name="syn_selected_siteoptions[]" value="<?php echo esc_html( $key ); ?>" <?php $this->checked_array( $key, $selected_siteoptions ) ?> /> + <?php echo esc_html( $key ); ?> + </label> + </td> <?php + } + + echo '</tr>'; + } + echo '</tbody'; + echo '</table>'; + } /******* SYNCING OPTIONS *******/ -- GitLab