Changeset 2292927
- Timestamp:
- 04/27/2020 07:06:38 PM (6 years ago)
- Location:
- automatic-page-load-progress-bar/trunk
- Files:
-
- 2 edited
-
automatic-page-load-progress-bar.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
automatic-page-load-progress-bar/trunk/automatic-page-load-progress-bar.php
r2292204 r2292927 13 13 * Plugin URI: https://gitlab.com/atilb/automatic-page-load-progress-bar-wordpress-plugin 14 14 * Description: Add smooth and beautifull progress bar for your website. THX to : https://github.hubspot.com/pace/docs/welcome/# 15 * Version: 1.0. 215 * Version: 1.0.3 16 16 * Author: Arnaud TILBIAN 17 17 * Author URI: https://www.arnaudtilbian.com … … 33 33 34 34 function aplpb_hook_style_dynamic_content() { 35 $drawGlobally = get_option( 'aplpb_option_checkbox ');35 $drawGlobally = get_option( 'aplpb_option_checkbox '); 36 36 if($drawGlobally == '1') 37 37 { 38 aplpb_add_dynamic_content(); 38 $page_id = get_queried_object_id(); 39 $page_object = get_page( $page_id ); 40 if ( !has_shortcode($page_object->post_content, "aplpb_shortcode")) 41 { 42 aplpb_add_dynamic_content(); 43 } 39 44 } 40 45 } … … 42 47 function aplpb_add_dynamic_content($theme = NULL, $color = NULL) { 43 48 if($theme == NULL) 49 { 44 50 $theme = get_option( 'aplpb_option_theme' ); 51 } 45 52 if($color == NULL) 53 { 46 54 $color = get_option( 'aplpb_option_color' ); 55 } 47 56 48 57 wp_enqueue_style( $theme, plugins_url( 'public/css/' . $theme . '.css' , __FILE__ ), array(), false, false); … … 105 114 </tr> 106 115 <tr valign="top"> 107 <th scope="row"><label for="aplpb_option_checkbox">Enable on all pages(shortcodes won't be active)</label></th>116 <th scope="row"><label for="aplpb_option_checkbox">Enable on all pages(shortcodes can override it for page specfic loading bar)</label></th> 108 117 <td> 109 118 <input type="checkbox" id="aplpb_option_checkbox" name="aplpb_option_checkbox" value="1" <?php checked( get_option( 'aplpb_option_checkbox' ), '1' ); ?>/> … … 128 137 'color' => 'red' 129 138 ), $atts); 130 $drawGlobally = get_option( 'aplpb_option_checkbox '); 131 if($drawGlobally != '1') 132 { 133 aplpb_add_javascript(); 134 aplpb_add_dynamic_content(esc_html( $a['theme'] ), esc_html( $a['color'] )); 135 } 139 140 aplpb_add_javascript(); 141 aplpb_add_dynamic_content(esc_html( $a['theme'] ), esc_html( $a['color'] )); 136 142 } 137 143 add_shortcode( 'aplpb_shortcode', 'aplpb_shortcode'); -
automatic-page-load-progress-bar/trunk/readme.txt
r2292204 r2292927 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Embed beautiful lloading bar on your wordpress website in just a few clics.11 Embed beautiful loading bar on your wordpress website in just a few clics. 12 12 13 13 == Description == … … 21 21 22 22 23 Shortcode give you a way to add specific shortcode for each page. 23 Shortcode give you a way to add specific shortcode for each page. It will override the globally defined progress bar . 24 24 Example of use: 25 25 [aplpb_shortcode theme="minimal" color="blue"] … … 56 56 2. Choose color and theme 57 57 3. Examples of loading screen/bar/wheel 58 4. Example of shortcode use 58 59 59 60 == Changelog == 60 61 62 = 1.0.3 = 63 * Shortcodes can now override globally defined progress bar 64 61 65 = 1.0.2 = 62 66 * Shortcode functionnality added
Note: See TracChangeset
for help on using the changeset viewer.