Advertisement
Guest User

Untitled

a guest
May 25th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. /**
  2. * $tag The WordPress action you want to hook onto. This is required.
  3. * $function_to_add Your function to hook onto the WordPress action. This is required.
  4. * $priority Determines the importance of your function; 10 is the default. This is optional.
  5. * Higher number equal lower priority
  6. * Lower number equals higher priority
  7. * $accepted_args Sets how many arguments can be passed on to your function. This is optional.
  8. */
  9. <?php add_action( $tag, $function_to_add, $priority, $accepted_args ); ?>
  10.  
  11. /**
  12. * $option_group name of the settings group - can be anything you want. This is required.
  13. * $option_name name of the setting you want to save. This is required.
  14. * $sanitize_callback custom function that sanitizes the data. It is optional, but highly recommended.
  15. *>
  16. <?php register_setting( $option_group, $option_name, $sanitize_callback ); ?>
  17.  
  18. /**
  19. * Example settings registration
  20. */
  21. function wp_jplayer_register_settings() {
  22.  
  23. register_setting('wp_jplayer_songs', 'wp_jplayer_songs', 'wp_jplayer_songs_validate');
  24. register_setting('wp_jplayer_options', 'wp_jplayer_options');
  25.  
  26. }
  27. add_action('admin_init', 'wp_jplayer_register_settings');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement