jetpack_extras_sharing_admin_update

Admin Save Functions.

Description

jetpack_extras_sharing_admin_update(); 

Usage

  1. if ( !function_exists( 'jetpack_extras_sharing_admin_update' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-tweaks-for-jetpack-by-barrycarlyon/modules/sharedaddy/admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_extras_sharing_admin_update(); 
  7.  

Defined (1)

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

/modules/sharedaddy/admin.php  
  1. function jetpack_extras_sharing_admin_update() { 
  2. $options = get_option( 'jetpack_extras-options', array() ); 
  3.  
  4. $shows = array_values( get_post_types( array( 'public' => true ) ) ); 
  5. array_unshift( $shows, 'index' ); 
  6.  
  7. // Placement optoons 
  8. $options['placement'] = array(); 
  9. foreach ( $shows as $show ) { 
  10. if ( isset( $_POST['jetpack_extras_placement'][$show] ) && in_array( $_POST['jetpack_extras_placement'][$show], array( 'below', 'above', 'both' ) ) ) 
  11. $options['placement'][$show] = $_POST['jetpack_extras_placement'][$show]; 
  12. else 
  13. $options['placement'][$show] = 'below'; 
  14. // twitter 
  15.  
  16. $related = array(); 
  17. foreach ($_POST['jetpack_extras_twitter_related'] as $index => $item) { 
  18. $related[$item] = $_POST['jetpack_extras_twitter_related_desc'][$index]; 
  19. $options['twitter_related'] = $related; 
  20.  
  21. $options['use_wpme'] = $_POST['jetpack_extras_use_wpme'] ? 1 : 0; 
  22. // $options['enable_dnt'] = $_POST['jetpack_extras_enable_dnt'] ? 1 : 0; 
  23.  
  24. update_option( 'jetpack_extras-options', $options ); 
  25.  
  26. return;