Changeset 2509036
- Timestamp:
- 04/04/2021 06:32:03 PM (5 years ago)
- Location:
- sheetdb/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
sheetdb.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sheetdb/trunk/readme.txt
r2485382 r2509036 25 25 * limit - The number of rows that should be returned 26 26 * offset - Row from which it should start (how many rows to skip) 27 * sheet - If you want to use a different sheet than the first one (default), enter the name of the tab you want to use here. 27 28 * search - You can search for specific data in your sheet. If you want to use more than one condition join them using & symbol. Example: search="name=Tom&age=15" 28 29 * sort-by - The column you want to sort by -
sheetdb/trunk/sheetdb.php
r2361820 r2509036 1 1 <?php 2 2 3 /** 3 4 * @package SheetDB … … 33 34 // Main Plugin Class 34 35 if (!class_exists('WordpressSheetDB')) { 35 class WordpressSheetDB { 36 public function __construct() { 36 class WordpressSheetDB 37 { 38 public function __construct() 39 { 37 40 add_shortcode('sheetdb', [$this, 'sheetdb_shortcode']); 38 41 add_shortcode('sheetdb-slot', [$this, 'sheetdb_slot_shortcode']); … … 41 44 } 42 45 43 public function enqueueAssets() { 44 wp_enqueue_script( 'sheetdb-js', plugins_url('assets/js/sheetdb-handlebars-1.1.5.js', __FILE__) ); 46 public function enqueueAssets() 47 { 48 wp_enqueue_script('sheetdb-js', plugins_url('assets/js/sheetdb-handlebars-1.1.5.js', __FILE__)); 45 49 } 46 50 47 public function sheetdb_shortcode($atts, $content) { 51 public function sheetdb_shortcode($atts, $content) 52 { 48 53 isset($atts['url']) ? $url = $atts['url'] : $url = null; 49 54 isset($atts['element']) ? $element = $atts['element'] : $element = "div"; … … 67 72 } 68 73 69 public function sheetdb_slot_shortcode($atts, $content) { 74 public function sheetdb_slot_shortcode($atts, $content) 75 { 70 76 isset($atts['slot']) ? $slot = $atts['slot'] : $slot = null; 71 77 isset($atts['element']) ? $element = $atts['element'] : $element = "div"; … … 74 80 } 75 81 76 private function makeAdditionalCode($sheet, $limit, $offset, $search, $searchMode, $sortBy, $sortOrder, $sortMethod, $sortDateFormat, $save) { 82 private function makeAdditionalCode($sheet, $limit, $offset, $search, $searchMode, $sortBy, $sortOrder, $sortMethod, $sortDateFormat, $save) 83 { 77 84 $additionalCode = ''; 78 85 if ($sheet) {
Note: See TracChangeset
for help on using the changeset viewer.