jetpack_mobile_theme_setup

The Jetpack by WordPress.com jetpack mobile theme setup function.

Description

jetpack_mobile_theme_setup(); 

Usage

  1. if ( !function_exists( 'jetpack_mobile_theme_setup' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/minileven/minileven.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_mobile_theme_setup(); 
  7.  

Defined (1)

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

/modules/minileven/minileven.php  
  1. function jetpack_mobile_theme_setup() { 
  2. if ( jetpack_check_mobile() ) { 
  3. // Redirect to download page if user clicked mobile app promo link in mobile footer 
  4. if ( isset( $_GET['app-download'] ) ) { 
  5. /** 
  6. * Fires before you're redirected to download page if you clicked the mobile app promo link in mobile footer 
  7. * @module minileven 
  8. * @since 1.8.0 
  9. * @param string $_GET['app-download'] app-download URL parameter. 
  10. */ 
  11. do_action( 'mobile_app_promo_download', $_GET['app-download'] ); 
  12.  
  13. switch ( $_GET['app-download'] ) { 
  14. case 'android': 
  15. header( 'Location: market://search?q=pname:org.wordpress.android' ); 
  16. exit; 
  17. break; 
  18. case 'ios': 
  19. header( 'Location: http://itunes.apple.com/us/app/wordpress/id335703880?mt=8' ); 
  20. exit; 
  21. break; 
  22. case 'blackberry': 
  23. header( 'Location: http://blackberry.wordpress.org/download/' ); 
  24. exit; 
  25. break; 
  26.  
  27.  
  28. if ( class_exists( 'Jetpack_Custom_CSS' ) && method_exists( 'Jetpack_Custom_CSS', 'disable' ) && ! get_option( 'wp_mobile_custom_css' ) ) 
  29. add_action( 'init', array( 'Jetpack_Custom_CSS', 'disable' ), 11 ); 
  30.  
  31. /** 
  32. * Fires after Jetpack's mobile theme has been setup. 
  33. * @module minileven 
  34. * @since 1.8.0 
  35. */ 
  36. do_action( 'mobile_setup' );