jetpack_lytro_shortcode_attributes

Lytro.com Short Code Attributes Definition.

Description

jetpack_lytro_shortcode_attributes(); 

This helper function returns an array all available shortcode attributes, their validation method, default value and more.

Keys: validate: a callable function or regular expression used to validate the input default: default value for shortcode attribute query_arg: the related lytro query argument name


Usage

  1. if ( !function_exists( 'jetpack_lytro_shortcode_attributes' ) ) { 
  2. require_once '/modules/shortcodes/lytro.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_lytro_shortcode_attributes(); 
  7.  

Defined (1)

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

/modules/shortcodes/lytro.php  
  1. function jetpack_lytro_shortcode_attributes() { 
  2. return array( 
  3. 'username' => array( 
  4. 'default' => '',  
  5. ),  
  6. 'photo' => array( // could be ID or URL, validated separately 
  7. 'default' => 0,  
  8. ),  
  9. 'width' => array( 
  10. 'validate' => '#^\d+$#',  
  11. 'default' => 400,  
  12. ),  
  13. 'height' => array( 
  14. 'validate' => '#^\d+$#',  
  15. 'default' => 415,  
  16. ),  
  17. 'show_arrow' => array( 
  18. 'query_arg' => 'showArrow',  
  19. 'validate' => '#^(true|false)$#',  
  20. 'default' => 'true',  
  21. ),  
  22. 'show_border' => array( 
  23. 'query_arg' => 'showBorder',  
  24. 'validate' => '#^(true|false)$#',  
  25. 'default' => 'true',  
  26. ),  
  27. 'show_first_time_user' => array( 
  28. 'query_arg' => 'showFTU',  
  29. 'validate' => '#^(true|false)$#',  
  30. 'default' => 'true',  
  31. ),  
  32. 'allow_full_view' => array( 
  33. 'query_arg' => 'allowFullView',  
  34. 'validate' => '#^(true|false)$#',  
  35. 'default' => 'true',  
  36. ),  
  37. 'enable_help' => array( 
  38. 'query_arg' => 'enableHelp',  
  39. 'validate' => '#^(true|false)$#',  
  40. 'default' => 'true',  
  41. ),  
  42. 'enable_attribution' => array( 
  43. 'query_arg' => 'enableAttribution',  
  44. 'validate' => '#^(true|false)$#',  
  45. 'default' => 'true',  
  46. ),  
  47. 'enable_logo' => array( 
  48. 'query_arg' => 'enableLogo',  
  49. 'validate' => '#^(true|false)$#',  
  50. 'default' => 'true',  
  51. ),  
  52. 'enable_fullscreen' => array( 
  53. 'query_arg' => 'enableFullscreen',  
  54. 'validate' => '#^(true|false)$#',  
  55. 'default' => 'true',  
  56. ),  
  57. 'enable_play' => array( 
  58. 'query_arg' => 'enablePlay',  
  59. 'validate' => '#^(true|false)$#',  
  60. 'default' => 'true',  
  61. ),  
  62. 'bg_color' => array( 
  63. 'query_arg' => 'bgColor',  
  64. 'validate' => '/^#(?:[0-9a-fA-F]{3}) {1, 2}$/',  
  65. 'default' => '',  
  66. ),  
  67. );