PluginProbe
WP Data Access – App Builder for Tables, Forms, Dashboards, Charts & Maps / 5.5.84
WP Data Access – App Builder for Tables, Forms, Dashboards, Charts & Maps v5.5.84
5.5.87 5.5.85 5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 All 162 releases
← All changes | public/class-wp-data-access-public.php +158 -168 5.5.3 → 5.5.84 View file →
@@ -5,14 +5,14 @@
5 5 *
6 6 * @package plugin\public
7 7 */
8 8 use WPDataAccess\API\WPDA_API;
9 -use WPDataAccess\Data_Apps\WPDA_Apps;
10 9 use WPDataAccess\Data_Dictionary\WPDA_Dictionary_Exist;
11 10 use WPDataAccess\Data_Tables\WPDA_Data_Tables;
12 11 use WPDataAccess\List_Table\WPDA_List_View;
12 +use WPDataAccess\Premium\WPDAPRO_Data_Publisher\WPDAPRO_Data_Publisher_Init;
13 +use WPDataAccess\Utilities\WPDA_Add_App_To_Menu;
13 14 use WPDataAccess\WPDA;
14 -use WPDataAccess\Premium\WPDAPRO_Data_Publisher\WPDAPRO_Data_Publisher_Init;
15 15 /**
16 16 * Class WP_Data_Access_Public
17 17 *
18 18 * Defines public specific functionality for plugin WP Data Access.
@@ -19,8 +19,9 @@
19 19 *
20 20 * @author Peter Schulz
21 21 * @since 1.0.0
22 22 */
23 +// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing -- verified on page
23 24 class WP_Data_Access_Public {
24 25 /**
25 26 * Add stylesheets to front-end
26 27 *
@@ -110,10 +111,10 @@
110 111 );
111 112 // SAVING SPACE - According to the plugin guidelines it is allowed to include external fonts:
112 113 // https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#8-plugins-may-not-send-executable-code-via-third-party-systems .
113 114 // Load fontawesome icons.
115 + // phpcs:disable WordPress.WP.EnqueuedResourceParameters.MissingVersion
114 116 wp_register_style(
115 - // phpcs:ignore WordPress.WP.EnqueuedResourceParameters
116 117 'wpda_fontawesome_icons',
117 118 WPDA::CDN_FONTAWESOME . 'all.min.css',
118 119 array(),
119 120 null,
@@ -229,9 +230,9 @@
229 230 // Toolbar only available on public pages.
230 231 return;
231 232 }
232 233 // Add Apps.
233 - $apps = new WPDA_Apps();
234 + $apps = new WPDA_Add_App_To_Menu();
234 235 $apps->add_apps_to_menu();
235 236 }
236 237
237 238 /**
@@ -254,16 +255,17 @@
254 255 *
255 256 * @since 1.0.0
256 257 */
257 258 public function register_shortcodes() {
258 - add_shortcode( 'wpda_apps', array($this, 'wpda_apps') );
259 259 add_shortcode( 'wpda_app', array($this, 'wpda_app') );
260 + add_shortcode( 'wpda_app_builder', array($this, 'wpda_app_builder') );
260 261 add_shortcode( 'wpda_data_explorer', array($this, 'wpda_data_explorer') );
262 + add_shortcode( 'wpda_query_builder', array($this, 'wpda_query_builder') );
261 263 add_shortcode( 'wpdataaccess', array($this, 'wpdataaccess') );
262 264 add_shortcode( 'wpdadiehard', array($this, 'wpdadiehard') );
263 265 }
264 266
265 - public function wpda_apps( $atts ) {
267 + public function wpda_app_builder( $atts ) {
266 268 $editing = WPDA::is_editing_post();
267 269 if ( false !== $editing ) {
268 270 // Prevent errors when user is editing a post.
269 271 return $editing;
@@ -273,9 +275,9 @@
273 275 $wp_atts = shortcode_atts( array(
274 276 'feedback' => false,
275 277 ), $atts );
276 278 ob_start();
277 - $apps = new WPDataAccess\Data_Apps\WPDA_Apps_List($wp_atts);
279 + $apps = new WPDataAccess\Data_Apps\WPDA_App_Builder($wp_atts);
278 280 $apps->show();
279 281 return ob_get_clean();
280 282 }
281 283
@@ -284,16 +286,42 @@
284 286 if ( false !== $editing ) {
285 287 // Prevent errors when user is editing a post.
286 288 return $editing;
287 289 }
290 + if ( isset( $_POST['is_fb_preview'], $_GET['et_pb_preview'] ) && 'true' === $_POST['is_fb_preview'] && 'true' === $_GET['et_pb_preview'] ) {
291 + // Divi Visual Builder preview not working!
292 + // Dynamic resources are not properly loaded into the Divi Visual Builder.
293 + ob_start();
294 + ?>
295 + <div style="width: 100%; border: 1px solid #ccc; padding: 50px; display: grid; gap: 20px; background-color: rgb(249,249,249); border-radius: 5px;">
296 + <div>
297 + No preview in Visual Builder. App will appear once Visual Builder is closed.
298 + </div>
299 + </div>
300 + <?php
301 + return ob_get_clean();
302 + }
288 303 $atts = array_change_key_case( (array) $atts, CASE_LOWER );
289 304 //phpcs:ignore - 8.1 proof
290 305 $wp_atts = shortcode_atts( array(
291 - 'feedback' => false,
292 - 'app_id' => null,
306 + 'app_id' => null,
307 + 'feedback' => false,
308 + 'builders' => true,
309 + 'hidetitlebar' => false,
310 + 'fullscreen' => false,
311 + 'filter_field_name' => null,
312 + 'filter_field_value' => null,
293 313 ), $atts );
314 + $shortcode_params = array();
315 + foreach ( $atts as $key => $value ) {
316 + if ( !key_exists( $key, $wp_atts ) ) {
317 + $shortcode_params[$key] = $value;
318 + }
319 + }
320 + $shortcode_params['pwa'] = false;
321 + // Shortcode not allowed to use parameter pwa
294 322 ob_start();
295 - $app = new WPDataAccess\Data_Apps\WPDA_App_Container($wp_atts);
323 + $app = new WPDataAccess\Data_Apps\WPDA_App_Container($wp_atts, $shortcode_params);
296 324 $app->show();
297 325 return ob_get_clean();
298 326 }
299 327
@@ -308,13 +336,30 @@
308 336 $wp_atts = shortcode_atts( array(
309 337 'feedback' => false,
310 338 ), $atts );
311 339 ob_start();
312 - $explorer = new WPDataAccess\Data_Apps\WPDA_Explorer_Container($wp_atts);
340 + $explorer = new WPDataAccess\Data_Apps\WPDA_Data_Explorer($wp_atts);
313 341 $explorer->show();
314 342 return ob_get_clean();
315 343 }
316 344
345 + public function wpda_query_builder( $atts ) {
346 + $editing = WPDA::is_editing_post();
347 + if ( false !== $editing ) {
348 + // Prevent errors when user is editing a post.
349 + return $editing;
350 + }
351 + $atts = array_change_key_case( (array) $atts, CASE_LOWER );
352 + //phpcs:ignore - 8.1 proof
353 + $wp_atts = shortcode_atts( array(
354 + 'feedback' => false,
355 + ), $atts );
356 + ob_start();
357 + $qb = new WPDataAccess\Data_Apps\WPDA_Query_Builder($wp_atts);
358 + $qb->show();
359 + return ob_get_clean();
360 + }
361 +
317 362 /**
318 363 * Implementation of shortcode 'wpdataaccess'
319 364 *
320 365 * Checks the values entered on validity (as far as possible) and builds the table based on the given table name,
@@ -409,10 +454,8 @@
409 454 //phpcs:ignore - 8.1 proof
410 455 $wp_atts = shortcode_atts( array(
411 456 'project_id' => '',
412 457 'page_id' => '',
413 - 'schema_name' => $wpdb->dbname,
414 - 'table_name' => '',
415 458 'title' => '',
416 459 'subtitle' => '',
417 460 'bulk_actions_enabled' => false,
418 461 'search_box_enabled' => false,
@@ -422,11 +465,11 @@
422 465 'allow_update' => 'off',
423 466 'allow_delete' => 'off',
424 467 'allow_import' => 'off',
425 468 ), $atts );
426 - if ( '' === $wp_atts['project_id'] && '' === $wp_atts['page_id'] && '' === $wp_atts['table_name'] ) {
427 - // Either a Data Project page (project_id and page_id) or a table name must be provided.
428 - return __( 'ERROR: Missing argument(s) [(project_id and page_id) or table_name]', 'wp-data-access' );
469 + if ( '' === $wp_atts['project_id'] && '' === $wp_atts['page_id'] ) {
470 + // Dashboard menu feature was removed. Parameter table_name no longer valid.
471 + return __( 'ERROR: Missing argument(s) [project_id and page_id]', 'wp-data-access' );
429 472 }
430 473 // Sanitize database values.
431 474 $wp_atts['project_id'] = sanitize_text_field( wp_unslash( $wp_atts['project_id'] ) );
432 475 // input var okay.
@@ -431,12 +474,8 @@
431 474 $wp_atts['project_id'] = sanitize_text_field( wp_unslash( $wp_atts['project_id'] ) );
432 475 // input var okay.
433 476 $wp_atts['page_id'] = sanitize_text_field( wp_unslash( $wp_atts['page_id'] ) );
434 477 // input var okay.
435 - $wp_atts['schema_name'] = sanitize_text_field( wp_unslash( $wp_atts['schema_name'] ) );
436 - // input var okay.
437 - $wp_atts['table_name'] = sanitize_text_field( wp_unslash( $wp_atts['table_name'] ) );
438 - // input var okay.
439 478 // Set default parameter values.
440 479 $bulk_actions_enabled = false;
441 480 $search_box_enabled = false;
442 481 $bulk_export_enabled = false;
@@ -482,41 +521,15 @@
482 521 //phpcs:ignore - 8.1 proof
483 522 if ( count( $filter_field_name_array ) === count( $filter_field_value_array ) ) {
484 523 //phpcs:ignore - 8.1 proof
485 524 // Add filter to where clause.
525 + // phpcs:disable Generic.CodeAnalysis.ForLoopWithTestFunctionCall, Squiz.PHP.DisallowSizeFunctionsInLoops, WordPress.DB.PreparedSQLPlaceholders
486 526 for ($i = 0; $i < count( $filter_field_name_array ); $i++) {
487 - // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall, Squiz.PHP.DisallowSizeFunctionsInLoops
488 - $default_where .= (( '' === $default_where ? '' : ' and ' )) . $wpdb->prepare(
489 - ' `%1s` like %s ',
490 - // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders
491 - array(WPDA::remove_backticks( $filter_field_name_array[$i] ), $filter_field_value_array[$i])
492 - );
527 + $default_where .= (( '' === $default_where ? '' : ' and ' )) . $wpdb->prepare( ' `%1s` like %s ', array(WPDA::remove_backticks( $filter_field_name_array[$i] ), $filter_field_value_array[$i]) );
493 528 }
529 + // phpcs:enable Generic.CodeAnalysis.ForLoopWithTestFunctionCall, Squiz.PHP.DisallowSizeFunctionsInLoops, WordPress.DB.PreparedSQLPlaceholders
494 530 }
495 531 }
496 - // Is this a Data Projects page or a table administration page?
497 - if ( '' !== $wp_atts['project_id'] && '' !== $wp_atts['page_id'] ) {
498 - // phpcs:ignore Generic.CodeAnalysis.EmptyStatement
499 - // Request for Data Projects page (check is performed in WPDP_List_Page).
500 - } else {
501 - // Request for table administration page.
502 - // Check schema name.
503 - if ( 'sys' === $wp_atts['schema_name'] || 'mysql' === $wp_atts['schema_name'] || 'information_schema' === $wp_atts['schema_name'] ) {
504 - // No access to MySQL databases (meta data)!
505 - return __( 'ERROR: No access to MySQL meta data', 'wp-data-access' );
506 - }
507 - // Check database table name.
508 - if ( '' === $wp_atts['table_name'] ) {
509 - // Table name must be provided! No database administration in the public area!
510 - return __( 'ERROR: Missing argument [table_name]', 'wp-data-access' );
511 - }
512 - // Check if table exists (to prevent sql injection) and access is granted.
513 - $wpda_dictionary_checks = new WPDA_Dictionary_Exist($wp_atts['schema_name'], $wp_atts['table_name']);
514 - if ( !$wpda_dictionary_checks->table_exists( true, false ) ) {
515 - // Table not found.
516 - return '<p>' . __( 'ERROR: Invalid table name or not authorized', 'wp-data-access' ) . '</p>';
517 - }
518 - }
519 532 // Make sure user has access to necessary (fake) classes and functions in the frontend.
520 533 require_once plugin_dir_path( __DIR__ ) . 'wp-data-access-diehard.php';
521 534 // Make sure all style and JS is available.
522 535 wp_enqueue_script( 'wpda_admin_scripts' );
@@ -543,134 +556,109 @@
543 556 do_action( 'wpda_wpdadiehard_prepare' );
544 557 ob_start();
545 558 // Set page argument to allow public access.
546 559 $_REQUEST['page'] = 'diehard';
547 - if ( '' !== $wp_atts['project_id'] && '' !== $wp_atts['page_id'] ) {
548 - // Show Data Projects page (check is performed in WPDP_List_Page).
549 - // Get page values.
550 - $project_page = $wpdb->get_results( $wpdb->prepare( "\n select * from {$wpdb->prefix}wpda_project_page\n where project_id = %d\n and page_id = %d\n \t", array($wp_atts['project_id'], $wp_atts['page_id']) ), 'ARRAY_A' );
551 - // db call ok; no-cache ok.
552 - if ( 0 === $wpdb->num_rows ) {
553 - // This should never happen as it was already tested before.
554 - return __( 'ERROR: Data Project page not found [need a valid project_id and page_id]', 'wp-data-access' );
555 - }
556 - if ( 'off' !== WPDA::get_option( WPDA::OPTION_WPDA_USE_ROLES_IN_SHORTCODE ) ) {
557 - // Check if user has role.
558 - $user_roles = WPDA::get_current_user_roles();
559 - if ( false === $user_roles ) {
560 - // Cannot determine the user role(s). Not able to show project menus.
561 - return __( 'ERROR: No access [could not determine user role]', 'wp-data-access' );
560 + // Show Data Projects page (check is performed in WPDP_List_Page).
561 + // Get page values.
562 + // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
563 + $project_page = $wpdb->get_results( $wpdb->prepare( "\n select * from {$wpdb->prefix}wpda_project_page\n where project_id = %d\n and page_id = %d\n \t", array($wp_atts['project_id'], $wp_atts['page_id']) ), 'ARRAY_A' );
564 + // db call ok; no-cache ok.
565 + // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
566 + if ( 0 === $wpdb->num_rows ) {
567 + // This should never happen as it was already tested before.
568 + return __( 'ERROR: Data Project page not found [need a valid project_id and page_id]', 'wp-data-access' );
569 + }
570 + // Check if user has role.
571 + $user_roles = WPDA::get_current_user_roles();
572 + if ( false === $user_roles ) {
573 + // Cannot determine the user role(s). Not able to show project menus.
574 + return __( 'ERROR: No access [could not determine user role]', 'wp-data-access' );
575 + }
576 + $user_has_role = in_array( 'administrator', $user_roles, true );
577 + if ( !$user_has_role && '' !== $project_page[0]['page_role'] && null !== $project_page[0]['page_role'] ) {
578 + $user_role_array = explode( ',', $project_page[0]['page_role'] );
579 + foreach ( $user_role_array as $user_role_array_item ) {
580 + $user_has_role = in_array( $user_role_array_item, $user_roles, true );
581 + if ( $user_has_role ) {
582 + break;
562 583 }
563 - $user_has_role = false;
564 - if ( '' === $project_page[0]['page_role'] || null === $project_page[0]['page_role'] ) {
565 - $user_has_role = in_array( 'administrator', $user_roles, true );
566 - //phpcs:ignore - 8.1 proof
567 - } else {
568 - $user_role_array = explode( ',', $project_page[0]['page_role'] );
569 - //phpcs:ignore - 8.1 proof
570 - foreach ( $user_role_array as $user_role_array_item ) {
571 - $user_has_role = in_array( $user_role_array_item, $user_roles, true );
572 - //phpcs:ignore - 8.1 proof
573 - if ( $user_has_role ) {
574 - break;
575 - }
576 - }
577 - }
578 - if ( !$user_has_role ) {
579 - return __( 'ERROR: No access [missing role]', 'wp-data-access' );
580 - }
581 584 }
582 - // Determine plugin classes to be used.
583 - if ( 'static' === $project_page[0]['page_type'] ) {
584 - return '';
585 - } elseif ( 'table' === $project_page[0]['page_type'] ) {
586 - $list_view_class = 'WPDataProjects\\List_Table\\WPDP_List_View';
587 - $list_table_class = 'WPDataProjects\\List_Table\\WPDP_List_Table';
588 - $edit_form_class = 'WPDataProjects\\Simple_Form\\WPDP_Simple_Form';
585 + }
586 + if ( !$user_has_role ) {
587 + return __( 'ERROR: No access [missing role]', 'wp-data-access' );
588 + }
589 + // Determine plugin classes to be used.
590 + if ( 'static' === $project_page[0]['page_type'] ) {
591 + return '';
592 + } elseif ( 'table' === $project_page[0]['page_type'] ) {
593 + $list_view_class = 'WPDataProjects\\List_Table\\WPDP_List_View';
594 + $list_table_class = 'WPDataProjects\\List_Table\\WPDP_List_Table';
595 + $edit_form_class = 'WPDataProjects\\Simple_Form\\WPDP_Simple_Form';
596 + } else {
597 + $list_view_class = 'WPDataProjects\\Parent_Child\\WPDP_Parent_List_View';
598 + $list_table_class = 'WPDataProjects\\Parent_Child\\WPDP_Parent_List_Table';
599 + $edit_form_class = 'WPDataProjects\\Parent_Child\\WPDP_Parent_Form';
600 + }
601 + if ( null !== $project_page[0]['page_where'] && '' !== $project_page[0]['page_where'] ) {
602 + if ( 'where' === substr( str_replace( ' ', '', $project_page[0]['page_where'] ), 0, 5 ) ) {
603 + $where_clause = " {$project_page[0]['page_where']}";
589 604 } else {
590 - $list_view_class = 'WPDataProjects\\Parent_Child\\WPDP_Parent_List_View';
591 - $list_table_class = 'WPDataProjects\\Parent_Child\\WPDP_Parent_List_Table';
592 - $edit_form_class = 'WPDataProjects\\Parent_Child\\WPDP_Parent_Form';
605 + $where_clause = " where {$project_page[0]['page_where']} ";
593 606 }
594 - if ( null !== $project_page[0]['page_where'] && '' !== $project_page[0]['page_where'] ) {
595 - if ( 'where' === substr( str_replace( ' ', '', $project_page[0]['page_where'] ), 0, 5 ) ) {
596 - $where_clause = " {$project_page[0]['page_where']}";
597 - } else {
598 - $where_clause = " where {$project_page[0]['page_where']} ";
599 - }
600 - $where_clause = WPDA::substitute_environment_vars( $where_clause );
607 + $where_clause = WPDA::substitute_environment_vars( $where_clause );
608 + } else {
609 + $where_clause = '';
610 + }
611 + if ( '' === $default_where ) {
612 + $default_where = $where_clause;
613 + } else {
614 + if ( '' === $where_clause ) {
615 + $default_where = " where {$default_where} ";
601 616 } else {
602 - $where_clause = '';
617 + $default_where = " {$where_clause} and {$default_where} ";
603 618 }
604 - if ( '' === $default_where ) {
605 - $default_where = $where_clause;
606 - } else {
607 - if ( '' === $where_clause ) {
608 - $default_where = " where {$default_where} ";
609 - } else {
610 - $default_where = " {$where_clause} and {$default_where} ";
611 - }
612 - }
613 - $default_orderby = $project_page[0]['page_orderby'];
614 - // Prepare arguments.
615 - $args = array(
616 - 'page_hook_suffix' => 'WPDA_WPDP',
617 - 'wpdaschema_name' => $project_page[0]['page_schema_name'],
618 - 'table_name' => $project_page[0]['page_table_name'],
619 - 'list_table_class' => $list_table_class,
620 - 'edit_form_class' => $edit_form_class,
621 - 'project_id' => $wp_atts['project_id'],
622 - 'page_id' => $wp_atts['page_id'],
623 - 'default_where' => $default_where,
624 - 'where_clause' => $default_where,
625 - 'orderby_clause' => $default_orderby,
626 - );
627 - if ( 'view' === $project_page[0]['page_mode'] ) {
628 - $args['allow_update'] = 'off';
629 - $args['allow_import'] = 'off';
630 - }
631 - if ( 'no' === $project_page[0]['page_allow_insert'] ) {
632 - $args['allow_insert'] = 'off';
633 - $args['allow_import'] = 'off';
634 - }
635 - if ( 'no' === $project_page[0]['page_allow_delete'] ) {
636 - $args['allow_delete'] = 'off';
637 - }
638 - if ( 'only' === $project_page[0]['page_allow_insert'] ) {
639 - $args['action'] = 'new';
640 - $args['allow_insert'] = 'only';
641 - $args['allow_update'] = 'off';
642 - $args['allow_import'] = 'off';
643 - $args['allow_delete'] = 'off';
644 - }
645 - if ( 'no' === $project_page[0]['page_allow_import'] ) {
646 - $args['allow_import'] = 'off';
647 - }
648 - if ( 'no' === $project_page[0]['page_allow_bulk'] ) {
649 - $args['bulk_actions_enabled'] = false;
650 - }
651 - // Show page.
652 - $project_page_view = new $list_view_class($args);
653 - $project_page_view->show();
654 - } else {
655 - // Show table administration page.
656 - $media_manager = new WPDA_List_View(array(
657 - 'wpdaschema_name' => $wp_atts['schema_name'],
658 - 'table_name' => $wp_atts['table_name'],
659 - 'title' => $wp_atts['title'],
660 - 'subtitle' => $wp_atts['subtitle'],
661 - 'bulk_actions_enabled' => $bulk_actions_enabled,
662 - 'search_box_enabled' => $search_box_enabled,
663 - 'bulk_export_enabled' => $bulk_export_enabled,
664 - 'show_view_link' => $show_view_link,
665 - 'allow_insert' => $allow_insert,
666 - 'allow_update' => $allow_update,
667 - 'allow_delete' => $allow_delete,
668 - 'allow_import' => $allow_import,
669 - 'default_where' => $default_where,
670 - ));
671 - $media_manager->show();
672 619 }
620 + $default_orderby = $project_page[0]['page_orderby'];
621 + // Prepare arguments.
622 + $args = array(
623 + 'page_hook_suffix' => 'WPDA_WPDP',
624 + 'wpdaschema_name' => $project_page[0]['page_schema_name'],
625 + 'table_name' => $project_page[0]['page_table_name'],
626 + 'list_table_class' => $list_table_class,
627 + 'edit_form_class' => $edit_form_class,
628 + 'project_id' => $wp_atts['project_id'],
629 + 'page_id' => $wp_atts['page_id'],
630 + 'default_where' => $default_where,
631 + 'where_clause' => $default_where,
632 + 'orderby_clause' => $default_orderby,
633 + );
634 + if ( 'view' === $project_page[0]['page_mode'] ) {
635 + $args['allow_update'] = 'off';
636 + $args['allow_import'] = 'off';
637 + }
638 + if ( 'no' === $project_page[0]['page_allow_insert'] ) {
639 + $args['allow_insert'] = 'off';
640 + $args['allow_import'] = 'off';
641 + }
642 + if ( 'no' === $project_page[0]['page_allow_delete'] ) {
643 + $args['allow_delete'] = 'off';
644 + }
645 + if ( 'only' === $project_page[0]['page_allow_insert'] ) {
646 + $args['action'] = 'new';
647 + $args['allow_insert'] = 'only';
648 + $args['allow_update'] = 'off';
649 + $args['allow_import'] = 'off';
650 + $args['allow_delete'] = 'off';
651 + }
652 + if ( 'no' === $project_page[0]['page_allow_import'] ) {
653 + $args['allow_import'] = 'off';
654 + }
655 + if ( 'no' === $project_page[0]['page_allow_bulk'] ) {
656 + $args['bulk_actions_enabled'] = false;
657 + }
658 + // Show page.
659 + $project_page_view = new $list_view_class($args);
660 + $project_page_view->show();
673 661 ?>
674 662 <script type='text/javascript'>
675 663 // JS variable commonL10n is used in loaded scripts, copied from wp_default_scripts for responsive support
676 664 /* <![CDATA[ */
@@ -710,4 +698,6 @@
710 698 return ob_get_clean();
711 699 }
712 700
713 701 }
702 +
703 +// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing