← All changes
|
WPDataAccess/Dashboard/WPDA_Widget_Publication.php
+9
-9
5.5.76
→
5.5.85
View file →
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing -- verified on page | |
| 3 | 4 | namespace WPDataAccess\Dashboard; |
| 4 | 5 | |
| 5 | 6 | use WPDataAccess\Data_Tables\WPDA_Data_Tables; |
| 6 | 7 | use WPDataAccess\Plugin_Table_Models\WPDA_Publisher_Model; |
| @@ -96,28 +97,23 @@ | ||
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | protected function container() { |
| 99 | 100 | ob_start(); |
| 101 | + // phpcs:disable WordPress.Security.EscapeOutput | |
| 100 | 102 | echo parent::container(); |
| 101 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 102 | 103 | $post_publication = ( $this->search_header ? "post_publication_widget('{$this->table_name}', '{$this->pub_id}');" : '' ); |
| 103 | 104 | $post_content = "\n\t\t\t\t<div id='wpda-panel-pub-id-{$this->pub_id}' style='display: block'>\n\t\t\t\t\t{$this->pub_content}\n\t\t\t\t</div>\n\t\t\t\t<script type='application/javascript'>\n\t\t\t\tjQuery(function() {\n\t\t\t\t\tsetTimeout(waitUntilWidgetIsLoaded_{$this->pub_id}, 1000);\n\t\t\t\t\tfunction waitUntilWidgetIsLoaded_{$this->pub_id}() {\n\t\t\t\t\t\tif (jQuery('#wpda-widget-{$this->widget_id} div.ui-widget-content').length>0) {\n\t\t\t\t\t\t\tjQuery('#wpda-widget-{$this->widget_id} div.ui-widget-content').html('');\n\t\t\t\t\t\t\tjQuery('#wpda-panel-pub-id-{$this->pub_id}').appendTo(jQuery('#wpda-widget-{$this->widget_id} div.ui-widget-content'));\n\t\t\t\t\t\t\tjQuery('#{$this->table_name}{$this->pub_id}').DataTable().responsive.recalc();\n\t\t\t\t\t\t\tjQuery('#{$this->table_name}{$this->pub_id}').DataTable().columns.adjust();\n\t\t\t\t\t\t\t{$post_publication}\n\t\t\t\t\t\t\t// console.log('WP Data Access data table libraries loaded...');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(waitUntilWidgetIsLoaded_{$this->pub_id}, 1000);\n\t\t\t\t\t\t\tconsole.log('Waiting for WP Data Access data table libraries to be loaded...');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t"; |
| 104 | 105 | echo $post_content; |
| 105 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 106 | + // phpcs:enable WordPress.Security.EscapeOutput | |
| 106 | 107 | return ob_get_clean(); |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | public static function widget() { |
| 110 | 111 | $panel_name = ( isset( $_REQUEST['wpda_panel_name'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_panel_name'] ) ) : '' ); |
| 111 | - // input var okay.; | |
| 112 | 112 | $panel_pub_id = ( isset( $_REQUEST['wpda_panel_pub_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_panel_pub_id'] ) ) : '' ); |
| 113 | - // input var okay.; | |
| 114 | 113 | $panel_column = ( isset( $_REQUEST['wpda_panel_column'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_panel_column'] ) ) : '1' ); |
| 115 | - // input var okay.; | |
| 116 | 114 | $column_position = ( isset( $_REQUEST['wpda_column_position'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_column_position'] ) ) : 'prepend' ); |
| 117 | - // input var okay.; | |
| 118 | 115 | $widget_sequence_nr = ( isset( $_REQUEST['wpda_widget_sequence_nr'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_widget_sequence_nr'] ) ) : '1' ); |
| 119 | - // input var okay.; | |
| 120 | 116 | $wdg = new WPDA_Widget_Publication(array( |
| 121 | 117 | 'name' => $panel_name, |
| 122 | 118 | 'pub_id' => $panel_pub_id, |
| 123 | 119 | 'column' => $panel_column, |
| @@ -124,16 +120,20 @@ | ||
| 124 | 120 | 'position' => $column_position, |
| 125 | 121 | 'widget_id' => $widget_sequence_nr, |
| 126 | 122 | )); |
| 127 | 123 | WPDA::sent_header( 'text/html; charset=UTF-8' ); |
| 124 | + // phpcs:disable WordPress.Security.EscapeOutput | |
| 128 | 125 | echo $wdg->container(); |
| 129 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 126 | + // phpcs:enable WordPress.Security.EscapeOutput | |
| 130 | 127 | wp_die(); |
| 131 | 128 | } |
| 132 | 129 | |
| 133 | 130 | public static function refresh() { |
| 131 | + // phpcs:disable WordPress.Security.EscapeOutput | |
| 134 | 132 | echo static::msg( 'ERROR', 'Method not available for this panel type' ); |
| 135 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 133 | + // phpcs:enable WordPress.Security.EscapeOutput | |
| 136 | 134 | wp_die(); |
| 137 | 135 | } |
| 138 | 136 | |
| 139 | 137 | } |
| 138 | + | |
| 139 | +// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing | |