Making WordPress.org

Changeset 7354


Ignore:
Timestamp:
07/02/2018 12:47:04 PM (6 years ago)
Author:
netweb
Message:

Support Hub: Update Support Hub to latest changes via GitHub

References:

Props clorith, kenshino, netweb.
See #3485.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/class-helphub-codex-languages.php

    r7306 r7354  
    112112    public function codex_languages_func( $atts ) {
    113113        wp_enqueue_style( 'helphub-codex-languages-style', $this->plugin_url . 'assets/css/codex-languages.css', array(), '1.0.0' );
    114         $str = '<p class="language-links"><a href="https://codex.wordpress.org/Multilingual_Codex" title="Multilingual Codex" class="mw-redirect">Languages</a>: <strong class="selflink">English</strong>';
    115         $lang_table = array(
     114        $str              = '<p class="language-links"><a href="https://codex.wordpress.org/Multilingual_Codex" title="Multilingual Codex" class="mw-redirect">Languages</a>: <strong class="selflink">English</strong>';
     115        $lang_table       = array(
    116116            array( 'Arabic', 'العربية', 'ar_codex', 'https://codex.wordpress.org/ar:%1s' ),
    117117            array( 'Azerbaijani', 'Azərbaycanca', 'azr_codex', 'https://codex.wordpress.org/azr:%1s' ),
     
    171171        }
    172172        $args = shortcode_atts( $shortcode_params, $atts );
    173         $i = 0;
     173        $i    = 0;
    174174        foreach ( $args as $key => $value ) {
    175175            if ( null != $value ) {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/class-helphub-contributors-admin.php

    r7306 r7354  
    4747
    4848        $this->helphub_contributors = $helphub_contributors;
    49         $this->version = $version;
     49        $this->version              = $version;
    5050
    5151        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/class-helphub-contributors.php

    r7306 r7354  
    5353    public function __construct() {
    5454        $this->helphub_contributors = 'helphub-contributors';
    55         $this->version = '1.0.0';
     55        $this->version              = '1.0.0';
    5656        add_action( 'init', array( $this, 'set_locale' ) );
    5757        $this->required_dependencies();
     
    6868     */
    6969    public function set_locale() {
    70         load_plugin_textdomain( $this->get_helphub_contributors(), false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
     70        load_plugin_textdomain(
     71            $this->get_helphub_contributors(), false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
    7172        );
    7273    }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/class-helphub-contributors-public.php

    r7306 r7354  
    4646    public function __construct( $helphub_contributors, $version ) {
    4747        $this->helphub_contributors = $helphub_contributors;
    48         $this->version = $version;
     48        $this->version              = $version;
    4949        add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_scripts' ) );
    5050        add_filter( 'the_content', array( $this, 'show_contributors' ) );
     
    149149
    150150                        // Display message if no user is found with provided username.
     151                        /* translators: %s: Username, do not translate. */
    151152                        $contributors_items .= '<div class="contributor contributor-not-found"><p>' . sprintf( __( '%s is not a valid username.', 'wporg-forums' ), '<strong>' . $contributor . '</strong>' ) . '</p></div>';
    152153
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/class-support-helphub-front-page-blocks-widget.php

    r7306 r7354  
    5353        $save_instance = array();
    5454
    55         $save_instance['icon']  = ( ! empty( $new_instance['icon'] ) ? strip_tags( $new_instance['icon'] ) : '' );
    56         $save_instance['title'] = ( ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '' );
     55        $save_instance['icon']        = ( ! empty( $new_instance['icon'] ) ? strip_tags( $new_instance['icon'] ) : '' );
     56        $save_instance['title']       = ( ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '' );
    5757        $save_instance['description'] = ( ! empty( $new_instance['description'] ) ? strip_tags( $new_instance['description'] ) : '' );
    58         $save_instance['menu'] = ( ! empty( $new_instance['menu'] ) ? strip_tags( $new_instance['menu'] ) : '' );
     58        $save_instance['categoryid']  = ( ! empty( $new_instance['categoryid'] ) ? strip_tags( $new_instance['categoryid'] ) : '' );
     59        $save_instance['menu']        = ( ! empty( $new_instance['menu'] ) ? strip_tags( $new_instance['menu'] ) : '' );
    5960
    6061        return $save_instance;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-back-end.php

    r7306 r7354  
    3030
    3131<p>
     32    <label for="<?php echo esc_attr( $this->get_field_id( 'categoryid' ) ); ?>">
     33        <?php esc_html_e( 'Category link', 'wporg-forums' ); ?>
     34    </label>
     35    <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'categoryid' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'categoryid' ) ); ?>">
     36    <?php
     37    $categories = get_categories( array(
     38        'hide_empty' => 0,
     39    ) );
     40
     41    foreach ( $categories as $category ) {
     42        printf(
     43            '<option value="%s" %s>%s</option>',
     44            esc_attr( $category->term_id ),
     45            selected( $instance['categoryid'], $category->term_id ),
     46            esc_html( $category->name )
     47        );
     48    }
     49    ?>
     50    </select>
     51</p>
     52
     53<p>
    3254    <label for="<?php echo esc_attr( $this->get_field_id( 'menu' ) ); ?>">
    3355        <?php esc_html_e( 'Link menu', 'wporg-forums' ); ?>
     
    4163                '<option value="%s" %s>%s</option>',
    4264                esc_attr( $nav_menu->term_id ),
    43                 ( isset( $instance['menu'] ) && ! empty( $instance['menu'] ) && $nav_menu->term_id === $instance['menu'] ? 'selected="selected"' : '' ),
     65                selected( $instance['menu'], $nav_menu->term_id ),
    4466                esc_html( $nav_menu->name )
    4567            );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-front-end.php

    r7306 r7354  
    1313<div class="info-box">
    1414    <div class="icon-wrapper">
     15        <a href="<?php echo esc_url( get_category_link( $instance['categoryid'] ) ); ?>">
    1516        <?php if ( stristr( $instance['icon'], '.' ) ) : ?>
    1617            <img src="<?php echo esc_url( $instance['icon'] ); ?>" width="108" alt="">
    1718        <?php else : ?>
    18             <span class="dashicons
    19             <?php echo esc_attr( $instance['icon'] ); ?>
    20             "></span>
     19            <span class="dashicons <?php echo esc_attr( $instance['icon'] ); ?>"></span>
    2120        <?php endif; ?>
     21        </a>
    2222    </div>
    23     <h3><?php echo esc_html( $instance['title'] ); ?></h3>
     23    <a href="<?php echo esc_url( get_category_link( $instance['categoryid'] ) ); ?>">
     24        <h3><?php echo esc_html( $instance['title'] ); ?></h3>
     25    </a>
    2426    <p><?php echo esc_html( $instance['description'] ); ?></p>
    25 
    2627    <ul class="meta-list">
    2728        <?php
     
    3637        ?>
    3738    </ul>
    38 
    3939</div>
    40 
    4140
    4241<?php
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-post-type.php

    r7306 r7354  
    9999
    100100            if ( 'edit.php' === $pagenow && isset( $_GET['post_type'] ) && $this->post_type === $_GET['post_type'] ) { // WPCS: input var ok; CSRF ok.
    101                 add_filter( 'manage_edit-' . $this->post_type . '_columns', array(
    102                     $this,
    103                     'register_custom_column_headings',
    104                 ), 10, 1 );
     101                add_filter(
     102                    'manage_edit-' . $this->post_type . '_columns', array(
     103                        $this,
     104                        'register_custom_column_headings',
     105                    ), 10, 1
     106                );
    105107                add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
    106108            }
     
    301303    public function meta_box_setup() {
    302304        if ( 'post' === $this->post_type ) {
    303             add_meta_box( $this->post_type . '-display', __( 'Display Settings', 'wporg-forums' ), array(
    304                 $this,
    305                 'meta_box_content',
    306             ), $this->post_type, 'normal', 'high' );
     305            add_meta_box(
     306                $this->post_type . '-display', __( 'Display Settings', 'wporg-forums' ), array(
     307                    $this,
     308                    'meta_box_content',
     309                ), $this->post_type, 'normal', 'high'
     310            );
    307311        } elseif ( 'helphub_version' === $this->post_type ) {
    308             add_meta_box( $this->post_type . '-version-meta', __( 'Display Settings', 'wporg-forums' ), array(
    309                 $this,
    310                 'meta_box_version_content',
    311             ), $this->post_type, 'normal', 'high' );
     312            add_meta_box(
     313                $this->post_type . '-version-meta', __( 'Display Settings', 'wporg-forums' ), array(
     314                    $this,
     315                    'meta_box_version_content',
     316                ), $this->post_type, 'normal', 'high'
     317            );
    312318        }
    313319    } // End meta_box_setup()
     
    370376                    case 'hidden':
    371377                        $field = '<input name="' . esc_attr( $k ) . '" type="hidden" id="' . esc_attr( $k ) . '" value="' . esc_attr( $data ) . '" />';
    372                         $html  .= '<tr valign="top">' . $field . "\n";
    373                         $html  .= '</tr>' . "\n";
     378                        $html .= '<tr valign="top">' . $field . "\n";
     379                        $html .= '</tr>' . "\n";
    374380                        break;
    375381                    case 'text':
    376382                    case 'url':
    377383                        $field = '<input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="regular-text" value="' . esc_attr( $data ) . '" />';
    378                         $html  .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
     384                        $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
    379385                        if ( isset( $v['description'] ) ) {
    380386                            $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
     
    384390                    case 'textarea':
    385391                        $field = '<textarea name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" class="large-text">' . esc_attr( $data ) . '</textarea>';
    386                         $html  .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
     392                        $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
    387393                        if ( isset( $v['description'] ) ) {
    388394                            $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
     
    392398                    case 'editor':
    393399                        ob_start();
    394                         wp_editor( $data, $k, array(
    395                             'media_buttons' => false,
    396                             'textarea_rows' => 10,
    397                         ) );
     400                        wp_editor(
     401                            $data, $k, array(
     402                                'media_buttons' => false,
     403                                'textarea_rows' => 10,
     404                            )
     405                        );
    398406                        $field = ob_get_contents();
    399407                        ob_end_clean();
     
    416424                        }
    417425
    418                         $field = '<input name="' . esc_attr( $k ) . '" type="file" id="' . esc_attr( $k ) . '" class="regular-text helphub-upload-field" />';
     426                        $field  = '<input name="' . esc_attr( $k ) . '" type="file" id="' . esc_attr( $k ) . '" class="regular-text helphub-upload-field" />';
    419427                        $field .= '<button id="' . esc_attr( $k ) . '" class="helphub-upload button" ' . $data_atts . '>' . $v['label'] . '</button>';
    420428                        $html  .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
     
    477485                        }
    478486                        $field = '<input name="' . esc_attr( $k ) . '" type="date" id="' . esc_attr( $k ) . '" class="helphub-meta-date" value="' . esc_attr( date_i18n( 'F d, Y', $data ) ) . '" />';
    479                         $html  .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
     487                        $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
    480488                        if ( isset( $v['description'] ) ) {
    481489                            $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-taxonomy.php

    r7306 r7354  
    8181    public function __construct( $post_type = array(), $token = 'thing-category', $singular = '', $plural = '', $args = array() ) {
    8282        $this->post_type = $post_type;
    83         $this->token = esc_attr( $token );
    84         $this->singular = esc_html( $singular );
    85         $this->plural = esc_html( $plural );
     83        $this->token     = esc_attr( $token );
     84        $this->singular  = esc_html( $singular );
     85        $this->plural    = esc_html( $plural );
    8686
    8787        if ( '' === $this->singular ) {
     
    106106    private function _get_default_args() {
    107107        return array(
    108             'labels'                => $this->_get_default_labels(),
    109             'public'                => true,
    110             'hierarchical'          => true,
    111             'show_ui'               => true,
    112             'show_admin_column'     => true,
    113             'query_var'             => true,
    114             'show_in_nav_menus'     => false,
    115             'show_tagcloud'         => false,
    116             'rewrite'               => array(
     108            'labels'            => $this->_get_default_labels(),
     109            'public'            => true,
     110            'hierarchical'      => true,
     111            'show_ui'           => true,
     112            'show_admin_column' => true,
     113            'query_var'         => true,
     114            'show_in_nav_menus' => false,
     115            'show_tagcloud'     => false,
     116            'rewrite'           => array(
    117117                'slug' => str_replace( 'helphub_', '', esc_attr( $this->token ) ),
    118118            ),
     
    131131            'name'                => sprintf( _x( '%s', 'taxonomy general name', 'wporg-forums' ), $this->plural ), /* @codingStandardsIgnoreLine */
    132132            'singular_name'       => sprintf( _x( '%s', 'taxonomy singular name', 'wporg-forums' ), $this->singular ), /* @codingStandardsIgnoreLine */
    133             'search_items'        => sprintf( __( 'Search %s', 'wporg-forums' ), $this->plural ),
     133            /* translators: %s: Plural of the search label. */
     134            'search_items'      => sprintf( __( 'Search %s', 'wporg-forums' ), $this->plural ),
    134135            /* translators: %s: Plural name of the post type. */
    135             'all_items'           => sprintf( __( 'All %s', 'wporg-forums' ), $this->plural ),
     136            'all_items'         => sprintf( __( 'All %s', 'wporg-forums' ), $this->plural ),
    136137            /* translators: %s: Post type name. */
    137             'parent_item'         => sprintf( __( 'Parent %s', 'wporg-forums' ), $this->singular ),
     138            'parent_item'       => sprintf( __( 'Parent %s', 'wporg-forums' ), $this->singular ),
    138139            /* translators: %s: Post type name. */
    139             'parent_item_colon'   => sprintf( __( 'Parent %s:', 'wporg-forums' ), $this->singular ),
     140            'parent_item_colon' => sprintf( __( 'Parent %s:', 'wporg-forums' ), $this->singular ),
    140141            /* translators: %s: Post type name. */
    141             'edit_item'           => sprintf( __( 'Edit %s', 'wporg-forums' ), $this->singular ),
     142            'edit_item'         => sprintf( __( 'Edit %s', 'wporg-forums' ), $this->singular ),
    142143            /* translators: %s: Post type name. */
    143             'update_item'         => sprintf( __( 'Update %s', 'wporg-forums' ), $this->singular ),
     144            'update_item'       => sprintf( __( 'Update %s', 'wporg-forums' ), $this->singular ),
    144145            /* translators: %s: Post type name. */
    145             'add_new_item'        => sprintf( __( 'Add New %s', 'wporg-forums' ), $this->singular ),
     146            'add_new_item'      => sprintf( __( 'Add New %s', 'wporg-forums' ), $this->singular ),
    146147            /* translators: %s: Post type name. */
    147             'new_item_name'       => sprintf( __( 'New %s Name', 'wporg-forums' ), $this->singular ),
    148             'menu_name'           => $this->plural,
     148            'new_item_name'     => sprintf( __( 'New %s Name', 'wporg-forums' ), $this->singular ),
     149            'menu_name'         => $this->plural,
    149150        );
    150151    } // End _get_default_labels()
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types.php

    r7306 r7354  
    127127        require_once( dirname( __FILE__ ) . '/class-helphub-post-types-taxonomy.php' );
    128128
    129         $this->post_types['post']               = new HelpHub_Post_Types_Post_Type( 'post', __( 'Post', 'wporg-forums' ), __( 'Posts', 'wporg-forums' ), array(
    130             'menu_icon' => 'dashicons-post',
    131         ) );
    132         $this->post_types['helphub_article']    = new HelpHub_Post_Types_Post_Type( 'helphub_article', __( 'Article', 'wporg-forums' ), __( 'Articles', 'wporg-forums' ), array(
    133             'menu_icon' => 'dashicons-media-document',
    134         ) );
    135         $this->post_types['helphub_version']    = new HelpHub_Post_Types_Post_Type( 'helphub_version', __( 'WordPress Version', 'wporg-forums' ), __( 'WordPress Versions', 'wporg-forums' ), array(
    136             'menu_icon' => 'dashicons-wordpress',
    137         ) );
     129        $this->post_types['post']            = new HelpHub_Post_Types_Post_Type(
     130            'post', __( 'Post', 'wporg-forums' ), __( 'Posts', 'wporg-forums' ), array(
     131                'menu_icon' => 'dashicons-post',
     132            )
     133        );
     134        $this->post_types['helphub_article'] = new HelpHub_Post_Types_Post_Type(
     135            'helphub_article', __( 'Article', 'wporg-forums' ), __( 'Articles', 'wporg-forums' ), array(
     136                'menu_icon' => 'dashicons-media-document',
     137            )
     138        );
     139        $this->post_types['helphub_version'] = new HelpHub_Post_Types_Post_Type(
     140            'helphub_version', __( 'WordPress Version', 'wporg-forums' ), __( 'WordPress Versions', 'wporg-forums' ), array(
     141                'menu_icon' => 'dashicons-wordpress',
     142            )
     143        );
    138144
    139145        /* Post Types - End */
     
    174180     * Load the localisation file.
    175181     *
    176      * @access  public
    177      * @since   1.0.0
     182     * @access public
     183     * @since 1.0.0
    178184     */
    179185    public function load_plugin_textdomain() {
     
    182188
    183189    /**
    184     * Make sure category archive actually loads
    185     *
    186     * @access public
    187     * @since  1.1.0
    188     */
     190     * Make sure category archive actually loads
     191     *
     192     * @access public
     193     * @since 1.1.0
     194     */
    189195    public function fix_archive_category( WP_Query $query ) {
    190196        if ( ! is_admin() && is_category() && $query->is_main_query() ) {
     
    197203     *
    198204     * @access public
    199      * @since   1.0.0
    200      * @return   void
     205     * @since 1.0.0
     206     * @return void
    201207     */
    202208    public function enqueue_admin_styles() {
     
    213219            endif;
    214220        endif;
    215         wp_localize_script( 'helphub-post-types-admin', 'HelphubAdmin',
     221        wp_localize_script(
     222            'helphub-post-types-admin', 'HelphubAdmin',
    216223            array(
    217224                'default_title'  => __( 'Upload', 'wporg-forums' ),
     
    220227        );
    221228
    222         wp_localize_script( 'helphub-post-types-gallery', 'HelphubGallery',
     229        wp_localize_script(
     230            'helphub-post-types-gallery', 'HelphubGallery',
    223231            array(
    224232                'gallery_title'  => __( 'Add Images to Product Gallery', 'wporg-forums' ),
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php

    r7306 r7354  
    223223    public function add_toc( $content ) {
    224224
     225        if ( ! is_singular() ) {
     226            return $content;
     227        }
     228
    225229        $toc = '';
    226230
     
    236240        if ( $items ) {
    237241            $contents_header = sprintf( 'h%s', $items[0][2] );
    238             $toc .= '<div class="table-of-contents">';
    239             $toc .= '<h2 class="toc-title">' . __( 'Topics', 'wporg-forums' ) . '</h2>';
    240             $toc .= '<ul class="items">';
    241             $last_item = false;
     242            $toc            .= '<div class="table-of-contents">';
     243            $toc            .= '<h2 class="toc-title">' . __( 'Topics', 'wporg-forums' ) . '</h2>';
     244            $toc            .= '<ul class="items">';
     245            $last_item       = false;
    242246            foreach ( $items as $item ) {
    243247                if ( $last_item ) {
     
    251255                }
    252256                $last_item = $item[2];
    253                 $toc       .= sprintf( '<li><a href="#%1s">%2s</a>', sanitize_title_with_dashes( $item[3] ), $item[3] );
     257                $toc      .= sprintf( '<li><a href="#%1s">%2s</a>', sanitize_title_with_dashes( $item[3] ), $item[3] );
    254258            }
    255259            $toc .= '</ul></div>';
Note: See TracChangeset for help on using the changeset viewer.