Changeset 7354
- Timestamp:
- 07/02/2018 12:47:04 PM (6 years ago)
- 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 112 112 public function codex_languages_func( $atts ) { 113 113 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( 116 116 array( 'Arabic', 'العربية', 'ar_codex', 'https://codex.wordpress.org/ar:%1s' ), 117 117 array( 'Azerbaijani', 'Azərbaycanca', 'azr_codex', 'https://codex.wordpress.org/azr:%1s' ), … … 171 171 } 172 172 $args = shortcode_atts( $shortcode_params, $atts ); 173 $i = 0;173 $i = 0; 174 174 foreach ( $args as $key => $value ) { 175 175 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 47 47 48 48 $this->helphub_contributors = $helphub_contributors; 49 $this->version = $version;49 $this->version = $version; 50 50 51 51 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 53 53 public function __construct() { 54 54 $this->helphub_contributors = 'helphub-contributors'; 55 $this->version = '1.0.0';55 $this->version = '1.0.0'; 56 56 add_action( 'init', array( $this, 'set_locale' ) ); 57 57 $this->required_dependencies(); … … 68 68 */ 69 69 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/' 71 72 ); 72 73 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/class-helphub-contributors-public.php
r7306 r7354 46 46 public function __construct( $helphub_contributors, $version ) { 47 47 $this->helphub_contributors = $helphub_contributors; 48 $this->version = $version;48 $this->version = $version; 49 49 add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_scripts' ) ); 50 50 add_filter( 'the_content', array( $this, 'show_contributors' ) ); … … 149 149 150 150 // Display message if no user is found with provided username. 151 /* translators: %s: Username, do not translate. */ 151 152 $contributors_items .= '<div class="contributor contributor-not-found"><p>' . sprintf( __( '%s is not a valid username.', 'wporg-forums' ), '<strong>' . $contributor . '</strong>' ) . '</p></div>'; 152 153 -
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 53 53 $save_instance = array(); 54 54 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'] ) : '' ); 57 57 $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'] ) : '' ); 59 60 60 61 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 30 30 31 31 <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> 32 54 <label for="<?php echo esc_attr( $this->get_field_id( 'menu' ) ); ?>"> 33 55 <?php esc_html_e( 'Link menu', 'wporg-forums' ); ?> … … 41 63 '<option value="%s" %s>%s</option>', 42 64 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 ), 44 66 esc_html( $nav_menu->name ) 45 67 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-front-end.php
r7306 r7354 13 13 <div class="info-box"> 14 14 <div class="icon-wrapper"> 15 <a href="<?php echo esc_url( get_category_link( $instance['categoryid'] ) ); ?>"> 15 16 <?php if ( stristr( $instance['icon'], '.' ) ) : ?> 16 17 <img src="<?php echo esc_url( $instance['icon'] ); ?>" width="108" alt=""> 17 18 <?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> 21 20 <?php endif; ?> 21 </a> 22 22 </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> 24 26 <p><?php echo esc_html( $instance['description'] ); ?></p> 25 26 27 <ul class="meta-list"> 27 28 <?php … … 36 37 ?> 37 38 </ul> 38 39 39 </div> 40 41 40 42 41 <?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 99 99 100 100 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 ); 105 107 add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 ); 106 108 } … … 301 303 public function meta_box_setup() { 302 304 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 ); 307 311 } 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 ); 312 318 } 313 319 } // End meta_box_setup() … … 370 376 case 'hidden': 371 377 $field = '<input name="' . esc_attr( $k ) . '" type="hidden" id="' . esc_attr( $k ) . '" value="' . esc_attr( $data ) . '" />'; 372 $html 373 $html 378 $html .= '<tr valign="top">' . $field . "\n"; 379 $html .= '</tr>' . "\n"; 374 380 break; 375 381 case 'text': 376 382 case 'url': 377 383 $field = '<input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="regular-text" value="' . esc_attr( $data ) . '" />'; 378 $html 384 $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n"; 379 385 if ( isset( $v['description'] ) ) { 380 386 $html .= '<p class="description">' . $v['description'] . '</p>' . "\n"; … … 384 390 case 'textarea': 385 391 $field = '<textarea name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" class="large-text">' . esc_attr( $data ) . '</textarea>'; 386 $html 392 $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n"; 387 393 if ( isset( $v['description'] ) ) { 388 394 $html .= '<p class="description">' . $v['description'] . '</p>' . "\n"; … … 392 398 case 'editor': 393 399 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 ); 398 406 $field = ob_get_contents(); 399 407 ob_end_clean(); … … 416 424 } 417 425 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" />'; 419 427 $field .= '<button id="' . esc_attr( $k ) . '" class="helphub-upload button" ' . $data_atts . '>' . $v['label'] . '</button>'; 420 428 $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n"; … … 477 485 } 478 486 $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 487 $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n"; 480 488 if ( isset( $v['description'] ) ) { 481 489 $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 81 81 public function __construct( $post_type = array(), $token = 'thing-category', $singular = '', $plural = '', $args = array() ) { 82 82 $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 ); 86 86 87 87 if ( '' === $this->singular ) { … … 106 106 private function _get_default_args() { 107 107 return array( 108 'labels' 109 'public' 110 'hierarchical' 111 'show_ui' 112 'show_admin_column' 113 'query_var' 114 'show_in_nav_menus' 115 'show_tagcloud' 116 'rewrite' 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( 117 117 'slug' => str_replace( 'helphub_', '', esc_attr( $this->token ) ), 118 118 ), … … 131 131 'name' => sprintf( _x( '%s', 'taxonomy general name', 'wporg-forums' ), $this->plural ), /* @codingStandardsIgnoreLine */ 132 132 '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 ), 134 135 /* translators: %s: Plural name of the post type. */ 135 'all_items' 136 'all_items' => sprintf( __( 'All %s', 'wporg-forums' ), $this->plural ), 136 137 /* translators: %s: Post type name. */ 137 'parent_item' 138 'parent_item' => sprintf( __( 'Parent %s', 'wporg-forums' ), $this->singular ), 138 139 /* translators: %s: Post type name. */ 139 'parent_item_colon' 140 'parent_item_colon' => sprintf( __( 'Parent %s:', 'wporg-forums' ), $this->singular ), 140 141 /* translators: %s: Post type name. */ 141 'edit_item' 142 'edit_item' => sprintf( __( 'Edit %s', 'wporg-forums' ), $this->singular ), 142 143 /* translators: %s: Post type name. */ 143 'update_item' 144 'update_item' => sprintf( __( 'Update %s', 'wporg-forums' ), $this->singular ), 144 145 /* translators: %s: Post type name. */ 145 'add_new_item' 146 'add_new_item' => sprintf( __( 'Add New %s', 'wporg-forums' ), $this->singular ), 146 147 /* translators: %s: Post type name. */ 147 'new_item_name' 148 'menu_name' 148 'new_item_name' => sprintf( __( 'New %s Name', 'wporg-forums' ), $this->singular ), 149 'menu_name' => $this->plural, 149 150 ); 150 151 } // 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 127 127 require_once( dirname( __FILE__ ) . '/class-helphub-post-types-taxonomy.php' ); 128 128 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 ); 138 144 139 145 /* Post Types - End */ … … 174 180 * Load the localisation file. 175 181 * 176 * @access 177 * @since 182 * @access public 183 * @since 1.0.0 178 184 */ 179 185 public function load_plugin_textdomain() { … … 182 188 183 189 /** 184 * Make sure category archive actually loads185 *186 * @accesspublic187 * @since1.1.0188 */190 * Make sure category archive actually loads 191 * 192 * @access public 193 * @since 1.1.0 194 */ 189 195 public function fix_archive_category( WP_Query $query ) { 190 196 if ( ! is_admin() && is_category() && $query->is_main_query() ) { … … 197 203 * 198 204 * @access public 199 * @since 200 * @return 205 * @since 1.0.0 206 * @return void 201 207 */ 202 208 public function enqueue_admin_styles() { … … 213 219 endif; 214 220 endif; 215 wp_localize_script( 'helphub-post-types-admin', 'HelphubAdmin', 221 wp_localize_script( 222 'helphub-post-types-admin', 'HelphubAdmin', 216 223 array( 217 224 'default_title' => __( 'Upload', 'wporg-forums' ), … … 220 227 ); 221 228 222 wp_localize_script( 'helphub-post-types-gallery', 'HelphubGallery', 229 wp_localize_script( 230 'helphub-post-types-gallery', 'HelphubGallery', 223 231 array( 224 232 '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 223 223 public function add_toc( $content ) { 224 224 225 if ( ! is_singular() ) { 226 return $content; 227 } 228 225 229 $toc = ''; 226 230 … … 236 240 if ( $items ) { 237 241 $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; 242 246 foreach ( $items as $item ) { 243 247 if ( $last_item ) { … … 251 255 } 252 256 $last_item = $item[2]; 253 $toc 257 $toc .= sprintf( '<li><a href="#%1s">%2s</a>', sanitize_title_with_dashes( $item[3] ), $item[3] ); 254 258 } 255 259 $toc .= '</ul></div>';
Note: See TracChangeset
for help on using the changeset viewer.