Changeset 2388921
- Timestamp:
- 09/26/2020 03:03:45 PM (5 years ago)
- Location:
- automatic-page-load-progress-bar
- Files:
-
- 20 added
- 2 edited
-
tags/1.1.2 (added)
-
tags/1.1.2/automatic-page-load-progress-bar.php (added)
-
tags/1.1.2/public (added)
-
tags/1.1.2/public/css (added)
-
tags/1.1.2/public/css/admin (added)
-
tags/1.1.2/public/css/admin/aplpb_admin.css (added)
-
tags/1.1.2/public/css/barber-shop.css (added)
-
tags/1.1.2/public/css/center-circle.css (added)
-
tags/1.1.2/public/css/center-radar.css (added)
-
tags/1.1.2/public/css/center-simple.css (added)
-
tags/1.1.2/public/css/fill-left.css (added)
-
tags/1.1.2/public/css/flat-top.css (added)
-
tags/1.1.2/public/css/media_queries (added)
-
tags/1.1.2/public/css/media_queries/aplpb_desktop.css (added)
-
tags/1.1.2/public/css/media_queries/aplpb_mobile.css (added)
-
tags/1.1.2/public/css/media_queries/aplpb_tablet.css (added)
-
tags/1.1.2/public/css/minimal.css (added)
-
tags/1.1.2/public/js (added)
-
tags/1.1.2/public/js/pace.js (added)
-
tags/1.1.2/readme.txt (added)
-
trunk/automatic-page-load-progress-bar.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
automatic-page-load-progress-bar/trunk/automatic-page-load-progress-bar.php
r2323884 r2388921 13 13 * Plugin URI: https://gitlab.com/atilb/automatic-page-load-progress-bar-wordpress-plugin 14 14 * Description: Light and efficient extension to add a progress bar in less than a minute. 15 * Version: 1.1. 115 * Version: 1.1.2 16 16 * Author: Arnaud TILBIAN 17 17 * Author URI: https://www.arnaudtilbian.com … … 21 21 22 22 function aplpb_hook_progress_bar_front_content($isShortcode = FALSE) { 23 if( (get_post_type( get_the_ID() ) == 'page' && get_option("aplpb_option_checkbox_page") == '1') || (get_post_type( get_the_ID() ) == 'post' && get_option("aplpb_option_checkbox_post") == '1') )23 if( (get_post_type( get_the_ID() ) == 'page' && get_option("aplpb_option_checkbox_page") == '1') || (get_post_type( get_the_ID() ) == 'post' && get_option("aplpb_option_checkbox_post") == '1') || ( is_custom_post_type() ) && get_option("aplpb_option_checkbox_custom") == '1' ) 24 24 { 25 25 $page_id = get_queried_object_id(); … … 33 33 } 34 34 35 // thx to https://wordpress.stackexchange.com/a/95906 36 function is_custom_post_type( $post = NULL ) 37 { 38 $all_custom_post_types = get_post_types( array ( '_builtin' => FALSE ) ); 39 40 if ( empty ( $all_custom_post_types ) ) 41 return FALSE; 42 43 $custom_types = array_keys( $all_custom_post_types ); 44 $current_post_type = get_post_type( $post ); 45 46 if ( ! $current_post_type ) 47 return FALSE; 48 49 return in_array( $current_post_type, $custom_types ); 50 } 51 35 52 function aplpb_hook_progress_bar_front_content_shortcode($theme = NULL, $color = NULL) { 36 53 aplpb_add_javascript(); … … 68 85 add_option( 'aplpb_option_color', '#ffffff'); 69 86 add_option( 'aplpb_option_checkbox_page', '1'); 87 add_option( 'aplpb_option_checkbox_custom', '1'); 70 88 add_option( 'aplpb_option_checkbox_post', '1'); 71 89 add_option( 'aplpb_option_query_desktop', '1'); … … 75 93 register_setting( 'aplpb_options_group', 'aplpb_option_color' ); 76 94 register_setting( 'aplpb_options_group', 'aplpb_option_checkbox_page' ); 95 register_setting( 'aplpb_options_group', 'aplpb_option_checkbox_custom' ); 77 96 register_setting( 'aplpb_options_group', 'aplpb_option_checkbox_post' ); 78 97 register_setting( 'aplpb_options_group', 'aplpb_option_query_desktop' ); … … 141 160 <label for="aplpb_option_checkbox_post">Enable on blog post</label> 142 161 </p> 162 <p> 163 <input type="checkbox" id="aplpb_option_checkbox_custom" name="aplpb_option_checkbox_custom" value="1" <?php checked( get_option( 'aplpb_option_checkbox_custom' ), '1' ); ?>/> 164 <label for="aplpb_option_checkbox_custom">Enable on all custom post</label> 165 </p> 143 166 </td> 144 167 </tr> -
automatic-page-load-progress-bar/trunk/readme.txt
r2323884 r2388921 5 5 Requires at least: 3.0.1 6 6 Tested up to: 5.4 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 59 59 60 60 == Changelog == 61 = 1.1.2 = 62 * Custom post can now display the progress bar 63 61 64 = 1.1.1 = 62 65 * Flat top theme added, and small optimization(css minifying)
Note: See TracChangeset
for help on using the changeset viewer.