Changeset 966836
- Timestamp:
- 08/16/2014 08:37:06 AM (12 years ago)
- Location:
- wpbizplugins-custom-admin-help-boxes/trunk
- Files:
-
- 5 edited
-
inc/custom-functions.php (modified) (9 diffs)
-
inc/custom-posttypes.php (modified) (1 diff)
-
inc/install.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
wpbizplugins-custom-admin-help-boxes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpbizplugins-custom-admin-help-boxes/trunk/inc/custom-functions.php
r923677 r966836 130 130 $popup_button_text = get_post_meta( $help_box_id, 'popup_button_text', true ); 131 131 $popup_button_text_before = get_post_meta( $help_box_id, 'popup_button_text_before', true ); 132 $autop = get_post_meta( $help_box_id, 'autop', true ); 132 133 133 134 $metaboxes_array[] = array( … … 143 144 'use_popup' => $use_popup, 144 145 'popup_button_text' => $popup_button_text, 145 'popup_button_text_before' => $popup_button_text_before 146 'popup_button_text_before' => $popup_button_text_before, 147 'autop' => $autop 146 148 147 149 ); … … 151 153 152 154 return $metaboxes_array; 155 156 wp_reset_postdata(); 157 wp_reset_query(); 153 158 } 154 159 … … 170 175 171 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 ); 197 198 } 199 200 } 201 202 } 203 204 } 205 206 /** 207 * 208 * Function to register dashboard widgets in the correct hooks. 209 * 210 * @param array All the dashboard widgets, in an array. 211 * @return null Returns nothing. 212 * @since 1.0 213 * 214 */ 215 216 function wpbizplugins_cahb_register_dashboard_widgets( $metaboxes_array ) { 217 218 foreach( $metaboxes_array as $metabox ) { 219 220 foreach( $metabox['where_to_display'] as $where_to_display ) { 221 222 if( ( $where_to_display == 'dashboard' ) && ( $where_to_display != '' ) ) { 172 223 173 224 add_meta_box( … … 184 235 'use_popup' => $metabox['use_popup'], 185 236 'popup_button_text' => $metabox['popup_button_text'], 186 'popup_button_text_before' => $metabox['popup_button_text_before'] 187 237 'popup_button_text_before' => $metabox['popup_button_text_before'], 238 'autop' => $metabox[ 'autop' ] 188 239 ) 189 240 … … 199 250 200 251 /** 201 *202 * Function to register dashboard widgets in the correct hooks.203 *204 * @param array All the dashboard widgets, in an array.205 * @return null Returns nothing.206 * @since 1.0207 *208 */209 210 function wpbizplugins_cahb_register_dashboard_widgets( $metaboxes_array ) {211 212 foreach( $metaboxes_array as $metabox ) {213 214 foreach( $metabox['where_to_display'] as $where_to_display ) {215 216 if( ( $where_to_display == 'dashboard' ) && ( $where_to_display != '' ) ) {217 218 add_meta_box(219 220 $metabox['html_id'],221 $metabox['title'],222 $metabox['callback'],223 $where_to_display,224 $metabox['context'],225 $metabox['priority'],226 array(227 'content' => $metabox['content'],228 'show_extras' => $metabox['show_extras'],229 'use_popup' => $metabox['use_popup'],230 'popup_button_text' => $metabox['popup_button_text'],231 'popup_button_text_before' => $metabox['popup_button_text_before']232 )233 234 );235 236 }237 238 }239 240 }241 242 }243 244 /**245 252 * Print the CSS style for the buttons. 246 253 * … … 251 258 global $wpbizplugins_cahb_options; 252 259 253 echo '<style type="text/css"> 260 echo '<style type="text/css">'; 261 262 echo wpbizplugins_cahb_minify_css( ' 254 263 255 264 .wpbizplugins-cahb-content { … … 340 349 .btn-orange:hover { background-color:#BF884B !important; } 341 350 342 ' . $wpbizplugins_cahb_options['custom_css'] . ' 343 344 </style> 345 '; 351 ' . $wpbizplugins_cahb_options['custom_css'] ); 352 353 echo '</style>'; 346 354 347 355 unset( $wpbizplugins_cahb_options ); … … 350 358 351 359 add_action( 'admin_head', 'wpbizplugins_cahb_print_plugin_styles' ); 360 361 /** 362 * Minifies CSS somewhat. 363 * 364 * @param string $css The CSS. 365 * @return string The minified CSS. 366 * @since 1.0 367 * 368 */ 369 370 function wpbizplugins_cahb_minify_css( $css ) { 371 372 // Remove comments 373 $css = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css); 374 375 // Remove space after colons 376 $css = str_replace(': ', ':', $css); 377 378 // Remove whitespace 379 $css = str_replace(array("\r\n", "\r", "\n", "\t", '', '', ''), '', $css); 380 381 return $css; 382 383 } 384 352 385 353 386 /** -
wpbizplugins-custom-admin-help-boxes/trunk/inc/custom-posttypes.php
r925025 r966836 163 163 ), 164 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 ), 174 array ( 165 175 'key' => 'field_popup_or_not', 166 176 'label' => __('Popup', 'wpbizplugins-cahq'), -
wpbizplugins-custom-admin-help-boxes/trunk/inc/install.php
r918638 r966836 56 56 add_post_meta( $default_button, 'show_extras', 1 ); 57 57 add_post_meta( $default_button, 'use_popup', 0 ); 58 add_post_meta( $default_button, 'autop', 1 ); 58 59 59 60 } -
wpbizplugins-custom-admin-help-boxes/trunk/readme.txt
r925025 r966836 4 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 widget 5 5 Requires at least: 3.7 6 Tested up to: 3.9. 17 Stable tag: 1. 1.26 Tested up to: 3.9.2 7 Stable tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 84 84 * Fixed bug that occasionally caused plugin to hijack the custom update/save messages for custom post types. 85 85 86 = 1.2.0 = 87 * New feature: Turn off automatic adding of <p>-tags. For compability with some other plugins. 88 * Minifying CSS in admin. Makes it look less crappy in the source. 89 86 90 == Upgrade Notice == 87 91 -
wpbizplugins-custom-admin-help-boxes/trunk/wpbizplugins-custom-admin-help-boxes.php
r925025 r966836 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. 1.26 Version: 1.2.0 7 7 Author: Gabriel Nordeborn 8 8 Author URI: http://www.wpbizplugins.com?utm_source=cahb&utm_medium=plugin&utm_campaign=authoruri … … 169 169 170 170 echo '<div class="wpbizplugins-cahb-content">'; 171 echo wpautop( do_shortcode( $data['content'] ));171 if( $data[ 'autop' ] == 1 ) echo wpautop( do_shortcode( $data['content'] ) ); else echo do_shortcode( $data[ 'content' ] ); 172 172 echo '</div>'; 173 173
Note: See TracChangeset
for help on using the changeset viewer.