black-studio / black-studio-tinymce-widget

Black Studio TinyMCE Widget plugin for WordPress
https://wordpress.org/plugins/black-studio-tinymce-widget/
GNU General Public License v3.0
22 stars 13 forks source link

Contribution ideas #25

Closed cfoellmann closed 9 years ago

cfoellmann commented 9 years ago

I have a few docs related "ideas" I would like to pitch to you. What do you think about these? If you like it I can send you PRs.


Comment indicating endings like:

<?php
/* Enqueue footer scripts */
public function admin_print_footer_scripts() {
    wp_editor( '', 'black-studio-tinymce-widget' );
} // END admin_print_footer_scripts()

Extended DocBlock documentation for functions (NetBeans detects a lot of this stuff). Like:

<?php
/**
 * TinyMCE setup customization
 * 
 * @param array $settings
 * @return array
 */
public function tiny_mce_before_init( $settings ) {
    $custom_settings = array(
        'remove_linebreaks' => false,
        'convert_newlines_to_brs' => false,
        'force_p_newlines' => true,
        'force_br_newlines' => false,
        'remove_redundant_brs' => false,
        'forced_root_block' => 'p',
        'apply_source_formatting ' => true,
        'indent' => true,
    );
    // Return modified settings
    return array_merge( $settings, $custom_settings );
}
marcochiesi commented 9 years ago

They're both good ideas. In particular I like the inline DocBlocks. As for comments indicating endings I think they're useful especially when there are big blocks of code or multiple levels of nested code. After the recent refactor there should be no more such big chunks of code difficult to be read, so probably the ending comments wouldn't be so much useful as they would have been before. Anyway I am not against them, so if you'll take the time to add them, I will merge. Thank you.

marcochiesi commented 9 years ago

Completed with 4241417731538ad96c4184a342929d4037e971f5. Thank you!