settings.php
| 1 | <?php |
| 2 | |
| 3 | if(!defined('ABSPATH')) |
| 4 | exit; |
| 5 | |
| 6 | // Check setting |
| 7 | if(!acf_get_setting('acfe/modules/ui')) |
| 8 | return; |
| 9 | |
| 10 | /** |
| 11 | * General Options |
| 12 | */ |
| 13 | add_action('admin_footer-options-general.php', 'acfe_better_options_general_admin_footer'); |
| 14 | add_action('admin_footer-options-writing.php', 'acfe_better_options_general_admin_footer'); |
| 15 | add_action('admin_footer-options-reading.php', 'acfe_better_options_general_admin_footer'); |
| 16 | add_action('admin_footer-options-discussion.php', 'acfe_better_options_general_admin_footer'); |
| 17 | add_action('admin_footer-options-media.php', 'acfe_better_options_general_admin_footer'); |
| 18 | add_action('admin_footer-options-permalink.php', 'acfe_better_options_general_admin_footer'); |
| 19 | function acfe_better_options_general_admin_footer(){ |
| 20 | |
| 21 | global $pagenow; |
| 22 | |
| 23 | ?> |
| 24 | <script type="text/html" id="tmpl-acf-column-2"> |
| 25 | <div class="acf-column-2"> |
| 26 | |
| 27 | <div id="poststuff" class="acfe-acfe-bt-admin-column"> |
| 28 | |
| 29 | <div class="postbox"> |
| 30 | |
| 31 | <h2 class="hndle ui-sortable-handle"><span><?php _e('Settings'); ?></span></h2> |
| 32 | |
| 33 | <div class="inside"> |
| 34 | <div class="submitbox"> |
| 35 | |
| 36 | <div id="major-publishing-actions"> |
| 37 | |
| 38 | <div id="publishing-action"> |
| 39 | |
| 40 | <div class="acfe-form-submit"> |
| 41 | <input type="submit" class="acf-button button button-primary button-large" value="<?php _e('Save Changes'); ?>" /> |
| 42 | <span class="acf-spinner"></span> |
| 43 | </div> |
| 44 | |
| 45 | </div> |
| 46 | <div class="clear"></div> |
| 47 | |
| 48 | </div> |
| 49 | |
| 50 | </div> |
| 51 | |
| 52 | </div> |
| 53 | |
| 54 | </div> |
| 55 | |
| 56 | <?php do_meta_boxes(get_current_screen(), 'side', array()); ?> |
| 57 | |
| 58 | </div> |
| 59 | </div> |
| 60 | </script> |
| 61 | <script type="text/javascript"> |
| 62 | (function($){ |
| 63 | |
| 64 | // ACF Extended UI |
| 65 | $('.wrap').addClass('acfe-ui'); |
| 66 | |
| 67 | // wrap form |
| 68 | $('.acfe-ui > form').wrapInner('<div class="acf-columns-2"><div class="acf-column-1"></div></div>'); |
| 69 | |
| 70 | // add column side |
| 71 | $('.acfe-ui > form .acf-columns-2').append($('#tmpl-acf-column-2').html()); |
| 72 | |
| 73 | <?php if(!in_array($pagenow, array('options-permalink.php', 'options-media.php'))){ ?> |
| 74 | |
| 75 | // add title |
| 76 | var title = $('.wrap > h1').text(); |
| 77 | $('.acfe-ui > form > div > div > table:first').before('<h2>' + title + '</h2>'); |
| 78 | |
| 79 | <?php } ?> |
| 80 | |
| 81 | $('.acfe-ui > h1').css('margin-bottom', '13px'); |
| 82 | |
| 83 | if($('#ping_sites').length){ |
| 84 | |
| 85 | $('#ping_sites').wrap('<table class="form-table"><tbody><td class="td-full"></td></tbody></table>'); |
| 86 | $('#ping_sites').css('width', '100%'); |
| 87 | |
| 88 | } |
| 89 | |
| 90 | // Hide native button |
| 91 | $('.acfe-ui > form p.submit').hide(); |
| 92 | |
| 93 | })(jQuery); |
| 94 | </script> |
| 95 | <?php |
| 96 | |
| 97 | } |