Advertisement
sayful

WP SMOF Option Framework Usages

Feb 22nd, 2014
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. /*========================================================================================
  2. 01. name – This is the title that will be displayed on the options panel.
  3. 02. desc – Description for the option
  4. 03. id – A unique id for your option.
  5. 04. std – A standard value for the option.
  6. 05. type – The type of option
  7. =========================================================================================*/
  8. <?php
  9. $of_options[] = array(
  10.     "name" => "Media Uploader",
  11.     "desc" => "Upload images using native media uploader.",
  12.     "id" => "your_option_id",
  13.     "std" => "",
  14.     "type" => "media"
  15. );
  16. ?>
  17.  
  18. //Using Data
  19. <?php global $data; echo $data['your_option_id']; ?>
  20.  
  21. //Using Conditional Data:
  22.  
  23. <?php global $data; ?>
  24. <?php if($data['your_option_id']): ?>
  25.     <?php echo $data['your_option_id']; ?>
  26. <?php endif; ?>
  27.  
  28. //Using conditional Data with Default Data
  29. <?php global $data; ?>
  30. <?php if($data['your_option_id']): ?>
  31.     <?php echo $data['your_option_id']; ?>
  32. <?php else: ?>
  33.     My Default Data
  34. <?php endif; ?> ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement