bpahp_settings_page

The BP Profile as Homepage bpahp settings page function.

Description

bpahp_settings_page(); 

Usage

  1. if ( !function_exists( 'bpahp_settings_page' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-profile-as-homepage/bp_profile_as_homepage.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bpahp_settings_page(); 
  7.  

Defined (1)

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

/bp_profile_as_homepage.php  
  1. function bpahp_settings_page() 
  2. if (!current_user_can('manage_options')) 
  3. wp_die( __('You do not have sufficient permissions to access this page.') ); 
  4. $opt_name = 'bpahp_role_choice'; 
  5. $hidden_field_name = 'bpahp_submit_hidden'; 
  6. $data_field_name = 'bpahp_role_choice'; 
  7.  
  8. $opt_val = get_option($opt_name); 
  9.  
  10. if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) 
  11. $opt_val = $_POST[ $data_field_name ]; 
  12. update_option( $opt_name, $opt_val ); 
  13. ?> 
  14. <div class="updated"><p><strong><?php _e('settings saved.', 'bpahp-menu' ); ?></strong></p></div> 
  15. <?php 
  16.  
  17. echo '<div class="wrap">'; 
  18. echo "<h2>" . __( 'BP Profile as Homepage Settings', 'bpahp-menu' ) . "</h2>"; 
  19. ?> 
  20. <p>Using following option, you can disable the redirection for a particular user role.</p> 
  21. <form name="bpahp-settings-form" method="post" action=""> 
  22. <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y"> 
  23. <p><b>You have selected:</b>  
  24. <?php  
  25. if ($opt_val=='') 
  26. echo 'No One'; 
  27. else 
  28. echo $opt_val;  
  29. ?> <hr /> 
  30. <?php _e("Who can view Homepage:", 'bpahp-menu' ); ?>  
  31. <select name="<?php echo $data_field_name; ?>"> 
  32. <option value="">None</option> 
  33. <option value="administrator">Administrators</option> 
  34. <option value="editor">Editors</option> 
  35. <option value="author">Authors</option> 
  36. <option value="contributor">Contributors</option> 
  37. <option value="subscriber">Subscribers</option> 
  38. </select> 
  39. </p> 
  40. <p class="submit"> 
  41. <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" /> 
  42. </p> 
  43. </form> 
  44. <hr /> 
  45. <b> If you like my work, kindly support me to keep my blog working by donating a small amount. For helping me and donation, <a href="http://www.appinstore.com/p/donate.html">click here</a></b> 
  46. <p><h2><u>My other plugins:</u></h2></p> 
  47. <ul> 
  48. <li>BP Login Redirect - Decide where to send your users after login</li> 
  49. <li>Force Post Category Selection - No More Uncategoriezed Posts, No More forgetting category selections</li> 
  50. <li>Force Post Title - No More Untitled Posts</li> 
  51. <li>AutoSet Featured Images for Posts - No need to set featured images manually.It will do it for you automatically.</li> 
  52. <li>Wordpress QRCODE Widget - Share your website with Style. It will generate dynamic QR Codes for whole website.</li> 
  53. <li>Wordpress Version Remover - Save your wordpress website from hackers. It will remove the wordpress version.</li> 
  54. <li>Schedule your Posts - Do not schedule posts now. Just schedule the content of the Post.One Post can show different content daily.</li> 
  55. <li><a href="http://www.jpsays.com/search/label/wordpress" alt="www.jpsays.com">Click here to see my plugins.</a></li> 
  56. </ul> 
  57. </div> 
  58. <?php