Changeset 620031
- Timestamp:
- 11/01/2012 10:00:58 PM (13 years ago)
- File:
-
- 1 edited
-
wp-fontsize/trunk/wp_fontsize.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-fontsize/trunk/wp_fontsize.php
r620025 r620031 5 5 Description: Adds Stateful Fontsize Adjustment Classes to the body of the Website 6 6 Author: Circle Tree, LLC 7 Version: 0.6. 27 Version: 0.6.3 8 8 Author URI: http://mycircletree.com/ 9 9 */ … … 25 25 } 26 26 function init () { 27 $js_vars = array(28 'ajaxurl'=>admin_url('admin-ajax.php'),29 'fontsize' => $this->getFontSize(),30 'nonce' => wp_create_nonce('wp_fontsize'),31 );32 wp_localize_script('jquery', 'wp_fontsize', $js_vars);33 27 wp_enqueue_script('jquery'); 34 28 add_action('wp_footer', array($this, 'footer')); … … 130 124 </div> 131 125 <?php } 132 private function js () { ?> 126 private function js () { 127 $js_vars = array( 128 'ajaxurl'=>admin_url('admin-ajax.php'), 129 'fontsize' => $this->getFontSize(), 130 'nonce' => wp_create_nonce('wp_fontsize'), 131 ); 132 $json_data = json_encode($js_vars); 133 ?> 133 134 <script> 134 var current_size = wp_fontsize.fontsize; 135 /* <![CDATA[ */ 136 var wp_fontsize = <?php echo $json_data; ?>, 137 current_size = wp_fontsize.fontsize; 138 /* ]]> */ 135 139 jQuery(function($) { 136 140 <?php //A named function is used in place of jQuery.ajaxSetup to avoid plugin conflicts; ?>
Note: See TracChangeset
for help on using the changeset viewer.