Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

54 lignes
1.1 KiB

  1. <?php
  2. /**
  3. * Helper functions for displaying a list of items in an ajaxified HTML table.
  4. *
  5. * @package WordPress
  6. * @subpackage List_Table
  7. * @since 4.7.0
  8. */
  9. /**
  10. * Helper class to be used only by back compat functions
  11. *
  12. * @since 3.1.0
  13. */
  14. class _WP_List_Table_Compat extends WP_List_Table {
  15. public $_screen;
  16. public $_columns;
  17. public function __construct( $screen, $columns = array() ) {
  18. if ( is_string( $screen ) )
  19. $screen = convert_to_screen( $screen );
  20. $this->_screen = $screen;
  21. if ( !empty( $columns ) ) {
  22. $this->_columns = $columns;
  23. add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
  24. }
  25. }
  26. /**
  27. * @access protected
  28. *
  29. * @return array
  30. */
  31. protected function get_column_info() {
  32. $columns = get_column_headers( $this->_screen );
  33. $hidden = get_hidden_columns( $this->_screen );
  34. $sortable = array();
  35. $primary = $this->get_default_primary_column_name();
  36. return array( $columns, $hidden, $sortable, $primary );
  37. }
  38. /**
  39. * @access public
  40. *
  41. * @return array
  42. */
  43. public function get_columns() {
  44. return $this->_columns;
  45. }
  46. }