Plugin Directory

Changeset 966836


Ignore:
Timestamp:
08/16/2014 08:37:06 AM (12 years ago)
Author:
wpbizplugins
Message:

Version 1.2.0. New feature + minor bugfix.

Location:
wpbizplugins-custom-admin-help-boxes/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wpbizplugins-custom-admin-help-boxes/trunk/inc/custom-functions.php

    r923677 r966836  
    130130            $popup_button_text = get_post_meta( $help_box_id, 'popup_button_text', true );
    131131            $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 );
    132133
    133134            $metaboxes_array[] = array(
     
    143144                'use_popup'                 => $use_popup,
    144145                '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
    146148
    147149            );
     
    151153
    152154    return $metaboxes_array;
     155
     156    wp_reset_postdata();
     157    wp_reset_query();
    153158}
    154159
     
    170175
    171176            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
     216function 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 != '' ) ) {
    172223
    173224                add_meta_box(
     
    184235                        'use_popup'                 => $metabox['use_popup'],
    185236                        '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' ]
    188239                    )
    189240
     
    199250
    200251/**
    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.0
    207  *
    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 /**
    245252 * Print the CSS style for the buttons.
    246253 *
     
    251258    global $wpbizplugins_cahb_options;
    252259
    253     echo '<style type="text/css">
     260    echo '<style type="text/css">';
     261
     262    echo wpbizplugins_cahb_minify_css( '
    254263
    255264    .wpbizplugins-cahb-content {
     
    340349    .btn-orange:hover { background-color:#BF884B !important; }
    341350
    342     ' . $wpbizplugins_cahb_options['custom_css'] . '
    343 
    344     </style>
    345     ';
     351    ' . $wpbizplugins_cahb_options['custom_css'] );
     352
     353    echo '</style>';
    346354
    347355    unset( $wpbizplugins_cahb_options );
     
    350358
    351359add_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
     370function 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
    352385
    353386/**
  • wpbizplugins-custom-admin-help-boxes/trunk/inc/custom-posttypes.php

    r925025 r966836  
    163163                ),
    164164                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 (
    165175                    'key' => 'field_popup_or_not',
    166176                    'label' => __('Popup', 'wpbizplugins-cahq'),
  • wpbizplugins-custom-admin-help-boxes/trunk/inc/install.php

    r918638 r966836  
    5656        add_post_meta( $default_button, 'show_extras', 1 );
    5757        add_post_meta( $default_button, 'use_popup', 0 );
     58        add_post_meta( $default_button, 'autop', 1 );
    5859
    5960    }
  • wpbizplugins-custom-admin-help-boxes/trunk/readme.txt

    r925025 r966836  
    44Tags: 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
    55Requires at least: 3.7
    6 Tested up to: 3.9.1
    7 Stable tag: 1.1.2
     6Tested up to: 3.9.2
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8484* Fixed bug that occasionally caused plugin to hijack the custom update/save messages for custom post types.
    8585
     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
    8690== Upgrade Notice ==
    8791
  • wpbizplugins-custom-admin-help-boxes/trunk/wpbizplugins-custom-admin-help-boxes.php

    r925025 r966836  
    44Plugin URI: http://www.wpbizplugins.com?utm_source=cahb&utm_medium=plugin&utm_campaign=pluginuri
    55Description: Add your own custom help boxes to the admin section of WordPress.
    6 Version: 1.1.2
     6Version: 1.2.0
    77Author: Gabriel Nordeborn
    88Author URI: http://www.wpbizplugins.com?utm_source=cahb&utm_medium=plugin&utm_campaign=authoruri
     
    169169
    170170    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' ] );
    172172    echo '</div>';
    173173
Note: See TracChangeset for help on using the changeset viewer.