| @@ -256,11 +256,9 @@ | ||
| 256 | 256 | // Allow theme/plugins to override defaults |
| 257 | 257 | $column_defaults = apply_filters( 'posts_data_table_column_defaults_' . self::$table_count, apply_filters( 'posts_data_table_column_defaults', self::get_column_defaults() ) ); |
| 258 | 258 | |
| 259 | 259 | // Load the scripts and styles. |
| 260 | - $load_scripts = apply_filters( 'posts_data_table_load_scripts', true ); | |
| 261 | - | |
| 262 | - if ( $load_scripts ) { | |
| 260 | + if ( apply_filters( 'posts_data_table_load_scripts', true ) ) { | |
| 263 | 261 | wp_enqueue_style( 'posts-data-table' ); |
| 264 | 262 | |
| 265 | 263 | wp_localize_script( |
| 266 | 264 | 'posts-data-table', |
| @@ -300,11 +298,10 @@ | ||
| 300 | 298 | |
| 301 | 299 | foreach ( $hidden_columns as $column ) { |
| 302 | 300 | $table_head .= sprintf( '<th data-name="%s" data-visible="false"></th>', $column ); |
| 303 | 301 | |
| 304 | - // Make sure data for the hidden column is included in table content. | |
| 305 | - // The 'pdt-hidden-column' class hides it via CSS so it never briefly flashes on screen while DataTables initialises. | |
| 306 | - $body_row_fmt .= sprintf( '<td class="pdt-hidden-column">{%s}</td>', $column ); | |
| 302 | + // Make sure data for the hidden column is included in table content | |
| 303 | + $body_row_fmt .= sprintf( $cell_fmt, $column ); | |
| 307 | 304 | } |
| 308 | 305 | |
| 309 | 306 | $table_head = sprintf( '<thead><tr>%s</tr></thead>', $table_head ); |
| 310 | 307 | |
| @@ -315,9 +312,9 @@ | ||
| 315 | 312 | foreach ( (array) $all_posts as $_post ) { |
| 316 | 313 | setup_postdata( $_post ); |
| 317 | 314 | |
| 318 | 315 | // Format title |
| 319 | - $title = sprintf( '<a href="%1$s">%2$s</a>', esc_url( get_permalink( $_post ) ), esc_html( get_the_title( $_post ) ) ); | |
| 316 | + $title = sprintf( '<a href="%1$s">%2$s</a>', get_permalink( $_post ), get_the_title( $_post ) ); | |
| 320 | 317 | |
| 321 | 318 | // Format author |
| 322 | 319 | $author = sprintf( |
| 323 | 320 | '<a href="%1$s" title="%2$s" rel="author">%3$s</a>', |
| @@ -323,9 +320,9 @@ | ||
| 323 | 320 | '<a href="%1$s" title="%2$s" rel="author">%3$s</a>', |
| 324 | 321 | esc_url( get_author_posts_url( $_post->post_author ) ), |
| 325 | 322 | /* translators: %s: the author's name */ |
| 326 | 323 | esc_attr( sprintf( __( 'Posts by %s', 'posts-data-table' ), get_the_author() ) ), |
| 327 | - esc_html( get_the_author() ) | |
| 324 | + get_the_author() | |
| 328 | 325 | ); |
| 329 | 326 | |
| 330 | 327 | $post_data_trans = apply_filters( |
| 331 | 328 | 'posts_data_table_row_data_format', |
| @@ -362,13 +359,8 @@ | ||
| 362 | 359 | $table_class = 'posts-data-table'; |
| 363 | 360 | |
| 364 | 361 | if ( ! $args['wrap'] ) { |
| 365 | 362 | $table_class .= ' nowrap'; |
| 366 | - } | |
| 367 | - | |
| 368 | - // Keep the raw table hidden until the DataTables JS has initialised, so it never briefly flashes unstyled on screen. | |
| 369 | - if ( $load_scripts ) { | |
| 370 | - $table_class .= ' pdt-loading'; | |
| 371 | 363 | } |
| 372 | 364 | |
| 373 | 365 | $table_attributes = sprintf( |
| 374 | 366 | 'id="posts-table-%1$u" class="%2$s" data-page-length="%3$u" data-paging="%4$s" data-order=\'%5$s\' data-click-filter="%6$s" data-scroll-offset="%7$s" cellspacing="0" width="100%%"', |