Advertisement
arnabkumar

ActiveSMOF - Slightly Modded Options Framework

Jun 16th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.09 KB | None | 0 0
  1. <?php
  2.  
  3. /* link - http://aquagraphite.com/2011/09/slightly-modded-options-framework/
  4.  
  5.   Documentation - http://aquagraphite.com/2011/11/smof-documentation/
  6.  
  7.  Github - https://github.com/syamilmj/Options-Framework                          */
  8.  
  9.  
  10.   1. Download
  11.   2. Go to Options-Framework-master >  admin folder copy it
  12.  
  13.   3. Paste admin folder in your theme file
  14.  
  15.  
  16. /* ActiveSMOF - Slightly Modded Options Framework */
  17. 4.
  18.  
  19.  
  20. require_once ('admin/index.php');
  21.  
  22.  
  23. 5. /* edit option - */
  24.  
  25. Go to admin > functions folder > functions.options.php then edit it
  26.  
  27.  
  28. like this -
  29. $of_options[] = array( "name" => "Media Uploader",
  30.     "desc" => "Upload images using native media uploader.",
  31.     "id" => "media_upload",
  32.     "std" => "",
  33.     "type" => "media");
  34.  
  35.  
  36.  
  37. 1. name – This is the title that will be displayed on the options panel.
  38. 2. desc – Description for the option
  39. 3. id – A unique id for your option.
  40. 4. std – A standard value for the option.
  41. 5. type – The type of option
  42.  
  43. /* some option type - */
  44.  
  45. "info"
  46. "upload"
  47. "media"
  48. "sliderui"
  49. "spinner"
  50. "switch"
  51. "text"
  52. "slider"
  53. "typography"
  54. "tiles"
  55. "images"
  56. "textarea"
  57. "select"
  58. "tiles"
  59. "checkbox"
  60. "radio"
  61. "select_google_font"
  62. "checkbox"
  63.  
  64.  
  65.  
  66.  
  67. /* Slightly Modded Options Framework use or call */
  68. 6.
  69.  
  70. /* type one */
  71.  
  72. 1. single data - <?php global $data; //fetch options stored in $data
  73.               echo $data['your_option_id']; ?> //get $data['id'] then echo the value
  74.              
  75.              
  76. /* type two */ 
  77.  
  78. 2. Conditional Data -             <?php global $data; ?>
  79.                                  
  80.                                  <?php if($data['your_option_id']): ?>
  81.    
  82.                                  <?php echo $data['your_option_id']; ?>
  83.                                  
  84.                                   <?php endif; ?>
  85.                      
  86.                      
  87. /* type three */
  88.  
  89. 3.  conditional data with default data -
  90.  
  91.                             <?php global $data; ?>
  92.                            
  93.                             <?php if($data['your_option_id']): ?>
  94.                            
  95.                                <?php echo $data['your_option_id']; ?>
  96.                                
  97.                             <?php else: ?>
  98.                            
  99.                                My Default Data
  100.                                
  101.                             <?php endif; ?>
  102.  
  103.  
  104.  
  105. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement