WPSEO_Bulk_Description_List_Table

Implements table for bulk description editing.

Defined (1)

The class is defined in the following location(s).

/admin/class-bulk-description-editor-list-table.php  
  1. class WPSEO_Bulk_Description_List_Table extends WPSEO_Bulk_List_Table { 
  2.  
  3. /** 
  4. * Current type for this class will be (meta) description. 
  5. * @var string 
  6. */ 
  7. protected $page_type = 'description'; 
  8.  
  9. /** 
  10. * Settings with are used in __construct 
  11. * @var array 
  12. */ 
  13. protected $settings = array( 
  14. 'singular' => 'wpseo_bulk_description',  
  15. 'plural' => 'wpseo_bulk_descriptions',  
  16. 'ajax' => true,  
  17. ); 
  18.  
  19. /** 
  20. * The field in the database where meta field is saved. 
  21. * @var string 
  22. */ 
  23. protected $target_db_field = 'metadesc'; 
  24.  
  25. /** 
  26. * The columns shown on the table 
  27. * @return array 
  28. */ 
  29. public function get_columns() { 
  30. $columns = array( 
  31. 'col_existing_yoast_seo_metadesc' => __( 'Existing Yoast Meta Description', 'wordpress-seo' ),  
  32. 'col_new_yoast_seo_metadesc' => __( 'New Yoast Meta Description', 'wordpress-seo' ),  
  33. ); 
  34.  
  35. return $this->merge_columns( $columns ); 
  36.  
  37. /** 
  38. * Parse the metadescription 
  39. * @param string $column_name Column name. 
  40. * @param object $record Data object. 
  41. * @param string $attributes HTML attributes. 
  42. * @return string 
  43. */ 
  44. protected function parse_page_specific_column( $column_name, $record, $attributes ) { 
  45. switch ( $column_name ) { 
  46. case 'col_new_yoast_seo_metadesc': 
  47. return sprintf( 
  48. '<textarea id="%1$s" name="%1$s" class="wpseo-new-metadesc" data-id="%2$s" aria-labelledby="col_new_yoast_seo_metadesc"></textarea>',  
  49. 'wpseo-new-metadesc-' . $record->ID,  
  50. $record->ID 
  51. ); 
  52. break; 
  53.  
  54. case 'col_existing_yoast_seo_metadesc': 
  55. // TODO inconsistent return/echo behavior R. 
  56. echo $this->parse_meta_data_field( $record->ID, $attributes ); 
  57. break; 
  58. } /** End of class */