Changeset 3740921
- Timestamp:
- 10/12/2026 09:06:57 AM (13 days ago)
- Location:
- advanced-data-table-for-elementor
- Files:
-
- 13 added
- 5 edited
-
assets/banner-1544x500.png (modified) ( previous)
-
assets/banner-772x250.png (modified) ( previous)
-
tags/1.0.5 (added)
-
tags/1.0.5/advanced-data-table.php (added)
-
tags/1.0.5/assets (added)
-
tags/1.0.5/assets/css (added)
-
tags/1.0.5/assets/css/adte_style.css (added)
-
tags/1.0.5/assets/css/datatables.min.css (added)
-
tags/1.0.5/assets/js (added)
-
tags/1.0.5/assets/js/adte_script.js (added)
-
tags/1.0.5/assets/js/datatables.min.js (added)
-
tags/1.0.5/languages (added)
-
tags/1.0.5/readme.txt (added)
-
tags/1.0.5/widgets (added)
-
tags/1.0.5/widgets/advanced-data-table-widget.php (added)
-
trunk/advanced-data-table.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/widgets/advanced-data-table-widget.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-data-table-for-elementor/trunk/advanced-data-table.php
r3569851 r3740921 6 6 * Author: PluginsCafe 7 7 * Author URI: https://pluginscafe.com 8 * Version: 1.0. 48 * Version: 1.0.5 9 9 * Description: Advanced Data Table for Elementor is a feature-rich addon to build customizable tables with search, filter, pagination, and more. 10 10 * Text Domain: advanced-data-table-for-elementor … … 24 24 public static $_instance = null; 25 25 26 const version = '1.0. 4';26 const version = '1.0.5'; 27 27 28 28 public function __construct() { -
advanced-data-table-for-elementor/trunk/readme.txt
r3569954 r3740921 5 5 Requires at least: 6.5 6 6 Requires PHP: 7.4 7 Tested up to: 7. 08 Stable tag: 1.0. 47 Tested up to: 7.1 8 Stable tag: 1.0.5 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html … … 13 13 14 14 == Description == 15 ** Table Addons for Elementor – Responsive Table Builder** is the most powerful and intuitive responsive table builder plugin designed exclusively for Elementor. If you are looking to create stunning, interactive, and highly customizable data tables on your WordPress website without writing a single line of code, this is the perfect solution.15 **Advanced Data Table for Elementor** is the most powerful and intuitive responsive table builder plugin designed exclusively for Elementor. If you are looking to create stunning, interactive, and highly customizable data tables on your WordPress website without writing a single line of code, this is the perfect solution. 16 16 17 17 Whether you need to display product comparisons, pricing plans, directories, or statistical data, our **Elementor table widget** gives you complete control over your table's design and functionality directly within the familiar Elementor page builder interface. 18 18 19 ### 🚀 Why Choose Table Addons for Elementor – Responsive Table Builder? 19 [View Demo Tables & Examples](https://demo.pluginscafe.com/advanced-data-table-for-elementor/) 20 21 ### 🚀 Why Choose Advanced Data Table for Elementor? 20 22 Creating tables in WordPress can be a hassle, but not anymore. Our plugin offers a seamless drag-and-drop experience, allowing you to design beautiful **responsive tables** with real-time live preview. 21 23 22 * **Multiple Data Sources:** Create tables manually using static data, effortlessly import data from **CSV files**, or dynamically generate tables from **WordPress Users** data.24 * **Multiple Data Sources:** Create tables manually using static data, effortlessly import data from **CSV files**, or dynamically generate tables from **WordPress Posts**, **Pages**, and **Users** data. 23 25 * **Interactive DataTables:** Powered by DataTables.js, instantly add advanced features like **live search**, **multi-column filtering**, **sorting**, and **pagination** to make large datasets easy to navigate. 24 26 * **100% Mobile Responsive:** Ensure your data tables look perfect on all devices. … … 29 31 * **CSV Import:** Quickly convert CSV data into a fully functional WordPress table. 30 32 * **WordPress Users Data:** Display lists of registered users—perfect for member directories. 33 * **WordPress Posts & Pages Data:** Turn your posts and pages into sortable, searchable tables (title, featured image, excerpt, author, date, categories, tags, and more). 31 34 * **Advanced Merging:** Manage complex layouts with ColSpan and RowSpan support. 32 35 * **Export Options:** Allow users to export table data as CSV, Excel, or copy to clipboard. 33 34 [View Demo Tables & Examples](https://demo.pluginscafe.com/advanced-data-table-for-elementor/)35 36 36 37 == Key Features: == 37 38 * Static Data 38 39 * CSV Data 39 * WordPress Users Data (new) 40 * WordPress Users Data 41 * WordPress Posts Data (new) 42 * WordPress Pages Data (new) 43 * Featured Image Support (new) 40 44 * Live Customization 41 45 * Merge & Split Cells … … 53 57 * Export in CSV, Excel and Copy 54 58 * and more... 59 60 == Supported Data Sources & Fields: == 61 62 = Static Data = 63 * Text 64 * Editor (WYSIWYG) 65 * Icon 66 * Image 67 * Button 68 69 = CSV Data = 70 * Upload CSV file or import from a remote CSV URL 71 * First row is used as the table header automatically 72 73 = WordPress Users Data = 74 * First Name 75 * Last Name 76 * Username 77 * Profile Image 78 * Website URL 79 * Bio 80 * Email 81 * User Role 82 83 = WordPress Posts Data = 84 * Title (optionally linked to the post) 85 * Featured Image (optionally linked to the post) 86 * Excerpt 87 * Content 88 * Permalink 89 * Author 90 * Date 91 * Categories 92 * Tags 93 * Comments 94 * Status 95 * ID 96 97 = WordPress Pages Data = 98 * Same fields as WordPress Posts 55 99 56 100 For search, filter, pagination and more advanced feature, this plugin use [datatables.js](https://datatables.net/) js library. … … 102 146 == Change log == 103 147 148 = 1.0.5 = 149 * Added WordPress Posts data source type 150 * Added WordPress Pages data source type 151 * Post fields: Title, Featured Image, Excerpt, Content, Permalink, Author, Date, Categories, Tags, Comments, Status, ID 152 * Optional "Link to Post" for Title and Featured Image columns 153 * Query controls: number of items, order by, order 154 104 155 = 1.0.4 = 105 156 * Added WordPress Users data source type -
advanced-data-table-for-elementor/trunk/widgets/advanced-data-table-widget.php
r3569851 r3740921 112 112 $source['csv'] = __('CSV', 'advanced-data-table-for-elementor'); 113 113 $source['user'] = __('WordPress Users', 'advanced-data-table-for-elementor'); 114 $source['post'] = __('WordPress Posts', 'advanced-data-table-for-elementor'); 115 $source['page'] = __('WordPress Pages', 'advanced-data-table-for-elementor'); 114 116 115 117 return $source; … … 371 373 'condition' => [ 372 374 'adte_data_source' => 'user', 375 ], 376 ] 377 ); 378 379 $repeater_post = new Repeater(); 380 381 $repeater_post->add_control( 382 'column_heading', 383 [ 384 'label' => esc_html__('Column Heading', 'advanced-data-table-for-elementor'), 385 'type' => Controls_Manager::TEXT, 386 'default' => esc_html__('Post Column', 'advanced-data-table-for-elementor'), 387 'label_block' => true, 388 ] 389 ); 390 391 $repeater_post->add_control( 392 'post_field', 393 [ 394 'label' => esc_html__('Post Field', 'advanced-data-table-for-elementor'), 395 'type' => Controls_Manager::SELECT, 396 'options' => [ 397 'post_title' => __('Title', 'advanced-data-table-for-elementor'), 398 'featured_image' => __('Featured Image', 'advanced-data-table-for-elementor'), 399 'post_excerpt' => __('Excerpt', 'advanced-data-table-for-elementor'), 400 'post_content' => __('Content', 'advanced-data-table-for-elementor'), 401 'permalink' => __('Permalink', 'advanced-data-table-for-elementor'), 402 'author' => __('Author', 'advanced-data-table-for-elementor'), 403 'post_date' => __('Date', 'advanced-data-table-for-elementor'), 404 'categories' => __('Categories', 'advanced-data-table-for-elementor'), 405 'tags' => __('Tags', 'advanced-data-table-for-elementor'), 406 'comment_count' => __('Comments', 'advanced-data-table-for-elementor'), 407 'post_status' => __('Status', 'advanced-data-table-for-elementor'), 408 'ID' => __('ID', 'advanced-data-table-for-elementor'), 409 ], 410 'default' => 'post_title', 411 ] 412 ); 413 414 $repeater_post->add_control( 415 'link_to_post', 416 [ 417 'label' => __('Link to Post', 'advanced-data-table-for-elementor'), 418 'type' => Controls_Manager::SWITCHER, 419 'label_off' => __('No', 'advanced-data-table-for-elementor'), 420 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 421 'condition' => [ 422 'post_field' => ['post_title', 'featured_image'], 423 ], 424 ] 425 ); 426 427 $repeater_post->add_control( 428 'advance', 429 [ 430 'label' => __('Advance Settings', 'advanced-data-table-for-elementor'), 431 'type' => Controls_Manager::SWITCHER, 432 'label_off' => __('No', 'advanced-data-table-for-elementor'), 433 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 434 ] 435 ); 436 437 $repeater_post->add_control( 438 'customwidth', 439 [ 440 'label' => __('Custom Width', 'advanced-data-table-for-elementor'), 441 'type' => Controls_Manager::SWITCHER, 442 'condition' => [ 443 'advance' => 'yes', 444 ], 445 'label_off' => __('No', 'advanced-data-table-for-elementor'), 446 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 447 ] 448 ); 449 450 $repeater_post->add_responsive_control( 451 'width', 452 [ 453 'label' => __('Width', 'advanced-data-table-for-elementor'), 454 'type' => Controls_Manager::SLIDER, 455 'condition' => [ 456 'advance' => 'yes', 457 'customwidth' => 'yes', 458 ], 459 'range' => [ 460 '%' => [ 461 'min' => 0, 462 'max' => 100, 463 ], 464 'px' => [ 465 'min' => 1, 466 'max' => 1000, 467 ], 468 ], 469 'devices' => ['desktop', 'tablet', 'mobile'], 470 'default' => [ 471 'size' => 30, 472 'unit' => '%', 473 ], 474 'size_units' => ['%', 'px'], 475 'selectors' => [ 476 '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', 477 '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', 478 ] 479 ] 480 ); 481 482 $repeater_post->add_control( 483 'post_align', 484 [ 485 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 486 'type' => Controls_Manager::CHOOSE, 487 'options' => [ 488 'left' => [ 489 'title' => __('Left', 'advanced-data-table-for-elementor'), 490 'icon' => 'eicon-h-align-left', 491 ], 492 'center' => [ 493 'title' => __('Center', 'advanced-data-table-for-elementor'), 494 'icon' => 'eicon-h-align-center', 495 ], 496 'right' => [ 497 'title' => __('Right', 'advanced-data-table-for-elementor'), 498 'icon' => 'eicon-h-align-right', 499 ], 500 'justify' => [ 501 'title' => __('Justified', 'advanced-data-table-for-elementor'), 502 'icon' => 'eicon-h-align-stretch', 503 ], 504 ], 505 'default' => '', 506 'selectors' => [ 507 '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', 508 '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', 509 ], 510 'condition' => [ 511 'advance' => 'yes', 512 ] 513 ] 514 ); 515 516 $repeater_post->add_control( 517 'post_v_align', 518 [ 519 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 520 'type' => Controls_Manager::CHOOSE, 521 'options' => [ 522 'top' => [ 523 'title' => __('Top', 'advanced-data-table-for-elementor'), 524 'icon' => 'eicon-v-align-top', 525 ], 526 'middle' => [ 527 'title' => __('Middle', 'advanced-data-table-for-elementor'), 528 'icon' => 'eicon-v-align-middle', 529 ], 530 'bottom' => [ 531 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 532 'icon' => 'eicon-v-align-bottom', 533 ], 534 ], 535 'default' => '', 536 'selectors' => [ 537 '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', 538 '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', 539 ], 540 'condition' => [ 541 'advance' => 'yes', 542 ] 543 ] 544 ); 545 546 $repeater_post->add_control( 547 'post_content_color', 548 [ 549 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 550 'type' => Controls_Manager::COLOR, 551 'selectors' => [ 552 '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'color: {{VALUE}};', 553 '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'color: {{VALUE}};', 554 ], 555 'condition' => [ 556 'advance' => 'yes', 557 ] 558 ] 559 ); 560 561 $repeater_post->add_control( 562 'post_content_bg', 563 [ 564 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 565 'type' => Controls_Manager::COLOR, 566 'selectors' => [ 567 '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', 568 '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', 569 ], 570 'condition' => [ 571 'advance' => 'yes', 572 ] 573 ] 574 ); 575 576 $this->add_control( 577 'adte_post_columns', 578 [ 579 'label' => esc_html__('Post Columns', 'advanced-data-table-for-elementor'), 580 'type' => Controls_Manager::REPEATER, 581 'fields' => $repeater_post->get_controls(), 582 'default' => [ 583 [ 584 'column_heading' => __('Title', 'advanced-data-table-for-elementor'), 585 'post_field' => 'post_title', 586 ], 587 [ 588 'column_heading' => __('Author', 'advanced-data-table-for-elementor'), 589 'post_field' => 'author', 590 ], 591 [ 592 'column_heading' => __('Date', 'advanced-data-table-for-elementor'), 593 'post_field' => 'post_date', 594 ], 595 [ 596 'column_heading' => __('Categories', 'advanced-data-table-for-elementor'), 597 'post_field' => 'categories', 598 ], 599 ], 600 'title_field' => '{{{ column_heading }}}', 601 'condition' => [ 602 'adte_data_source' => ['post', 'page'], 603 ], 604 ] 605 ); 606 607 $this->add_control( 608 'adte_posts_per_page', 609 [ 610 'label' => __('Number of Items', 'advanced-data-table-for-elementor'), 611 'type' => Controls_Manager::NUMBER, 612 'default' => 10, 613 'min' => -1, 614 'max' => 500, 615 'description' => __('Maximum number of posts to show. Use -1 to show all.', 'advanced-data-table-for-elementor'), 616 'condition' => [ 617 'adte_data_source' => ['post', 'page'], 618 ], 619 'separator' => 'before', 620 ] 621 ); 622 623 $this->add_control( 624 'adte_orderby', 625 [ 626 'label' => __('Order By', 'advanced-data-table-for-elementor'), 627 'type' => Controls_Manager::SELECT, 628 'options' => [ 629 'date' => __('Date', 'advanced-data-table-for-elementor'), 630 'title' => __('Title', 'advanced-data-table-for-elementor'), 631 'modified' => __('Last Modified', 'advanced-data-table-for-elementor'), 632 'menu_order' => __('Menu Order', 'advanced-data-table-for-elementor'), 633 'comment_count' => __('Comment Count', 'advanced-data-table-for-elementor'), 634 'rand' => __('Random', 'advanced-data-table-for-elementor'), 635 ], 636 'default' => 'date', 637 'condition' => [ 638 'adte_data_source' => ['post', 'page'], 639 ], 640 ] 641 ); 642 643 $this->add_control( 644 'adte_order', 645 [ 646 'label' => __('Order', 'advanced-data-table-for-elementor'), 647 'type' => Controls_Manager::SELECT, 648 'options' => [ 649 'DESC' => __('Descending', 'advanced-data-table-for-elementor'), 650 'ASC' => __('Ascending', 'advanced-data-table-for-elementor'), 651 ], 652 'default' => 'DESC', 653 'condition' => [ 654 'adte_data_source' => ['post', 'page'], 373 655 ], 374 656 ] … … 3511 3793 if ('user' == $settings['adte_data_source']) { 3512 3794 return $this->user_table_render($settings); 3795 } 3796 3797 if ('post' == $settings['adte_data_source'] || 'page' == $settings['adte_data_source']) { 3798 return $this->post_table_render($settings); 3513 3799 } 3514 3800 … … 3576 3862 } 3577 3863 3864 /** 3865 * Renders a table populated with WordPress posts or pages. 3866 * 3867 * @param array $settings The widget settings. 3868 */ 3869 protected function post_table_render($settings) { 3870 $columns = !empty($settings['adte_post_columns']) ? $settings['adte_post_columns'] : []; 3871 if (empty($columns)) { 3872 echo '<p>' . esc_html__('Please add columns to display.', 'advanced-data-table-for-elementor') . '</p>'; 3873 return; 3874 } 3875 3876 $posts_per_page = isset($settings['adte_posts_per_page']) ? (int) $settings['adte_posts_per_page'] : 10; 3877 if (0 === $posts_per_page || $posts_per_page < -1) { 3878 $posts_per_page = 10; 3879 } 3880 3881 $args = [ 3882 'post_type' => ('page' === $settings['adte_data_source']) ? 'page' : 'post', 3883 'post_status' => 'publish', 3884 'posts_per_page' => $posts_per_page, 3885 'orderby' => !empty($settings['adte_orderby']) ? $settings['adte_orderby'] : 'date', 3886 'order' => ('ASC' === $settings['adte_order']) ? 'ASC' : 'DESC', 3887 'ignore_sticky_posts' => true, 3888 'no_found_rows' => true, 3889 'update_post_meta_cache' => false, 3890 ]; 3891 3892 $query = new \WP_Query($args); 3893 3894 if (!$query->have_posts()) { 3895 $label = ('page' === $settings['adte_data_source']) ? __('pages', 'advanced-data-table-for-elementor') : __('posts', 'advanced-data-table-for-elementor'); 3896 printf( 3897 '<p class="adte_csv_error">%s</p>', 3898 sprintf( 3899 /* translators: %s: post type label */ 3900 esc_html__('No published %s found.', 'advanced-data-table-for-elementor'), 3901 esc_html($label) 3902 ) 3903 ); 3904 return; 3905 } 3906 3907 $table_init_class = 'adte_table_init'; 3908 3909 ?> 3910 <table class="adte_table <?php echo esc_attr($table_init_class); ?>"> 3911 <thead class="adte_table_header"> 3912 <tr> 3913 <?php foreach ($columns as $index => $column) : 3914 $table_header_key = $this->get_repeater_setting_key('column_heading', 'adte_post_columns', $index); 3915 $this->add_render_attribute($table_header_key, 'class', 'elementor-repeater-item-' . esc_attr($column['_id'])); 3916 if ($settings['adte_enable_sort'] == 'yes') { 3917 $this->add_render_attribute($table_header_key, 'class', 'sorting'); 3918 } 3919 ?> 3920 <th <?php echo $this->get_render_attribute_string($table_header_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 3921 ?>> 3922 <?php echo esc_html($column['column_heading']); ?> 3923 </th> 3924 <?php endforeach; ?> 3925 </tr> 3926 </thead> 3927 <tbody class="adte_table_body"> 3928 <?php foreach ($query->posts as $post) : ?> 3929 <tr> 3930 <?php foreach ($columns as $column) : 3931 $field = $column['post_field']; 3932 $link = (!empty($column['link_to_post']) && 'yes' === $column['link_to_post']) ? true : false; 3933 ?> 3934 <td class="elementor-repeater-item-<?php echo esc_attr($column['_id']); ?>"> 3935 <?php echo $this->get_post_cell_value($post, $field, $link, $settings); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- value is escaped in the helper ?> 3936 </td> 3937 <?php endforeach; ?> 3938 </tr> 3939 <?php endforeach; ?> 3940 </tbody> 3941 </table> 3942 <?php 3943 wp_reset_postdata(); 3944 } 3945 3946 /** 3947 * Returns the (escaped) HTML value of a single post field for a table cell. 3948 * 3949 * @param \WP_Post $post The post object. 3950 * @param string $field The field to render. 3951 * @param bool $link Whether to link the value to the post. 3952 * @param array $settings The widget settings. 3953 * @return string Escaped/safe HTML. 3954 */ 3955 protected function get_post_cell_value($post, $field, $link = false, $settings = []) { 3956 switch ($field) { 3957 case 'ID': 3958 return esc_html($post->ID); 3959 3960 case 'post_title': 3961 $title = esc_html(get_the_title($post)); 3962 if (empty($title)) { 3963 $title = esc_html__('(no title)', 'advanced-data-table-for-elementor'); 3964 } 3965 return $link ? '<a href="' . esc_url(get_permalink($post)) . '">' . $title . '</a>' : $title; 3966 3967 case 'featured_image': 3968 if (!has_post_thumbnail($post)) { 3969 return '—'; 3970 } 3971 $size = !empty($settings['adte_image_size']) ? $settings['adte_image_size'] : 'thumbnail'; 3972 $image = get_the_post_thumbnail($post, $size); 3973 return $link ? '<a href="' . esc_url(get_permalink($post)) . '">' . $image . '</a>' : $image; 3974 3975 case 'post_excerpt': 3976 $excerpt = wp_strip_all_tags(get_the_excerpt($post)); 3977 return esc_html(wp_trim_words($excerpt, 30, '…')); 3978 3979 case 'post_content': 3980 $content = wp_strip_all_tags(strip_shortcodes($post->post_content)); 3981 return esc_html(wp_trim_words($content, 40, '…')); 3982 3983 case 'permalink': 3984 $url = esc_url(get_permalink($post)); 3985 return '<a href="' . $url . '">' . $url . '</a>'; 3986 3987 case 'author': 3988 return esc_html(get_the_author_meta('display_name', $post->post_author)); 3989 3990 case 'post_date': 3991 return esc_html(get_the_date(get_option('date_format'), $post)); 3992 3993 case 'categories': 3994 $terms = get_the_category($post->ID); 3995 return (!empty($terms) && !is_wp_error($terms)) ? esc_html(implode(', ', wp_list_pluck($terms, 'name'))) : '—'; 3996 3997 case 'tags': 3998 $terms = get_the_tags($post->ID); 3999 return (!empty($terms) && !is_wp_error($terms)) ? esc_html(implode(', ', wp_list_pluck($terms, 'name'))) : '—'; 4000 4001 case 'comment_count': 4002 return esc_html(number_format_i18n($post->comment_count)); 4003 4004 case 'post_status': 4005 return esc_html($post->post_status); 4006 4007 default: 4008 return apply_filters('adte_post_field_value', '', $post, $field, $link); 4009 } 4010 } 4011 3578 4012 protected function static_table_render($settings) { 3579 4013 $table_init_class = '';
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)