cptbc_settings_page

The CPT Bootstrap Carousel cptbc settings page class.

Defined (1)

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

/cptbc-settings.php  
  1. class cptbc_settings_page { 
  2. // Holds the values to be used in the fields callbacks 
  3. private $options; 
  4.  
  5. // Start up 
  6. public function __construct() { 
  7. add_action( 'admin_menu', array( $this, 'add_plugin_page' ) ); 
  8. add_action( 'admin_init', array( $this, 'page_init' ) ); 
  9.  
  10. // Add settings page 
  11. public function add_plugin_page() { 
  12. add_submenu_page('edit.php?post_type=cptbc', __('Settings', 'cpt-bootstrap-carousel'), __('Settings', 'cpt-bootstrap-carousel'), 'manage_options', 'cpt-bootstrap-carousel', array($this, 'create_admin_page')); 
  13.  
  14. // Options page callback 
  15. public function create_admin_page() { 
  16. // Set class property 
  17. $this->options = get_option( 'cptbc_settings' ); 
  18. if(!$this->options) { 
  19. cptbc_set_options (); 
  20. $this->options = get_option( 'cptbc_settings' ); 
  21. ?> 
  22. <div class="wrap"> 
  23. <h2>CPT Bootstrap Carousel <?php _e('Settings', 'cpt-bootstrap-carousel'); ?></h2> 
  24. <p><?php printf(__('You can set the default behaviour of your carousels here. Most of these settings can be overridden by using %s shortcode attributes %s.', 'cpt-bootstrap-carousel'), '<a href="http://wordpress.org/plugins/cpt-bootstrap-carousel/" target="_blank">', '</a>'); ?></p> 
  25.  
  26. <form method="post" action="options.php"> 
  27. <?php 
  28. settings_fields( 'cptbc_settings' );  
  29. do_settings_sections( 'cpt-bootstrap-carousel' ); 
  30. submit_button();  
  31. ?> 
  32. </form> 
  33. </div> 
  34. <?php 
  35.  
  36. // Register and add settings 
  37. public function page_init() {  
  38. register_setting( 
  39. 'cptbc_settings', // Option group 
  40. 'cptbc_settings', // Option name 
  41. array( $this, 'sanitize' ) // Sanitize 
  42. ); 
  43.  
  44. // Sections 
  45. add_settings_section( 
  46. 'cptbc_settings_behaviour', // ID 
  47. __('Carousel Behaviour', 'cpt-bootstrap-carousel'), // Title 
  48. array( $this, 'cptbc_settings_behaviour_header' ), // Callback 
  49. 'cpt-bootstrap-carousel' // Page 
  50. ); 
  51. add_settings_section( 
  52. 'cptbc_settings_setup', // ID 
  53. __('Carousel Setup', 'cpt-bootstrap-carousel'), // Title 
  54. array( $this, 'cptbc_settings_setup' ), // Callback 
  55. 'cpt-bootstrap-carousel' // Page 
  56. ); 
  57. add_settings_section( 
  58. 'cptbc_settings_link_buttons', // ID 
  59. __('Link Buttons', 'cpt-bootstrap-carousel'), // Title 
  60. array( $this, 'cptbc_settings_link_buttons_header' ), // Callback 
  61. 'cpt-bootstrap-carousel' // Page 
  62. ); 
  63. add_settings_section( 
  64. 'cptbc_settings_markup', // ID 
  65. __('Custom Markup', 'cpt-bootstrap-carousel'), // Title 
  66. array( $this, 'cptbc_settings_markup_header' ), // Callback 
  67. 'cpt-bootstrap-carousel' // Page 
  68. ); 
  69.  
  70. // Behaviour Fields 
  71. add_settings_field( 
  72. 'interval', // ID 
  73. __('Slide Interval (milliseconds)', 'cpt-bootstrap-carousel'), // Title 
  74. array( $this, 'interval_callback' ), // Callback 
  75. 'cpt-bootstrap-carousel', // Page 
  76. 'cptbc_settings_behaviour' // Section 
  77. ); 
  78. add_settings_field( 
  79. 'showcaption', // ID 
  80. __('Show Slide Titles / Captions?', 'cpt-bootstrap-carousel'), // Title  
  81. array( $this, 'showcaption_callback' ), // Callback 
  82. 'cpt-bootstrap-carousel', // Page 
  83. 'cptbc_settings_behaviour' // Section  
  84. ); 
  85. add_settings_field( 
  86. 'showcontrols', // ID 
  87. __('Show Slide Controls?', 'cpt-bootstrap-carousel'), // Title  
  88. array( $this, 'showcontrols_callback' ), // Callback 
  89. 'cpt-bootstrap-carousel', // Page 
  90. 'cptbc_settings_behaviour' // Section  
  91. ); 
  92. add_settings_field( 
  93. 'orderby', // ID 
  94. __('Order Slides By', 'cpt-bootstrap-carousel'), // Title  
  95. array( $this, 'orderby_callback' ), // Callback 
  96. 'cpt-bootstrap-carousel', // Page 
  97. 'cptbc_settings_behaviour' // Section  
  98. ); 
  99. add_settings_field( 
  100. 'order', // ID 
  101. __('Ordering Direction', 'cpt-bootstrap-carousel'), // Title  
  102. array( $this, 'order_callback' ), // Callback 
  103. 'cpt-bootstrap-carousel', // Page 
  104. 'cptbc_settings_behaviour' // Section  
  105. ); 
  106. add_settings_field( 
  107. 'category', // ID 
  108. __('Restrict to Category', 'cpt-bootstrap-carousel'), // Title  
  109. array( $this, 'category_callback' ), // Callback 
  110. 'cpt-bootstrap-carousel', // Page 
  111. 'cptbc_settings_behaviour' // Section  
  112. ); 
  113.  
  114. // Carousel Setup Section 
  115. add_settings_field( 
  116. 'twbs', // ID 
  117. __('Twitter Bootstrap Version', 'cpt-bootstrap-carousel'), // Title  
  118. array( $this, 'twbs_callback' ), // Callback 
  119. 'cpt-bootstrap-carousel', // Page 
  120. 'cptbc_settings_setup' // Section  
  121. ); 
  122. add_settings_field( 
  123. 'image_size', // ID 
  124. __('Image Size', 'cpt-bootstrap-carousel'), // Title  
  125. array( $this, 'image_size_callback' ), // Callback 
  126. 'cpt-bootstrap-carousel', // Page 
  127. 'cptbc_settings_setup' // Section  
  128. ); 
  129.  
  130. add_settings_field( 
  131. 'use_background_images', // ID 
  132. __('Use background images?', 'cpt-bootstrap-carousel'), // Title  
  133. array( $this, 'use_background_images_callback' ), // Callback 
  134. 'cpt-bootstrap-carousel', // Page 
  135. 'cptbc_settings_setup' // Section  
  136. ); 
  137. add_settings_field( 
  138. 'background_images_height', // ID 
  139. __('Height if using bkgrnd images (px)', 'cpt-bootstrap-carousel'), // Title 
  140. array( $this, 'background_images_height_callback' ), // Callback 
  141. 'cpt-bootstrap-carousel', // Page 
  142. 'cptbc_settings_setup' // Section 
  143. ); 
  144. add_settings_field( 
  145. 'background_images_style_size', // ID 
  146. __('Background images size style', 'cpt-bootstrap-carousel'), // Title 
  147. array( $this, 'background_images_style_size_callback' ), // Callback 
  148. 'cpt-bootstrap-carousel', // Page 
  149. 'cptbc_settings_setup' // Section 
  150. ); 
  151. add_settings_field( 
  152. 'use_javascript_animation', // ID 
  153. __('Use Javascript to animate carousel?', 'cpt-bootstrap-carousel'), // Title  
  154. array( $this, 'use_javascript_animation_callback' ), // Callback 
  155. 'cpt-bootstrap-carousel', // Page 
  156. 'cptbc_settings_setup' // Section  
  157. ); 
  158.  
  159. // Link buttons 
  160. add_settings_field( 
  161. 'link_button', // ID 
  162. __('Show links as button in caption', 'cpt-bootstrap-carousel'), // Title 
  163. array( $this, 'link_button_callback' ), // Callback 
  164. 'cpt-bootstrap-carousel', // Page 
  165. 'cptbc_settings_link_buttons' // Section 
  166. ); 
  167. add_settings_field( 
  168. 'link_button_text', // ID 
  169. __('Default text for link buttons', 'cpt-bootstrap-carousel'), // Title 
  170. array( $this, 'link_button_text_callback' ), // Callback 
  171. 'cpt-bootstrap-carousel', // Page 
  172. 'cptbc_settings_link_buttons' // Section 
  173. ); 
  174. add_settings_field( 
  175. 'link_button_class', // ID 
  176. __('Class for link buttons', 'cpt-bootstrap-carousel'), // Title 
  177. array( $this, 'link_button_class_callback' ), // Callback 
  178. 'cpt-bootstrap-carousel', // Page 
  179. 'cptbc_settings_link_buttons' // Section 
  180. ); 
  181. add_settings_field( 
  182. 'link_button_before', // ID 
  183. __('HTML before link buttons', 'cpt-bootstrap-carousel'), // Title 
  184. array( $this, 'link_button_before_callback' ), // Callback 
  185. 'cpt-bootstrap-carousel', // Page 
  186. 'cptbc_settings_link_buttons' // Section 
  187. ); 
  188. add_settings_field( 
  189. 'link_button_after', // ID 
  190. __('HTML after link buttons', 'cpt-bootstrap-carousel'), // Title 
  191. array( $this, 'link_button_after_callback' ), // Callback 
  192. 'cpt-bootstrap-carousel', // Page 
  193. 'cptbc_settings_link_buttons' // Section 
  194. ); 
  195.  
  196. // Markup Section 
  197. add_settings_field( 
  198. 'customprev', // ID 
  199. __('Custom prev button class', 'cpt-bootstrap-carousel'), // Title 
  200. array( $this, 'customprev_callback' ), // Callback 
  201. 'cpt-bootstrap-carousel', // Page 
  202. 'cptbc_settings_markup' // Section 
  203. ); 
  204. add_settings_field( 
  205. 'customnext', // ID 
  206. __('Custom next button class', 'cpt-bootstrap-carousel'), // Title 
  207. array( $this, 'customnext_callback' ), // Callback 
  208. 'cpt-bootstrap-carousel', // Page 
  209. 'cptbc_settings_markup' // Section 
  210. ); 
  211. add_settings_field( 
  212. 'before_title', // ID 
  213. __('HTML before title', 'cpt-bootstrap-carousel'), // Title 
  214. array( $this, 'before_title_callback' ), // Callback 
  215. 'cpt-bootstrap-carousel', // Page 
  216. 'cptbc_settings_markup' // Section 
  217. ); 
  218. add_settings_field( 
  219. 'after_title', // ID 
  220. __('HTML after title', 'cpt-bootstrap-carousel'), // Title 
  221. array( $this, 'after_title_callback' ), // Callback 
  222. 'cpt-bootstrap-carousel', // Page 
  223. 'cptbc_settings_markup' // Section 
  224. ); 
  225. add_settings_field( 
  226. 'before_caption', // ID 
  227. __('HTML before caption text', 'cpt-bootstrap-carousel'), // Title 
  228. array( $this, 'before_caption_callback' ), // Callback 
  229. 'cpt-bootstrap-carousel', // Page 
  230. 'cptbc_settings_markup' // Section 
  231. ); 
  232. add_settings_field( 
  233. 'after_caption', // ID 
  234. __('HTML after caption text', 'cpt-bootstrap-carousel'), // Title 
  235. array( $this, 'after_caption_callback' ), // Callback 
  236. 'cpt-bootstrap-carousel', // Page 
  237. 'cptbc_settings_markup' // Section 
  238. ); 
  239.  
  240.  
  241. // Sanitize each setting field as needed - @param array $input Contains all settings fields as array keys 
  242. public function sanitize( $input ) { 
  243. $new_input = array(); 
  244. foreach($input as $key => $var) { 
  245. if($key == 'twbs' || $key == 'interval' || $key == 'background_images_height') { 
  246. $new_input[$key] = absint( $input[$key] ); 
  247. } else if ($key == 'link_button_before' || $key == 'link_button_after' || $key == 'before_title' || $key == 'after_title' || $key == 'before_caption' || $key == 'after_caption') { 
  248. $new_input[$key] = $input[$key]; // Don't sanitise these, meant to be html! 
  249. } else {  
  250. $new_input[$key] = sanitize_text_field( $input[$key] ); 
  251. return $new_input; 
  252.  
  253. // Print the Section text 
  254. public function cptbc_settings_behaviour_header() { 
  255. echo '<p>'.__('Basic setup of how each Carousel will function, what controls will show and which images will be displayed.', 'cpt-bootstrap-carousel').'</p>'; 
  256. public function cptbc_settings_setup() { 
  257. echo '<p>'.__('Change the setup of the carousel - how it functions.', 'cpt-bootstrap-carousel').'</p>'; 
  258. public function cptbc_settings_link_buttons_header() { 
  259. echo '<p>'.__('Options for using a link button instead of linking the image directly.', 'cpt-bootstrap-carousel').'</p>'; 
  260. public function cptbc_settings_markup_header() { 
  261. echo '<p>'.__('Customise which CSS classes and HTML tags the Carousel uses.', 'cpt-bootstrap-carousel').'</p>'; 
  262.  
  263. // Callback functions - print the form inputs 
  264. // Carousel behaviour  
  265. public function interval_callback() { 
  266. printf('<input type="text" id="interval" name="cptbc_settings[interval]" value="%s" size="15" />',  
  267. isset( $this->options['interval'] ) ? esc_attr( $this->options['interval']) : ''); 
  268. echo '<p class="description">'.__('How long each image shows for before it slides. Set to 0 to disable animation.', 'cpt-bootstrap-carousel').'</p>'; 
  269. public function showcaption_callback() { 
  270. if(isset( $this->options['showcaption'] ) && $this->options['showcaption'] == 'false') { 
  271. $cptbc_showcaption_t = ''; 
  272. $cptbc_showcaption_f = ' selected="selected"'; 
  273. } else { 
  274. $cptbc_showcaption_t = ' selected="selected"'; 
  275. $cptbc_showcaption_f = ''; 
  276. print '<select id="showcaption" name="cptbc_settings[showcaption]"> 
  277. <option value="true"'.$cptbc_showcaption_t.'>'.__('Show', 'cpt-bootstrap-carousel').'</option> 
  278. <option value="false"'.$cptbc_showcaption_f.'>'.__('Hide', 'cpt-bootstrap-carousel').'</option> 
  279. </select>'; 
  280. public function showcontrols_callback() { 
  281. if(isset( $this->options['showcontrols'] ) && $this->options['showcontrols'] == 'false') { 
  282. $cptbc_showcontrols_t = ''; 
  283. $cptbc_showcontrols_f = ' selected="selected"'; 
  284. $cptbc_showcontrols_c = ''; 
  285. } else if(isset( $this->options['showcontrols'] ) && $this->options['showcontrols'] == 'true') { 
  286. $cptbc_showcontrols_t = ' selected="selected"'; 
  287. $cptbc_showcontrols_f = ''; 
  288. $cptbc_showcontrols_c = ''; 
  289. } else if(isset( $this->options['showcontrols'] ) && $this->options['showcontrols'] == 'custom') { 
  290. $cptbc_showcontrols_t = ''; 
  291. $cptbc_showcontrols_f = ''; 
  292. $cptbc_showcontrols_c = ' selected="selected"'; 
  293. print '<select id="showcontrols" name="cptbc_settings[showcontrols]"> 
  294. <option value="true"'.$cptbc_showcontrols_t.'>'.__('Show', 'cpt-bootstrap-carousel').'</option> 
  295. <option value="false"'.$cptbc_showcontrols_f.'>'.__('Hide', 'cpt-bootstrap-carousel').'</option> 
  296. <option value="custom"'.$cptbc_showcontrols_c.'>'.__('Custom', 'cpt-bootstrap-carousel').'</option> 
  297. </select>'; 
  298. public function orderby_callback() { 
  299. $orderby_options = array ( 
  300. 'menu_order' => __('Menu order, as set in Carousel overview page', 'cpt-bootstrap-carousel'),  
  301. 'date' => __('Date slide was published', 'cpt-bootstrap-carousel'),  
  302. 'rand' => __('Random ordering', 'cpt-bootstrap-carousel'),  
  303. 'title' => __('Slide title', 'cpt-bootstrap-carousel')  
  304. ); 
  305. print '<select id="orderby" name="cptbc_settings[orderby]">'; 
  306. foreach($orderby_options as $val => $option) { 
  307. print '<option value="'.$val.'"'; 
  308. if(isset( $this->options['orderby'] ) && $this->options['orderby'] == $val) { 
  309. print ' selected="selected"'; 
  310. print ">$option</option>"; 
  311. print '</select>'; 
  312. public function order_callback() { 
  313. if(isset( $this->options['order'] ) && $this->options['order'] == 'DESC') { 
  314. $cptbc_showcontrols_a = ''; 
  315. $cptbc_showcontrols_d = ' selected="selected"'; 
  316. } else { 
  317. $cptbc_showcontrols_a = ' selected="selected"'; 
  318. $cptbc_showcontrols_d = ''; 
  319. print '<select id="order" name="cptbc_settings[order]"> 
  320. <option value="ASC"'.$cptbc_showcontrols_a.'>'.__('Ascending', 'cpt-bootstrap-carousel').'</option> 
  321. <option value="DESC"'.$cptbc_showcontrols_d.'>'.__('Decending', 'cpt-bootstrap-carousel').'</option> 
  322. </select>'; 
  323. public function category_callback() { 
  324. $cats = get_terms('carousel_category'); 
  325. print '<select id="orderby" name="cptbc_settings[category]"> 
  326. <option value="">'.__('All Categories', 'cpt-bootstrap-carousel').'</option>'; 
  327. foreach($cats as $cat) { 
  328. print '<option value="'.$cat->name.'"'; 
  329. if(isset( $this->options['category'] ) && $this->options['category'] == $cat->name) { 
  330. print ' selected="selected"'; 
  331. print ">".$cat->name."</option>"; 
  332. print '</select>'; 
  333.  
  334. // Setup Section 
  335. public function twbs_callback() { 
  336. if(isset( $this->options['twbs'] ) && $this->options['twbs'] == '3') { 
  337. $cptbc_twbs3 = ' selected="selected"'; 
  338. $cptbc_twbs2 = ''; 
  339. } else { 
  340. $cptbc_twbs3 = ''; 
  341. $cptbc_twbs2 = ' selected="selected"'; 
  342. print '<select id="twbs" name="cptbc_settings[twbs]"> 
  343. <option value="2"'.$cptbc_twbs2.'>2.x</option> 
  344. <option value="3"'.$cptbc_twbs3.'>3.x (Default)</option> 
  345. </select>'; 
  346. echo '<p class="description">'.__("Set according to which version of Bootstrap you're using.", 'cpt-bootstrap-carousel').'</p>'; 
  347. public function image_size_callback() { 
  348. $image_sizes = get_intermediate_image_sizes(); 
  349. print '<select id="image_size" name="cptbc_settings[image_size]"> 
  350. <option value="full"'; 
  351. if(isset( $this->options['image_size'] ) && $this->options['image_size'] == 'full') { 
  352. print ' selected="selected"'; 
  353. echo '>Full (default)</option>'; 
  354. foreach($image_sizes as $size) { 
  355. print '<option value="'.$size.'"'; 
  356. if(isset( $this->options['image_size'] ) && $this->options['image_size'] == $size) { 
  357. print ' selected="selected"'; 
  358. print ">".ucfirst($size)."</option>"; 
  359. print '</select>'; 
  360. echo '<p class="description">'.__("If your carousels are small, you can a smaller image size to increase page load times.", 'cpt-bootstrap-carousel').'</p>'; 
  361. public function use_background_images_callback() { 
  362. print '<select id="use_background_images" name="cptbc_settings[use_background_images]">'; 
  363. print '<option value="0"'; 
  364. if(isset( $this->options['use_background_images'] ) && $this->options['use_background_images'] == 0) { 
  365. print ' selected="selected"'; 
  366. echo '>No (default)</option>'; 
  367. print '<option value="1"'; 
  368. if(isset( $this->options['use_background_images'] ) && $this->options['use_background_images'] == 1) { 
  369. print ' selected="selected"'; 
  370. echo '>Yes</option>'; 
  371. print '</select>'; 
  372. echo '<p class="description">'.__("Experimental feature - Use CSS background images so that pictures auto-fill the space available.", 'cpt-bootstrap-carousel').'</p>'; 
  373. public function background_images_height_callback() { 
  374. printf('<input type="text" id="background_images_height" name="cptbc_settings[background_images_height]" value="%s" size="15" />',  
  375. isset( $this->options['background_images_height'] ) ? esc_attr( $this->options['background_images_height']) : '500px'); 
  376. echo '<p class="description">'.__("If using background images above, how tall do you want the carousel to be?", 'cpt-bootstrap-carousel').'</p>'; 
  377.  
  378. public function use_javascript_animation_callback() { 
  379. print '<select id="use_javascript_animation" name="cptbc_settings[use_javascript_animation]">'; 
  380. print '<option value="1"'; 
  381. if(isset( $this->options['use_javascript_animation'] ) && $this->options['use_javascript_animation'] == 1) { 
  382. print ' selected="selected"'; 
  383. echo '>Yes (default)</option>'; 
  384. print '<option value="0"'; 
  385. if(isset( $this->options['use_javascript_animation'] ) && $this->options['use_javascript_animation'] == 0) { 
  386. print ' selected="selected"'; 
  387. echo '>No</option>'; 
  388. print '</select>'; 
  389. echo '<p class="description">'.__("The Bootstrap Carousel is designed to work usign data-attributes. Sometimes the animation doesn't work correctly with this, so the default is to include a small portion of Javascript to fire the carousel. You can choose not to include this here.", 'cpt-bootstrap-carousel').'</p>'; 
  390. public function background_images_style_size_callback() { 
  391. print '<select id="select_background_images_style_size" name="cptbc_settings[select_background_images_style_size]">'; 
  392. print '<option value="cover"'; 
  393. if(isset( $this->options['select_background_images_style_size'] ) && $this->options['select_background_images_style_size'] === 'cover') { 
  394. print ' selected="selected"'; 
  395. echo '>Cover (default)</option>'; 
  396. print '<option value="contain"'; 
  397. if(isset( $this->options['select_background_images_style_size'] ) && $this->options['select_background_images_style_size'] === 'contain') { 
  398. print ' selected="selected"'; 
  399. echo '>Contain</option>'; 
  400. print '<option value="auto"'; 
  401. if(isset( $this->options['select_background_images_style_size'] ) && $this->options['select_background_images_style_size'] === 'auto') { 
  402. print ' selected="selected"'; 
  403. echo '>Auto</option>'; 
  404. print '</select>'; 
  405. echo '<p class="description">'.__('If you find that your images are not scaling correctly when using background images try switching the style to \'contain\' or \'auto\'', 'cpt-bootstrap-carousel').'</p>'; 
  406.  
  407. // Link buttons section 
  408. public function link_button_callback() { 
  409. print '<select id="link_button" name="cptbc_settings[link_button]">'; 
  410. print '<option value="1"'; 
  411. if(isset( $this->options['link_button'] ) && $this->options['link_button'] == 1) { 
  412. print ' selected="selected"'; 
  413. echo '>Yes</option>'; 
  414. print '<option value="0"'; 
  415. if(!isset( $this->options['link_button'] ) || $this->options['link_button'] == 0) { 
  416. print ' selected="selected"'; 
  417. echo '>No (Default)</option>'; 
  418. print '</select>'; 
  419. echo '<p class="description">'.__("If a URL is set for a carousel image, this option will create a button in the caption instead of linking the image itself.", 'cpt-bootstrap-carousel').'</p>'; 
  420. public function link_button_text_callback() { 
  421. printf('<input type="text" id="link_button_text" name="cptbc_settings[link_button_text]" value="%s" size="20" />',  
  422. isset( $this->options['link_button_text'] ) ? esc_attr( $this->options['link_button_text']) : 'Read more'); 
  423. public function link_button_class_callback() { 
  424. printf('<input type="text" id="link_button_class" name="cptbc_settings[link_button_class]" value="%s" size="20" />',  
  425. isset( $this->options['link_button_class'] ) ? esc_attr( $this->options['link_button_class']) : 'btn btn-default pull-right'); 
  426. echo '<p class="description">'.__("Bootstrap style buttons must have the class <code>btn</code> and then one of the following: <code>btn-default</code>, <code>btn-primary</code>, <code>btn-success</code>, <code>btn-warning</code>, <code>btn-danger</code> or <code>btn-info</code>. No <code>.</code> prefixes. <code>pull-right</code> to float the button on the right. See the ", 'cpt-bootstrap-carousel').' <a href="http://getbootstrap.com/css/#buttons-options" target="_blank">Bootstrap documentation</a>.</p>'; 
  427. public function link_button_before_callback() { 
  428. printf('<input type="text" id="link_button_before" name="cptbc_settings[link_button_before]" value="%s" size="20" />',  
  429. isset( $this->options['link_button_before'] ) ? esc_attr( $this->options['link_button_before']) : ''); 
  430. public function link_button_after_callback() { 
  431. printf('<input type="text" id="link_button_after" name="cptbc_settings[link_button_after]" value="%s" size="20" />',  
  432. isset( $this->options['link_button_after'] ) ? esc_attr( $this->options['link_button_after']) : ''); 
  433.  
  434. // Markup section 
  435. public function before_title_callback() { 
  436. printf('<input type="text" id="before_title" name="cptbc_settings[before_title]" value="%s" size="15" />',  
  437. isset( $this->options['before_title'] ) ? esc_attr( $this->options['before_title']) : '<h4>'); 
  438. public function customnext_callback() { 
  439. printf('<input type="text" id="customnext" name="cptbc_settings[customnext]" value="%s" size="15" />',  
  440. isset( $this->options['customnext'] ) ? esc_attr( $this->options['customnext']) : ''); 
  441. public function customprev_callback() { 
  442. printf('<input type="text" id="customprev" name="cptbc_settings[customprev]" value="%s" size="15" />',  
  443. isset( $this->options['customprev'] ) ? esc_attr( $this->options['customprev']) : ''); 
  444. public function after_title_callback() { 
  445. printf('<input type="text" id="after_title" name="cptbc_settings[after_title]" value="%s" size="15" />',  
  446. isset( $this->options['after_title'] ) ? esc_attr( $this->options['after_title']) : '</h4>'); 
  447. public function before_caption_callback() { 
  448. printf('<input type="text" id="before_caption" name="cptbc_settings[before_caption]" value="%s" size="15" />',  
  449. isset( $this->options['before_caption'] ) ? esc_attr( $this->options['before_caption']) : '<p>'); 
  450. public function after_caption_callback() { 
  451. printf('<input type="text" id="after_caption" name="cptbc_settings[after_caption]" value="%s" size="15" />',  
  452. isset( $this->options['after_caption'] ) ? esc_attr( $this->options['after_caption']) : '</p>'); 
  453. }  
  454.