responsive_II_gallery_atts

Use shortcode_atts_gallery filter to add new defaults to the WordPress gallery shortcode.

Description

responsive_II_gallery_atts( $out, $pairs, $atts ); 

Allows user input in the post gallery shortcode.

Parameters (3)

0. $out
The out.
1. $pairs
The pairs.
2. $atts
The atts.

Usage

  1. if ( !function_exists( 'responsive_II_gallery_atts' ) ) { 
  2. require_once '/includes/functions-extentions.php'; 
  3.  
  4. // The out. 
  5. $out = null; 
  6.  
  7. // The pairs. 
  8. $pairs = null; 
  9.  
  10. // The atts. 
  11. $atts = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = responsive_II_gallery_atts($out, $pairs, $atts); 
  15.  

Defined (1)

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

/includes/functions-extentions.php  
  1. function responsive_II_gallery_atts( $out, $pairs, $atts ) { 
  2.  
  3. $full_width = is_page_template( 'full-width-page.php' ) || is_page_template( 'landing-page.php' ); 
  4.  
  5. // Check if the size attribute has been set, if so use it and skip the responsive sizes 
  6. if ( array_key_exists( 'size', $atts ) ) { 
  7. $size = $atts['size']; 
  8. } else { 
  9.  
  10. if ( $full_width ) { 
  11. switch ( $out['columns'] ) { 
  12. case 1: 
  13. $size = 'responsive-900'; //900 
  14. break; 
  15. case 2: 
  16. $size = 'responsive-450'; //450 
  17. break; 
  18. case 3: 
  19. $size = 'responsive-300'; //300 
  20. break; 
  21. case 4: 
  22. $size = 'responsive-200'; //225 
  23. break; 
  24. case 5: 
  25. $size = 'responsive-200'; //180 
  26. break; 
  27. case 6: 
  28. $size = 'responsive-150'; //150 
  29. break; 
  30. case 7: 
  31. $size = 'responsive-150'; //125 
  32. break; 
  33. case 8: 
  34. $size = 'responsive-150'; //112 
  35. break; 
  36. case 9: 
  37. $size = 'responsive-100'; //100 
  38. break; 
  39. } else { 
  40. switch ( $out['columns'] ) { 
  41. case 1: 
  42. $size = 'responsive-600'; //600 
  43. break; 
  44. case 2: 
  45. $size = 'responsive-300'; //300 
  46. break; 
  47. case 3: 
  48. $size = 'responsive-200'; //200 
  49. break; 
  50. case 4: 
  51. $size = 'responsive-150'; //150 
  52. break; 
  53. case 5: 
  54. $size = 'responsive-150'; //120 
  55. break; 
  56. case 6: 
  57. $size = 'responsive-100'; //100 
  58. break; 
  59. case 7: 
  60. $size = 'responsive-100'; //85 
  61. break; 
  62. case 8: 
  63. $size = 'responsive-100'; //75 
  64. break; 
  65. case 9: 
  66. $size = 'responsive-100'; //66 
  67. break; 
  68.  
  69.  
  70. $atts = shortcode_atts( 
  71. array( 
  72. 'size' => $size,  
  73. ),  
  74. $atts 
  75. ); 
  76.  
  77. $out['size'] = $atts['size']; 
  78.  
  79. return $out; 
  80.