Changeset 971243
- Timestamp:
- 08/23/2014 08:42:50 AM (12 years ago)
- Location:
- wpbizplugins-custom-admin-help-boxes/trunk
- Files:
-
- 1 added
- 5 edited
-
assets/fitvids.js (added)
-
inc/custom-functions.php (modified) (5 diffs)
-
inc/custom-posttypes.php (modified) (5 diffs)
-
inc/install.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
wpbizplugins-custom-admin-help-boxes.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpbizplugins-custom-admin-help-boxes/trunk/inc/custom-functions.php
r966836 r971243 97 97 $args = array( 98 98 99 'post_type' => 'wpbizplugins-cahb' 99 'post_type' => 'wpbizplugins-cahb', 100 'posts_per_page' => -1 100 101 101 102 ); … … 121 122 $where_to_display_additional_array = explode(',', $where_to_display_additional ); 122 123 123 $where_to_display = array_merge( $where_to_display, $where_to_display_additional_array );124 if( ( is_array( $where_to_display_additional ) ) && ( is_array( $where_to_display ) ) ) $where_to_display = array_merge( $where_to_display, $where_to_display_additional_array ); 124 125 125 126 $content = get_post_meta( $help_box_id, 'content', true ); … … 172 173 foreach( $metaboxes_array as $metabox ) { 173 174 174 foreach( $metabox['where_to_display'] as $where_to_display ) { 175 176 if( ( $where_to_display != 'dashboard' ) && ( $where_to_display != '' ) ) { 177 178 add_meta_box( 179 180 $metabox['html_id'], 181 $metabox['title'], 182 $metabox['callback'], 183 $where_to_display, 184 $metabox['context'], 185 $metabox['priority'], 186 array( 187 'content' => $metabox[ 'content' ], 188 'show_extras' => $metabox[ 'show_extras' ], 189 'use_popup' => $metabox[ 'use_popup' ], 190 'popup_button_text' => $metabox[ 'popup_button_text' ], 191 'popup_button_text_before' => $metabox[ 'popup_button_text_before' ], 192 'autop' => $metabox[ 'autop' ] 193 194 ) 195 196 ); 175 if( is_array( $metabox[ 'where_to_display' ] ) ) { 176 177 foreach( $metabox['where_to_display'] as $where_to_display ) { 178 179 if( ( $where_to_display != 'dashboard' ) && ( $where_to_display != '' ) ) { 180 181 add_meta_box( 182 183 $metabox['html_id'], 184 $metabox['title'], 185 $metabox['callback'], 186 $where_to_display, 187 $metabox['context'], 188 $metabox['priority'], 189 array( 190 'content' => $metabox[ 'content' ], 191 'show_extras' => $metabox[ 'show_extras' ], 192 'use_popup' => $metabox[ 'use_popup' ], 193 'popup_button_text' => $metabox[ 'popup_button_text' ], 194 'popup_button_text_before' => $metabox[ 'popup_button_text_before' ], 195 'autop' => $metabox[ 'autop' ] 196 197 ) 198 199 ); 200 201 } 197 202 198 203 } … … 218 223 foreach( $metaboxes_array as $metabox ) { 219 224 220 foreach( $metabox['where_to_display'] as $where_to_display ) { 221 222 if( ( $where_to_display == 'dashboard' ) && ( $where_to_display != '' ) ) { 223 224 add_meta_box( 225 226 $metabox['html_id'], 227 $metabox['title'], 228 $metabox['callback'], 229 $where_to_display, 230 $metabox['context'], 231 $metabox['priority'], 232 array( 233 'content' => $metabox['content'], 234 'show_extras' => $metabox['show_extras'], 235 'use_popup' => $metabox['use_popup'], 236 'popup_button_text' => $metabox['popup_button_text'], 237 'popup_button_text_before' => $metabox['popup_button_text_before'], 238 'autop' => $metabox[ 'autop' ] 239 ) 240 241 ); 225 if( is_array( $metabox[ 'where_to_display' ] ) ) { 226 227 foreach( $metabox['where_to_display'] as $where_to_display ) { 228 229 if( ( $where_to_display == 'dashboard' ) && ( $where_to_display != '' ) ) { 230 231 add_meta_box( 232 233 $metabox['html_id'], 234 $metabox['title'], 235 $metabox['callback'], 236 $where_to_display, 237 $metabox['context'], 238 $metabox['priority'], 239 array( 240 'content' => $metabox['content'], 241 'show_extras' => $metabox['show_extras'], 242 'use_popup' => $metabox['use_popup'], 243 'popup_button_text' => $metabox['popup_button_text'], 244 'popup_button_text_before' => $metabox['popup_button_text_before'], 245 'autop' => $metabox[ 'autop' ] 246 ) 247 248 ); 249 250 } 242 251 243 252 } … … 332 341 .wpbizplugins-cahb-button:hover { 333 342 background-color:#6aaaeb; 334 color: #F6F6F6 !important;343 color: #F6F6F6; 335 344 } 336 345 337 346 .wpbizplugins-cahb-button:active { 338 color: #F6F6F6 !important;347 color: #F6F6F6; 339 348 } 340 349 341 350 .wpbizplugins-cahb-button:focus { 342 color: #F6F6F6 !important;343 } 344 345 .btn-blue { background-color:#2EA0CC !important; border:1px solid #408099 !important; text-shadow:0px 0px 3px #0F6485 !important; }346 .btn-blue:hover { background-color:#408099 !important; }.btn-green { background-color:#26B637 !important; border:1px solid #42A84F !important; text-shadow:0px 0px 3px #0E921E !important; }347 .btn-green:hover { background-color:#42A84F !important; }.btn-red { background-color:#FF4531 !important; border:1px solid #BF564B !important; text-shadow:0px 0px 3px #A61E10 !important; }348 .btn-red:hover { background-color:#BF564B !important; }.btn-orange { background-color:#FF9C31 !important; border:1px solid #BF884B !important; text-shadow:0px 0px 3px #A65E10 !important; }349 .btn-orange:hover { background-color:#BF884B !important; }351 color: #F6F6F6; 352 } 353 354 .btn-blue { background-color:#2EA0CC; border:1px solid #408099; text-shadow:0px 0px 3px #0F6485 ; } 355 .btn-blue:hover { background-color:#408099; }.btn-green { background-color:#26B637; border:1px solid #42A84F; text-shadow:0px 0px 3px #0E921E; } 356 .btn-green:hover { background-color:#42A84F; }.btn-red { background-color:#FF4531; border:1px solid #BF564B; text-shadow:0px 0px 3px #A61E10; } 357 .btn-red:hover { background-color:#BF564B; }.btn-orange { background-color:#FF9C31; border:1px solid #BF884B; text-shadow:0px 0px 3px #A65E10; } 358 .btn-orange:hover { background-color:#BF884B; } 350 359 351 360 ' . $wpbizplugins_cahb_options['custom_css'] ); -
wpbizplugins-custom-admin-help-boxes/trunk/inc/custom-posttypes.php
r966836 r971243 117 117 global $wpbizplugins_cahb_options; 118 118 119 // Only grab public post types, and ignore the ones built into WordPress 119 // Add Dashboard separately 120 $wpbizplugins_cahb_post_types = array(); 121 $wpbizplugins_cahb_post_types['dashboard'] = 'dashboard'; 122 120 123 $args = array( 121 'public' => true,122 '_builtin' => true124 //'public' => false, 125 //'_builtin' => false 123 126 ); 124 127 125 $public_and_builtin_posts = get_post_types( $args, 'names' );126 127 $args = array(128 'public' => false,129 '_builtin' => false130 );131 132 128 $custom_post_types = get_post_types( $args, 'names' ); 133 129 134 $wpbizplugins_cahb_post_types = array_merge( $public_and_builtin_posts, $custom_post_types ); 135 136 // Add Dashboard separately 137 $wpbizplugins_cahb_post_types['dashboard'] = 'dashboard'; 130 if( is_array( $custom_post_types ) ) $wpbizplugins_cahb_post_types = array_merge( $wpbizplugins_cahb_post_types, $custom_post_types ); 138 131 139 132 $wpbizplugins_cahb_post_types_array = array(); … … 162 155 'media_upload' => 'yes', 163 156 ), 164 array ( 165 'key' => 'autop', 166 'label' => __('Automatically add paragraph-tags', 'wpbizplugins-cahq'), 167 'name' => 'autop', 168 'type' => 'true_false', 169 'instructions' => __( 'Untick this if you\'re adding something in the help box that\'s not normal text or images. Leaving this marked will automatically output paragraph tags to your text, which you want if you\'re adding text and images, but usually not with other types of content.', 'wpbizplugins-cahb' ), 170 'message' => '', 171 'default_value' => 1, 172 173 ), 157 174 158 array ( 175 159 'key' => 'field_popup_or_not', … … 231 215 'choices' => $wpbizplugins_cahb_post_types_array, 232 216 'default_value' => 'post', 233 'allow_null' => 0,217 'allow_null' => 1, 234 218 'multiple' => 0, 235 219 ), … … 278 262 'instructions' => __('De-select this if you do not want to display extras like your e-mail, phone number and more in this help box.', 'wpbizplugins-cahq'), 279 263 'message' => '', 264 'default_value' => 0, 265 266 ), 267 268 array ( 269 'key' => 'autop', 270 'label' => __('Automatically add tags', 'wpbizplugins-cahq'), 271 'name' => 'autop', 272 'type' => 'true_false', 273 'instructions' => __( 'Untick this if you want the contents of this help box to be printed without any processing at all from WordPress. <strong>Normal users want this checked</strong>.', 'wpbizplugins-cahb' ), 274 'message' => '', 280 275 'default_value' => 1, 281 276 282 277 ), 278 283 279 array ( 284 280 'key' => 'field_bottom_message', … … 329 325 330 326 // Add the fields if we're in admin, and also make sure it loads last, to collect _all_ post types. 331 if( is_admin() ) add_action( ' init', 'wpbizplugins_cahb_load_custom_fields', 9999 );327 if( is_admin() ) add_action( 'admin_init', 'wpbizplugins_cahb_load_custom_fields', 9999 ); 332 328 333 329 /** -
wpbizplugins-custom-admin-help-boxes/trunk/inc/install.php
r966836 r971243 60 60 } 61 61 62 wp_reset_query(); 63 wp_reset_postdata(); 64 62 65 } -
wpbizplugins-custom-admin-help-boxes/trunk/readme.txt
r967819 r971243 2 2 Contributors: wpbizplugins 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=MF5MU4TNF3UDU&lc=SE&item_name=WPBizPlugins&item_number=Easy%20Admin%20Quick%20Menu¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted 4 Tags: admin, help box, help boxes, custom help, admin help, simplify wordpress, simple, wpbizplugins, clients, client work, widget, widgets, meta box, meta boxes, instructions, help, dashboard widgets, dashboard widget4 Tags: videos in admin, videos in dashboard, embed videos, admin, help box, help boxes, custom help, admin help, simplify wordpress, simple, wpbizplugins, clients, client work, widget, widgets, meta box, meta boxes, instructions, help, dashboard widgets, dashboard widget 5 5 Requires at least: 3.7 6 6 Tested up to: 3.9.2 7 Stable tag: 1. 2.27 Stable tag: 1.3.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 Tired of clients calling you to ask what to think about when creating blog posts? Tired answering the same questions again and again? Ever wish there was an easy way to just add your own instructions and help material to the WordPress help section?15 Tired of clients calling you to ask what to think about when creating blog posts? Tired answering the same questions again and again? Want to add your own help videos to the admin dashboard? Ever wish there was an easy way to just add your own instructions and help material to the WordPress help section? 16 16 17 17 Custom Admin Help Boxes lets you add instructions and help material to the admin section of WordPress, easily. With Custom Admin Help Boxes, you'll get an easy way of guiding your users or clients through adding posts, pages, custom posts and more. Just add a help box to your desired location(s) in the admin section, write your instructions, and publish! … … 20 20 21 21 * Easily add your own instructions and help material to the add/edit page of any post, page or custom post type 22 * Embed videos and other help material right on the dashboard 22 23 * Create widgets that shows beautifully right on the main dashboard easily 23 24 * Add videos, images, and text to your help boxes just like you would to a normal WordPress post or page … … 94 95 * Updated to latest ACF version. 95 96 97 = 1.3.0 = 98 * Added native support for automatically embedding any video URL (like WordPress does natively), plus automatically make the videos responsive. Yay! 99 * Most post types should now appear in the selection menu for display, without needing to enter them in the text field 100 * Major bugfix release 101 96 102 == Upgrade Notice == 97 103 -
wpbizplugins-custom-admin-help-boxes/trunk/wpbizplugins-custom-admin-help-boxes.php
r967819 r971243 4 4 Plugin URI: http://www.wpbizplugins.com?utm_source=cahb&utm_medium=plugin&utm_campaign=pluginuri 5 5 Description: Add your own custom help boxes to the admin section of WordPress. 6 Version: 1. 2.26 Version: 1.3.0 7 7 Author: Gabriel Nordeborn 8 8 Author URI: http://www.wpbizplugins.com?utm_source=cahb&utm_medium=plugin&utm_campaign=authoruri … … 76 76 77 77 add_action( 'init', 'wpbizplugins_cahb_init_plugin' ); 78 79 /** 80 * LOAD APPROPRIATE STYLES 81 * Load fitvids.js 82 * 83 */ 84 85 function wpbizplugins_cahb_enqueue_scripts() { 86 87 wp_register_script( 'fitvids', plugins_url( '/assets/fitvids.js', __FILE__ ), null, null, true ); 88 wp_enqueue_script( 'fitvids' ); 89 90 } 91 92 add_action( 'admin_enqueue_scripts', 'wpbizplugins_cahb_enqueue_scripts' ); 93 78 94 79 95 /** … … 169 185 170 186 echo '<div class="wpbizplugins-cahb-content">'; 171 if( ( $data[ 'autop' ] == "" ) || ( $data[ 'autop' ] == 1 ) ) echo wpautop( do_shortcode( $data['content'] ) ); else echo do_shortcode( $data[ 'content' ] ); 187 188 if( ( $data[ 'autop' ] == "" ) || ( $data[ 'autop' ] == 1 ) ) echo apply_filters( 'the_content', $data['content'] ); else echo $data['content']; 172 189 echo '</div>'; 173 190 … … 199 216 200 217 } 218 219 /** 220 * Print the fitVids fix 221 * 222 */ 223 224 function wpbizplugins_cahb_enable_fitvids_on_content() { 225 226 ?> 227 228 <script type="text/javascript"> 229 230 jQuery(document).ready(function(){ 231 // Target your .container, .wrapper, .post, etc. 232 jQuery(".wpbizplugins-cahb-content").fitVids(); 233 }); 234 235 </script> 236 237 <?php 238 239 } 240 241 add_action( 'admin_footer', 'wpbizplugins_cahb_enable_fitvids_on_content' );
Note: See TracChangeset
for help on using the changeset viewer.