Plugin Directory

Changeset 971243


Ignore:
Timestamp:
08/23/2014 08:42:50 AM (12 years ago)
Author:
wpbizplugins
Message:

A number of fixes.

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

Legend:

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

    r966836 r971243  
    9797    $args = array(
    9898   
    99         'post_type' => 'wpbizplugins-cahb'
     99        'post_type'         => 'wpbizplugins-cahb',
     100        'posts_per_page'    => -1
    100101       
    101102    );
     
    121122            $where_to_display_additional_array = explode(',', $where_to_display_additional );
    122123
    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 );
    124125
    125126            $content = get_post_meta( $help_box_id, 'content', true );
     
    172173    foreach( $metaboxes_array as $metabox ) {
    173174
    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                }
    197202
    198203            }
     
    218223    foreach( $metaboxes_array as $metabox ) {
    219224
    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                }
    242251
    243252            }
     
    332341    .wpbizplugins-cahb-button:hover {
    333342        background-color:#6aaaeb;
    334         color: #F6F6F6 !important;
     343        color: #F6F6F6;
    335344    }
    336345
    337346    .wpbizplugins-cahb-button:active {
    338         color: #F6F6F6 !important;
     347        color: #F6F6F6;
    339348    }
    340349
    341350    .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; }
    350359
    351360    ' . $wpbizplugins_cahb_options['custom_css'] );
  • wpbizplugins-custom-admin-help-boxes/trunk/inc/custom-posttypes.php

    r966836 r971243  
    117117    global $wpbizplugins_cahb_options;
    118118
    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
    120123    $args = array(
    121        'public'   => true,
    122        '_builtin' => true
     124       //'public'   => false,
     125       //'_builtin' => false
    123126    );
    124127
    125     $public_and_builtin_posts = get_post_types( $args, 'names' );
    126 
    127     $args = array(
    128        'public'   => false,
    129        '_builtin' => false
    130     );
    131 
    132128    $custom_post_types = get_post_types( $args, 'names' );
    133129
    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 );
    138131
    139132    $wpbizplugins_cahb_post_types_array = array();
     
    162155                    'media_upload' => 'yes',
    163156                ),
    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               
    174158                array (
    175159                    'key' => 'field_popup_or_not',
     
    231215                    'choices' => $wpbizplugins_cahb_post_types_array,
    232216                    'default_value' => 'post',
    233                     'allow_null' => 0,
     217                    'allow_null' => 1,
    234218                    'multiple' => 0,
    235219                ),
     
    278262                    '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'),
    279263                    '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' => '',
    280275                    'default_value' => 1,
    281276           
    282277                ),
     278
    283279                array (
    284280                    'key' => 'field_bottom_message',
     
    329325
    330326// 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 );
     327if( is_admin() ) add_action( 'admin_init', 'wpbizplugins_cahb_load_custom_fields', 9999 );
    332328
    333329/**
  • wpbizplugins-custom-admin-help-boxes/trunk/inc/install.php

    r966836 r971243  
    6060    }
    6161
     62    wp_reset_query();
     63    wp_reset_postdata();
     64
    6265}
  • wpbizplugins-custom-admin-help-boxes/trunk/readme.txt

    r967819 r971243  
    22Contributors: wpbizplugins
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=MF5MU4TNF3UDU&lc=SE&item_name=WPBizPlugins&item_number=Easy%20Admin%20Quick%20Menu&currency_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 widget
     4Tags: 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
    55Requires at least: 3.7
    66Tested up to: 3.9.2
    7 Stable tag: 1.2.2
     7Stable tag: 1.3.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    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?
     15Tired 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?
    1616
    1717Custom 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!
     
    2020
    2121* 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
    2223* Create widgets that shows beautifully right on the main dashboard easily
    2324* Add videos, images, and text to your help boxes just like you would to a normal WordPress post or page
     
    9495* Updated to latest ACF version.
    9596
     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
    96102== Upgrade Notice ==
    97103
  • wpbizplugins-custom-admin-help-boxes/trunk/wpbizplugins-custom-admin-help-boxes.php

    r967819 r971243  
    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.2.2
     6Version: 1.3.0
    77Author: Gabriel Nordeborn
    88Author URI: http://www.wpbizplugins.com?utm_source=cahb&utm_medium=plugin&utm_campaign=authoruri
     
    7676
    7777add_action( 'init', 'wpbizplugins_cahb_init_plugin' );
     78
     79/**
     80 * LOAD APPROPRIATE STYLES
     81 * Load fitvids.js
     82 *
     83 */
     84
     85function 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
     92add_action( 'admin_enqueue_scripts', 'wpbizplugins_cahb_enqueue_scripts' );
     93
    7894
    7995/**
     
    169185
    170186    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'];
    172189    echo '</div>';
    173190
     
    199216
    200217}
     218
     219/**
     220 * Print the fitVids fix
     221 *
     222 */
     223
     224function 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
     241add_action( 'admin_footer', 'wpbizplugins_cahb_enable_fitvids_on_content' );
Note: See TracChangeset for help on using the changeset viewer.