Changeset 1244509
- Timestamp:
- 09/13/2015 12:32:30 PM (11 years ago)
- Location:
- white-bracket-theme-options
- Files:
-
- 13 added
- 6 edited
-
assets/screenshot-7.png (added)
-
tags/1.3.2 (added)
-
tags/1.3.2/admin (added)
-
tags/1.3.2/admin/admin.php (added)
-
tags/1.3.2/admin/images (added)
-
tags/1.3.2/admin/images/toggle-content.png (added)
-
tags/1.3.2/css (added)
-
tags/1.3.2/css/white-bracket-theme-options.css (added)
-
tags/1.3.2/js (added)
-
tags/1.3.2/js/white-bracket-theme-options.js (added)
-
tags/1.3.2/readme.txt (added)
-
tags/1.3.2/white-bracket-functions.php (added)
-
tags/1.3.2/white-bracket-theme-options.php (added)
-
trunk/admin/admin.php (modified) (5 diffs)
-
trunk/css/white-bracket-theme-options.css (modified) (2 diffs)
-
trunk/js/white-bracket-theme-options.js (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/white-bracket-functions.php (modified) (4 diffs)
-
trunk/white-bracket-theme-options.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
white-bracket-theme-options/trunk/admin/admin.php
r1228137 r1244509 62 62 echo '});'; 63 63 echo '</script>'; 64 elseif( isset($_POST["save-analytics"]) ): 65 $account_number = $_POST["google-analytics"]; 66 update_option( 'white-bracket-google-analytics', $account_number ); 67 $options_updated = 'yes'; 64 68 endif; 65 69 endif; … … 81 85 echo '<div class="wb-tab active" id="wb-content-tab">Content</div>'; 82 86 echo '<div class="wb-tab" id="wb-settings-tab">Settings</div>'; 87 echo '<div class="wb-tab" id="wb-analytics-tab">Google Analytics</div>'; 83 88 echo '<div class="wb-tab" id="wb-documentation-tab">Documentation</div>'; 84 89 echo '</div>'; … … 116 121 echo '<h3>Settings</h3>'; 117 122 get_current_white_bracket_settings(); 123 echo '</div>'; 124 echo '<div class="wb-analytics">'; 125 echo '<h3>Google Analytics</h3>'; 126 get_white_bracket_analytics(); 118 127 echo '</div>'; 119 128 echo '<div class="wb-documentation">'; … … 228 237 } 229 238 239 function get_white_bracket_analytics(){ 240 241 $value = ""; 242 $value = get_option('white-bracket-google-analytics'); 243 244 $output = '<h4>Google Analytics Account Number</h4>'; 245 $output .= '<form action="'.$_SERVER["REQUEST_URI"].'" method="post">'; 246 $output .= '<p><input type="text" name="google-analytics" value="'.$value.'" placeholder="UA-12345678-1" /></p>'; 247 $output .= '<input class="button button-primary button-large" type="submit" name="save-analytics" value="Save Analytics" />'; 248 $output .= '</form>'; 249 250 echo $output; 251 } 252 230 253 function get_white_bracket_documntation(){ 231 254 … … 236 259 $output .= '<p>[wbo option_name="wb_XXXX" wpautop="no"]</p>'; 237 260 261 $output .= '<h4>Google Analytics</h4>'; 262 $output .= '<p>To add Google Analytics to your website, simply enter your account number into the input field and click save. Your Google Analytics account number will look something like UA-12345678-1. This will insert the universal analytics onto everypage on your website.</p>'; 263 238 264 echo $output; 239 265 } -
white-bracket-theme-options/trunk/css/white-bracket-theme-options.css
r1228137 r1244509 31 31 font-weight: bold; 32 32 } 33 .wb-content, .wb-settings, .wb-documentation {33 .wb-content, .wb-settings, .wb-documentation, .wb-analytics{ 34 34 width:100%; 35 35 padding:10px 20px; … … 41 41 box-sizing: border-box; 42 42 } 43 .wb-settings, .wb-documentation {43 .wb-settings, .wb-documentation, .wb-analytics{ 44 44 display:none; 45 45 } -
white-bracket-theme-options/trunk/js/white-bracket-theme-options.js
r1228137 r1244509 34 34 $('.wb-content').slideUp(); 35 35 $('.wb-settings').delay(500).slideDown(); 36 $('.wb-analytics').slideUp(); 36 37 $('.wb-documentation').slideUp(); 37 38 $('#wb-settings-tab').addClass('active'); 38 39 $('#wb-content-tab').removeClass('active'); 40 $('#wb-analytics-tab').removeClass('active'); 39 41 $('#wb-documentation-tab').removeClass('active'); 40 42 }); … … 42 44 $('.wb-settings').slideUp(); 43 45 $('.wb-content').delay(500).slideDown(); 46 $('.wb-analytics').slideUp(); 44 47 $('.wb-documentation').slideUp(); 45 48 $('#wb-content-tab').addClass('active'); 49 $('#wb-analytics-tab').removeClass('active'); 50 $('#wb-settings-tab').removeClass('active'); 51 $('#wb-documentation-tab').removeClass('active'); 52 }); 53 $('#wb-analytics-tab').click(function(){ 54 $('.wb-settings').slideUp(); 55 $('.wb-content').slideUp(); 56 $('.wb-analytics').delay(500).slideDown(); 57 $('.wb-documentation').slideUp(); 58 $('#wb-content-tab').removeClass('active'); 59 $('#wb-analytics-tab').addClass('active'); 46 60 $('#wb-settings-tab').removeClass('active'); 47 61 $('#wb-documentation-tab').removeClass('active'); … … 50 64 $('.wb-settings').slideUp(); 51 65 $('.wb-content').slideUp(); 66 $('.wb-analytics').slideUp(); 52 67 $('.wb-documentation').delay(500).slideDown(); 53 68 $('#wb-content-tab').removeClass('active'); 69 $('#wb-analytics-tab').removeClass('active'); 54 70 $('#wb-settings-tab').removeClass('active'); 55 71 $('#wb-documentation-tab').addClass('active'); -
white-bracket-theme-options/trunk/readme.txt
r1230794 r1244509 1 1 === White Bracket Theme Options === 2 2 Contributors: White Bracket 3 Tags: global content, theme options, more wysiwyg editors, heading tags styling, tag styling3 Tags: global content, theme options, more wysiwyg editors, google analytics, universal analytics, universal google analytics 4 4 Requires at least: 3.5 5 5 Tested up to: 4.3 6 6 7 7 == Description == 8 White Bracket Theme Options lets you create global content/global options that you can then add to any page or post via shortcode. The shortcode is generated as soon as you save your content. As well as creating additional content, you can set the font size and font colour of heading tags (h1 through to h6), p tags, a tags and li tags. 8 White Bracket Theme Options lets you create global content/global options that you can then add to any page or post via shortcode. The shortcode is generated as soon as you save your content. As well as creating additional content, you can set the font size and font colour of heading tags (h1 through to h6), p tags, a tags and li tags. The latest addition to the plugin is the ability to add the latest Google Analytics code to every page on your website. 9 9 10 10 This plugin is perfect for you, if you want content to appear in multiple places across your site, such as telephone numbers, email addresses and images. Edit the content in one place, and it changes everywhere you have used the generated shortcode. … … 32 32 33 33 == Frequently Asked Questions == 34 Q: Is it possible to remove p tags from the shortcode output? 35 a: Yes, just add wpautop="no" e.g. [wbo option_name="wb_XXXX" wpautop="no"]34 = Q: Is it possible to remove p tags from the shortcode output? = 35 A: Yes, just add wpautop="no" e.g. [wbo option_name="wb_XXXX" wpautop="no"] 36 36 37 37 == Screenshots == … … 42 42 5. Settings tab 43 43 6. Editing H1 settings 44 7. Google Analytics 44 45 45 46 == Changelog == 47 48 = 1.3.2 = 49 * Added the ability to add Google Analytics to every page on a website. 50 * Removed the !important statement off the generated css as it was being applied to items such as menu items, which is not the intention. The main idea is the adjust the site content. 46 51 47 52 = 1.3.1 = -
white-bracket-theme-options/trunk/white-bracket-functions.php
r1230794 r1244509 36 36 $li_settings = get_option('white_bracket_setting_li'); 37 37 38 $output = '<!-- ADDED BY WHITE BRACKET THEME OPTIONS START-->'.PHP_EOL;38 $output = '<!-- ADDED BY WHITE BRACKET THEME OPTIONS -->'.PHP_EOL; 39 39 $output .= '<style type="text/css">'.PHP_EOL; 40 40 if($h1_settings): … … 66 66 endif; 67 67 $output .= '</style>'.PHP_EOL; 68 $output .= '<!-- ADDED BY WHITE BRACKET THEME OPTIONS END-->'.PHP_EOL;68 $output .= '<!-- ADDED BY WHITE BRACKET THEME OPTIONS -->'.PHP_EOL; 69 69 70 70 if( $output != '<!-- ADDED BY WHITE BRACKET THEME OPTIONS --><style type="text/css"></style><!-- ADDED BY WHITE BRACKET THEME OPTIONS -->' ): … … 81 81 $font_size = $value["font-size"]; 82 82 if( stripos($font_size, 'px') > 0 ): 83 $output = $tag.'{font-size:'.$value["font-size"].' !important; color:'.$value["colour"].' !important;}'.PHP_EOL;83 $output = $tag.'{font-size:'.$value["font-size"].'; color:'.$value["colour"].';}'.PHP_EOL; 84 84 else: 85 $output = $tag.'{font-size:'.$value["font-size"].'px !important; color:'.$value["colour"].' !important;}'.PHP_EOL;85 $output = $tag.'{font-size:'.$value["font-size"].'px; color:'.$value["colour"].';}'.PHP_EOL; 86 86 endif; 87 87 else: … … 91 91 return $output; 92 92 } 93 94 function add_white_bracket_google_analytics(){ 95 96 $google_analytics = get_option('white-bracket-google-analytics'); 97 98 $output = '<!-- ADDED BY WHITE BRACKET THEME OPTIONS -->'.PHP_EOL; 99 $output .= "<script>".PHP_EOL;; 100 $output .= "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){".PHP_EOL; 101 $output .= "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),".PHP_EOL; 102 $output .= "m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)".PHP_EOL; 103 $output .= "})(window,document,'script','//www.google-analytics.com/analytics.js','ga');".PHP_EOL; 104 $output .= "".PHP_EOL; 105 $output .= "ga('create', '".$google_analytics."', 'auto');".PHP_EOL; 106 $output .= "ga('send', 'pageview');".PHP_EOL; 107 $output .= "</script>".PHP_EOL; 108 $output .= '<!-- ADDED BY WHITE BRACKET THEME OPTIONS -->'.PHP_EOL; 109 110 echo $output; 111 } 112 $google_analytics = get_option('white-bracket-google-analytics'); 113 if($google_analytics): 114 add_action('wp_head','add_white_bracket_google_analytics'); 115 endif; -
white-bracket-theme-options/trunk/white-bracket-theme-options.php
r1230794 r1244509 4 4 * Plugin Name: White Bracket Theme Options 5 5 * Plugin URI: 6 * Description: Lets you create global content/global options. Perfect for creating content to appear in multiple places around the site, and edit it in one place.7 * Version: 1.3. 16 * Description: Create content to appear in multiple places around your site and edit in one place. Add universal Google Analytics. Adjust text colours and size. 7 * Version: 1.3.2 8 8 * Author: White Bracket 9 9 * Author URI: http://www.white-bracket.co.uk
Note: See TracChangeset
for help on using the changeset viewer.