wp_print_update_row_templates

Prints the JavaScript templates for update and deletion rows in list tables.

Description

wp_print_update_row_templates(); 

The update template takes one argument with four values:

Arguments for the update row


Usage

  1. if ( !function_exists( 'wp_print_update_row_templates' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/update.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_print_update_row_templates(); 
  7.  

Defined (1)

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

/wp-admin/includes/update.php  
  1. function wp_print_update_row_templates() { 
  2. ?> 
  3. <script id="tmpl-item-update-row" type="text/template"> 
  4. <tr class="plugin-update-tr update" id="{{ data.slug }}-update" data-slug="{{ data.slug }}" <# if ( data.plugin ) { #>data-plugin="{{ data.plugin }}"<# } #>> 
  5. <td colspan="{{ data.colspan }}" class="plugin-update colspanchange"> 
  6. {{{ data.content }}} 
  7. </td> 
  8. </tr> 
  9. </script> 
  10. <script id="tmpl-item-deleted-row" type="text/template"> 
  11. <tr class="plugin-deleted-tr inactive deleted" id="{{ data.slug }}-deleted" data-slug="{{ data.slug }}" <# if ( data.plugin ) { #>data-plugin="{{ data.plugin }}"<# } #>> 
  12. <td colspan="{{ data.colspan }}" class="plugin-update colspanchange"> 
  13. <# if ( data.plugin ) { #> 
  14. <?php 
  15. printf( 
  16. /** translators: %s: Plugin name */ 
  17. _x( '%s was successfully deleted.', 'plugin' ),  
  18. '<strong>{{{ data.name }}}</strong>' 
  19. ); 
  20. ?> 
  21. <# } else { #> 
  22. <?php 
  23. printf( 
  24. /** translators: %s: Theme name */ 
  25. _x( '%s was successfully deleted.', 'theme' ),  
  26. '<strong>{{{ data.name }}}</strong>' 
  27. ); 
  28. ?> 
  29. <# } #> 
  30. </td> 
  31. </tr> 
  32. </script> 
  33. <?php