Changeset 875562
- Timestamp:
- 03/14/2014 06:32:58 PM (12 years ago)
- Location:
- profit-button/trunk
- Files:
-
- 2 edited
-
probtn.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
profit-button/trunk/probtn.php
r869984 r875562 4 4 * Plugin URI: http://probtn.com 5 5 * Description: Floating Button is an interactive element that used to show custom content inside your application. If the button is tapped then the popup with Browser would open. The url in the Browser is set using settings on our server. 6 * Version: 1.9. 36 * Version: 1.9.4 7 7 * Author: hintsolutions 8 8 * Author URI: http://probtn.com … … 392 392 </div> 393 393 <!-- END SETTINGS MENU --> 394 395 <!--START SELECT MENU ITEMS --> 396 <h3 style="cursor: pointer;" id="">Menu assignment <small>▼</small></h3> 397 <p>You can select menu items, where button would be shown\hidden, or by default it would be shown at all pages.</p> 398 399 <form method="post" action="options.php"> 400 <?php 401 settings_fields( 'probtn_settings' ); 402 do_settings_sections( __FILE__ ); 403 //get the older values, wont work the first time 404 $options = get_option( 'probtn_settings' ); 405 //print_r($menu_options); 406 ?> 407 <input type="checkbox" name="probtn_settings[menu_show]" value="on" <?php checked( 'on' == $options["menu_show"]); ?> /> 408 <span>Show button only at selected menu pages</span><br/> 409 <br/> 410 <input type="submit" value="Save" class="button-primary"/> 411 </form> 412 413 <?php 414 // Get the nav menu based on $menu_name (same as 'theme_location' or 'menu' arg to wp_nav_menu) 415 // This code based on wp_nav_menu's code to get Menu ID from menu slug 416 417 $menu_name = 'custom_menu_slug'; 418 $locations = get_terms( 'nav_menu', array( 'hide_empty' => true ) ); 419 //print_r($locations); 420 421 foreach ($locations as $menu) { 422 ?> 423 <form method="post" action="options.php"> 424 <?php 425 settings_fields( 'probtn_menu_settings' ); 426 do_settings_sections( __FILE__ ); 427 //get the older values, wont work the first time 428 $menu_options = get_option( 'probtn_menu_settings' ); 429 //print_r($menu_options); 430 ?> 431 <h4><?php echo $menu->name; ?></h4> 432 <input type="checkbox" name="probtn_menu_settings[<?php echo $menu->slug; ?>_all]" value="on" <?php checked( 'on' == $menu_options[$menu->slug."_all"]); ?> /> 433 <span>All items</span><br/> 434 <?php 435 $items = wp_get_nav_menu_items($menu->slug); 436 //print_r($items); 437 foreach ($items as $item) { 438 ?> 439 <input type="checkbox" name=probtn_menu_settings[<?php echo $menu->slug; ?>_<?php echo $item->ID; ?>]" value="<?php echo $item->ID; ?>" <?php checked( $item->ID == $menu_options[$menu->slug."_".$item->ID]); ?>/> 440 <span><?php echo $item->title; ?></span><br/> 441 <?php 442 } 443 ?> 444 <br/> 445 <input type="submit" value="Save" class="button-primary"/> 446 </form> 447 <?php 448 } 449 ?> 450 451 <!--END SELECT MENU --> 452 394 453 395 454 <!-- START LAUNCH DEMO BUTTON --> … … 533 592 <script src='https://admin.probtn.com/1/functions/logWPplugin?X-ProBtn-Token=b04bb84b22cdacb0d57fd8f8fd3bfeb8ad430d1b&callback=&server=<?php echo $_SERVER['SERVER_NAME']; ?>&email=<?php echo $current_user->user_email; ?>'></script> 534 593 535 536 <!--START SELECT MENU ITEMS -->537 <h3 style="cursor: pointer;" id="">Menu assignment <small>▼</small></h3>538 <p>You can select menu items, where button would be shown\hidden, or by default it would be shown at all pages.</p>539 540 <form method="post" action="options.php">541 <?php542 settings_fields( 'probtn_settings' );543 do_settings_sections( __FILE__ );544 //get the older values, wont work the first time545 $options = get_option( 'probtn_settings' );546 //print_r($menu_options);547 ?>548 <input type="checkbox" name="probtn_settings[menu_show]" value="on" <?php checked( 'on' == $options["menu_show"]); ?> />549 <span>Show button only at selected menu pages</span><br/>550 <br/>551 <input type="submit" value="Save" class="button-primary"/>552 </form>553 554 <?php555 // Get the nav menu based on $menu_name (same as 'theme_location' or 'menu' arg to wp_nav_menu)556 // This code based on wp_nav_menu's code to get Menu ID from menu slug557 558 $menu_name = 'custom_menu_slug';559 $locations = get_terms( 'nav_menu', array( 'hide_empty' => true ) );560 //print_r($locations);561 562 foreach ($locations as $menu) {563 ?>564 <form method="post" action="options.php">565 <?php566 settings_fields( 'probtn_menu_settings' );567 do_settings_sections( __FILE__ );568 //get the older values, wont work the first time569 $menu_options = get_option( 'probtn_menu_settings' );570 //print_r($menu_options);571 ?>572 <h4><?php echo $menu->name; ?></h4>573 <input type="checkbox" name="probtn_menu_settings[<?php echo $menu->slug; ?>_all]" value="on" <?php checked( 'on' == $menu_options[$menu->slug."_all"]); ?> />574 <span>All items</span><br/>575 <?php576 $items = wp_get_nav_menu_items($menu->slug);577 //print_r($items);578 foreach ($items as $item) {579 ?>580 <input type="checkbox" name=probtn_menu_settings[<?php echo $menu->slug; ?>_<?php echo $item->ID; ?>]" value="<?php echo $item->ID; ?>" <?php checked( $item->ID == $menu_options[$menu->slug."_".$item->ID]); ?>/>581 <span><?php echo $item->title; ?></span><br/>582 <?php583 }584 ?>585 <br/>586 <input type="submit" value="Save" class="button-primary"/>587 </form>588 <?php589 }590 ?>591 592 <!--END SELECT MENU -->593 594 594 595 <!-- START SETUP TUTORIAL --> -
profit-button/trunk/readme.txt
r875542 r875562 5 5 Requires at least: 3.3 6 6 Tested up to: 3.5.1 7 Stable tag: 1.9. 37 Stable tag: 1.9.4 8 8 License: Licenced under LGPL 9 9 License URI: http://opensource.org/licenses/LGPL-3.0 … … 76 76 == Changelog == 77 77 78 = 1.9.4 = 79 Menu settings are shown and for local, and for remote settings. 80 78 81 = 1.9.3 = 79 82 Added timeout before button would be shown to prevent some conflicts with other users plugins.
Note: See TracChangeset
for help on using the changeset viewer.