| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | Plugin Name: Mfields Test jQuery UI Tabs |
|---|
| 4 | Description: Simple test plugin to test the compatibility of jQuery UITabs and the WordPress Customizer. |
|---|
| 5 | */ |
|---|
| 6 | |
|---|
| 7 | function mfields_jquery_ui_test_enqueue() { |
|---|
| 8 | wp_enqueue_script( 'jquery-ui-tabs' ); |
|---|
| 9 | } |
|---|
| 10 | add_action( 'wp_enqueue_scripts', 'mfields_jquery_ui_test_enqueue' ); |
|---|
| 11 | |
|---|
| 12 | function mfields_jquery_ui_test_wp_footer() { |
|---|
| 13 | echo '<script type="text/javascript">jQuery(document).ready(function($) { $(".ui-tabs").tabs(); });</script>' . "\n"; |
|---|
| 14 | } |
|---|
| 15 | add_action( 'wp_footer', 'mfields_jquery_ui_test_wp_footer', 20 ); |
|---|
| 16 | |
|---|
| 17 | function mfields_jquery_ui_test_get_header() { |
|---|
| 18 | static $i = 0; |
|---|
| 19 | if ( 0 < $i ) |
|---|
| 20 | return; |
|---|
| 21 | ?> |
|---|
| 22 | <div id="tabs-2" class="widget ui-tabs ui-widget ui-widget-content ui-corner-all"> |
|---|
| 23 | <div class="widget-wrap"> |
|---|
| 24 | <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" role="tablist"> |
|---|
| 25 | <li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active" role="tab" tabindex="0" aria-controls="cat-174" aria-labelledby="ui-id-1" aria-selected="true"> |
|---|
| 26 | <a href="#cat-174" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-1">Art</a> |
|---|
| 27 | </li> |
|---|
| 28 | <li class="ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="cat-175" aria-labelledby="ui-id-2" aria-selected="false"> |
|---|
| 29 | <a href="#cat-175" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-2">General</a> |
|---|
| 30 | </li> |
|---|
| 31 | <li class="ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="cat-176" aria-labelledby="ui-id-3" aria-selected="false"> |
|---|
| 32 | <a href="#cat-176" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-3">Music</a> |
|---|
| 33 | </li> |
|---|
| 34 | <li class="ui-state-default ui-corner-top" role="tab" tabindex="-1" aria-controls="cat-1" aria-labelledby="ui-id-4" aria-selected="false"> |
|---|
| 35 | <a href="#cat-1" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-4">Uncategorized</a> |
|---|
| 36 | </li> |
|---|
| 37 | </ul> |
|---|
| 38 | |
|---|
| 39 | <div id="cat-174" class="post-154 post type-post status-publish format-image hentry category-art tag-sticker tag-street-art ui-tabs-hide ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-1" role="tabpanel" style="display: block;" aria-expanded="true" aria-hidden="false"> |
|---|
| 40 | </div><!--end post_class()--> |
|---|
| 41 | |
|---|
| 42 | <div id="cat-175" class="post-229 post type-post status-publish format-link hentry category-general ui-tabs-hide ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-2" role="tabpanel" style="display: none;" aria-expanded="false" aria-hidden="true"> |
|---|
| 43 | <p>Life-Phorm is a creepy stand for phones, tablets, and cameras.</p> |
|---|
| 44 | </div><!--end post_class()--> |
|---|
| 45 | |
|---|
| 46 | <div id="cat-176" class="post-591 post type-post status-publish format-link hentry category-music tag-v-drum ui-tabs-hide ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-3" role="tabpanel" style="display: none;" aria-expanded="false" aria-hidden="true"> |
|---|
| 47 | <p>drumsplitters.com offers splitter cables for Roland V-Drums.</p> |
|---|
| 48 | </div><!--end post_class()--> |
|---|
| 49 | |
|---|
| 50 | <div id="cat-1" class="post-1239 post type-post status-publish format-standard hentry category-uncategorized ui-tabs-hide ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-4" role="tabpanel" style="display: none;" aria-expanded="false" aria-hidden="true"> |
|---|
| 51 | </div><!--end post_class()--> |
|---|
| 52 | |
|---|
| 53 | </div> |
|---|
| 54 | </div> |
|---|
| 55 | <?php |
|---|
| 56 | $i++; |
|---|
| 57 | } |
|---|
| 58 | add_action( 'the_content', 'mfields_jquery_ui_test_get_header' ); |
|---|
| 59 | add_action( 'the_excerpt', 'mfields_jquery_ui_test_get_header' ); |
|---|