Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 10 additions & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function( grunt ) {
pkg: grunt.file.readJSON( 'package.json' ),
checktextdomain: {
options: {
text_domain: 'helphub',
text_domain: 'wporg-forums',
correct_domain: false,
keywords: [
'__:1,2d',
Expand All @@ -52,7 +52,8 @@ module.exports = function( grunt ) {
},
files: {
src: [
'plugins/helphub-*/**/*.php',
'plugins/support-helphub/**/*.php',
'!plugins/support-helphub/inc/syntaxhighlighter/**/*.php',
'themes/helphub/**/*.php'
],
expand: true
Expand Down Expand Up @@ -115,19 +116,19 @@ module.exports = function( grunt ) {
},
helphub: {
expand: true,
src: 'themes/helphub/style.css'
src: 'themes/wporg-support/style.css'
},
contributors: {
expand: true,
src: 'plugins/helphub-contributors/public/css/helphub-contributors-public.css'
src: 'plugins/support-helphub/inc/helphub-contributors/public/css/helphub-contributors-public.css'
}
},
sass: {
helphub: {
expand: true,
ext: '.css',
cwd: 'themes/helphub/sass/',
dest: 'themes/helphub/',
cwd: 'themes/wporg-support/sass/',
dest: 'themes/wporg-support/',
src: [ 'style.scss' ],
options: {
indentType: 'tab',
Expand All @@ -138,8 +139,8 @@ module.exports = function( grunt ) {
contributors: {
expand: true,
ext: '.css',
cwd: 'plugins/helphub-contributors/src/sass/',
dest: 'plugins/helphub-contributors/public/css/',
cwd: 'plugins/support-helphub/inc/helphub-contributors/src/sass/',
dest: 'plugins/support-helphub/inc/helphub-contributors/public/css/',
src: [ 'helphub-contributors-public.scss' ],
options: {
indentType: 'tab',
Expand Down Expand Up @@ -172,7 +173,7 @@ module.exports = function( grunt ) {
{
expand: true,
src: ['node_modules/select2/dist/**'],
dest: 'plugins/helphub-contributors/admin/assets/'
dest: 'plugins/support-helphub/inc/helphub-contributors/admin/assets/'
}
]
}
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ You can get involved in development (or any other aspect of the project) by atte

## How to use this repo

To use this repo, simply create a new WordPress site on your local machine (using whatever development environment suits you), then empty out the `wp-content` folder and clone this repo into it. You will also need to add the following line to your site's `wp-config.php` file:

```
define( 'WPORGPATH', 'https://wordpress.org/' );
```
To use this repo, simply create a new WordPress site on your local machine (using whatever development environment suits you), then empty out the `wp-content` folder and clone this repo into it.

## Workflow

Expand All @@ -35,7 +31,7 @@ Any fixes that do not qualify as new features are to done in individual branches

As this is a WordPress community project, all development must have a strong committment to accessibility and responsive design. We will also be following the [WordPress coding standards](https://codex.wordpress.org/WordPress_Coding_Standards) throughout the project.

Given that we will ultimately need to localise the whole site for different languages, please use `helphub` as the text domain for all text strings.
Given that we will ultimately need to localise the whole site for different languages, please use `wporg-forums` as the text domain for all text strings.

A database export is available here - https://github.com/Kenshino/HelpHub/blob/master/helphub.wordpress.2017-06-15.xml

Expand Down
2 changes: 1 addition & 1 deletion phpcs.ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

<file>.</file>

<exclude-pattern>plugins/syntaxhighlighter/*</exclude-pattern>
<exclude-pattern>plugins/support-helphub/inc/syntaxhighlighter/*</exclude-pattern>
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static function instance() {
* @since 1.0.0
*/
public function load_plugin_textdomain() {
load_plugin_textdomain( 'helphub', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
load_plugin_textdomain( 'wporg-forums', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
} // End load_plugin_textdomain()

/**
Expand All @@ -215,7 +215,7 @@ public function load_plugin_textdomain() {
* @since 1.0.0
*/
public function __clone() {
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'helphub' ), '1.0.0' );
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'wporg-forums' ), '1.0.0' );
} // End __clone()

/**
Expand All @@ -225,7 +225,7 @@ public function __clone() {
* @since 1.0.0
*/
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'helphub' ), '1.0.0' );
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'wporg-forums' ), '1.0.0' );
} // End __wakeup()

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ public function add_contributors() {
$contributors = get_post_meta( $post->ID, 'helphub_contributors' ); ?>

<div class="misc-pub-section helphub-contributors">
<label><?php esc_html_e( 'Contributors', 'helphub' ); ?>
<label><?php esc_html_e( 'Contributors', 'wporg-forums' ); ?>
<select id="helphub-contributors" class="widefat" multiple name="helphub_contributors[]">
<?php foreach ( $contributors[0] as $contributor ) : ?>
<option value="<?php echo esc_attr( $contributor ); ?>" selected="selected"><?php echo esc_html( $contributor ); ?></option>
<?php endforeach; ?>
</select><!-- #helphub-contributors -->
</label>
<p class="description"><?php esc_html_e( 'Type wp.org username for contributor', 'helphub' ); ?></p>
<p class="description"><?php esc_html_e( 'Type wp.org username for contributor', 'wporg-forums' ); ?></p>
</div><!-- misc-pub-section helphub-contributors -->
<?php
}
Expand Down Expand Up @@ -145,7 +145,7 @@ public function save_post( $post_id, $post ) {
* @param array $columns Array of columns
*/
public function add_column( $columns ) {
$columns['helphub_contributors'] = esc_html__( 'Contributors', 'helphub' );
$columns['helphub_contributors'] = esc_html__( 'Contributors', 'wporg-forums' );
return $columns;
}

Expand All @@ -172,9 +172,9 @@ public function show_column( $column, $post_id ) {
$contributor_link = '<a href="https://profiles.wordpress.org/' . esc_html( $contributor ) . '">@' . esc_html( $contributor ) . '</a>';

if ( end( $contributors ) == $contributor ) {
$contributor_link .= esc_html__( '.', 'helphub' );
$contributor_link .= esc_html__( '.', 'wporg-forums' );
} else {
$contributor_link .= esc_html__( ', ', 'helphub' );
$contributor_link .= esc_html__( ', ', 'wporg-forums' );
}

echo $contributor_link;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ public function show_contributors( $content ) {
else :

// Display message if no user is found with provided username.
$contributors_items .= '<div class="contributor contributor-not-found"><p>' . sprintf( __( '%s is not a valid username.', 'helphub' ), '<strong>' . $contributor . '</strong>' ) . '</p></div>';
$contributors_items .= '<div class="contributor contributor-not-found"><p>' . sprintf( __( '%s is not a valid username.', 'wporg-forums' ), '<strong>' . $contributor . '</strong>' ) . '</p></div>';

endif; // is_object( $contributor_object )

endforeach; // $contributors as $contributor

$contributors_heading = '<h5>' . esc_html__( 'Contributors', 'helphub' ) . '</h5>';
$contributors_heading = '<h5>' . esc_html__( 'Contributors', 'wporg-forums' ) . '</h5>';
$contributors_list = '<div class="contributors-list">' . $contributors_items . '</div>';

// Build the markup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,23 @@ public function register_post_type() {
$labels = array(
'name' => $this->plural,
'singular_name' => $this->singular,
'add_new' => _x( 'Add New', 'add new helphub post', 'helphub' ),
'add_new' => _x( 'Add New', 'add new helphub post', 'wporg-forums' ),
/* translators: %s: Post type name. */
'add_new_item' => sprintf( __( 'Add New %s', 'helphub' ), $this->singular ),
'add_new_item' => sprintf( __( 'Add New %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Post type name. */
'edit_item' => sprintf( __( 'Edit %s', 'helphub' ), $this->singular ),
'edit_item' => sprintf( __( 'Edit %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Post type name. */
'new_item' => sprintf( __( 'New %s', 'helphub' ), $this->singular ),
'new_item' => sprintf( __( 'New %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Plural post type name. */
'all_items' => sprintf( __( 'All %s', 'helphub' ), $this->plural ),
'all_items' => sprintf( __( 'All %s', 'wporg-forums' ), $this->plural ),
/* translators: %s: Post type name. */
'view_item' => sprintf( __( 'View %s', 'helphub' ), $this->singular ),
'view_item' => sprintf( __( 'View %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Plural post type name. */
'search_items' => sprintf( __( 'Search %a', 'helphub' ), $this->plural ),
'search_items' => sprintf( __( 'Search %a', 'wporg-forums' ), $this->plural ),
/* translators: %s: Plural post type name. */
'not_found' => sprintf( __( 'No %s Found', 'helphub' ), $this->plural ),
'not_found' => sprintf( __( 'No %s Found', 'wporg-forums' ), $this->plural ),
/* translators: %s: Plural post type name. */
'not_found_in_trash' => sprintf( __( 'No %s Found In Trash', 'helphub' ), $this->plural ),
'not_found_in_trash' => sprintf( __( 'No %s Found In Trash', 'wporg-forums' ), $this->plural ),
'parent_item_colon' => '',
'menu_name' => $this->plural,
);
Expand Down Expand Up @@ -220,7 +220,7 @@ public function register_custom_columns( $column_name, $id ) {
*/
public function register_custom_column_headings( $defaults ) {
$new_columns = array(
'image' => __( 'Image', 'helphub' ),
'image' => __( 'Image', 'wporg-forums' ),
);

$last_item = array();
Expand Down Expand Up @@ -264,24 +264,24 @@ public function updated_messages( $messages ) {
0 => '',
// Unused. Messages start at index 1.
/* translators: %1$s: Post link tag. %2$s: Close post link tag. %3$s: Post type name. %4$s: Lowercase post type name. */
1 => sprintf( __( '%3$s updated. %1$sView %4$s%2$s', 'helphub' ), '<a href="' . esc_url( $permalink ) . '">', '</a>', $this->singular, strtolower( $this->singular ) ),
2 => __( 'Custom field updated.', 'helphub' ),
3 => __( 'Custom field deleted.', 'helphub' ),
1 => sprintf( __( '%3$s updated. %1$sView %4$s%2$s', 'wporg-forums' ), '<a href="' . esc_url( $permalink ) . '">', '</a>', $this->singular, strtolower( $this->singular ) ),
2 => __( 'Custom field updated.', 'wporg-forums' ),
3 => __( 'Custom field deleted.', 'wporg-forums' ),
/* translators: %s: Post type name. */
4 => sprintf( __( '%s updated.', 'helphub' ), $this->singular ),
4 => sprintf( __( '%s updated.', 'wporg-forums' ), $this->singular ),
/* translators: %s: date and time of the revision */
5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'helphub' ), $this->singular, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'wporg-forums' ), $this->singular, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
// WPCS: CSRF ok; input var ok.
/* translators: %1$s Post type name. %2$s: Lowercase post type name. %3$s: Post link tag. %4$s: Close post link tag. */
6 => sprintf( __( '%1$s published. %3$sView %2$s%4$s', 'helphub' ), $this->singular, strtolower( $this->singular ), '<a href="' . esc_url( $permalink ) . '">', '</a>' ),
6 => sprintf( __( '%1$s published. %3$sView %2$s%4$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<a href="' . esc_url( $permalink ) . '">', '</a>' ),
/* translators: %s: Post type name. */
7 => sprintf( __( '%s saved.', 'helphub' ), $this->singular ),
7 => sprintf( __( '%s saved.', 'wporg-forums' ), $this->singular ),
/* translators: %1$s: Post type name. %2$s: Lowercase post type name. %3$s: Post link tag. %4$s: Close post link tag. */
8 => sprintf( __( '%1$s submitted. %2$sPreview %3$s%4$s', 'helphub' ), $this->singular, strtolower( $this->singular ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', $permalink ) ) . '">', '</a>' ),
8 => sprintf( __( '%1$s submitted. %2$sPreview %3$s%4$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', $permalink ) ) . '">', '</a>' ),
/* translators: %1$s: Post type name. %2$s: Lowercase post type name. */
9 => sprintf( __( '%1$s scheduled for: %1$s. %2$sPreview %2$s%3$s', 'helphub' ), $this->singular, strtolower( $this->singular ), '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'helphub' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( $permalink ) . '">', '</a>' ),
9 => sprintf( __( '%1$s scheduled for: %1$s. %2$sPreview %2$s%3$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'wporg-forums' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( $permalink ) . '">', '</a>' ),
/* translators: %1$s: Post type name. %2$s: Lowercase post type name. %3$s: Close post link tag. %4$s: Close post link tag. */
10 => sprintf( __( '%1$s draft updated. %3$sPreview %2$s%4$s', 'helphub' ), $this->singular, strtolower( $this->singular ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', $permalink ) ) . '">', '</a>' ),
10 => sprintf( __( '%1$s draft updated. %3$sPreview %2$s%4$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', $permalink ) ) . '">', '</a>' ),
);

return $messages;
Expand All @@ -297,12 +297,12 @@ public function updated_messages( $messages ) {
*/
public function meta_box_setup() {
if ( 'post' === $this->post_type ) {
add_meta_box( $this->post_type . '-display', __( 'Display Settings', 'helphub' ), array(
add_meta_box( $this->post_type . '-display', __( 'Display Settings', 'wporg-forums' ), array(
$this,
'meta_box_content',
), $this->post_type, 'normal', 'high' );
} elseif ( 'helphub_version' === $this->post_type ) {
add_meta_box( $this->post_type . '-version-meta', __( 'Display Settings', 'helphub' ), array(
add_meta_box( $this->post_type . '-version-meta', __( 'Display Settings', 'wporg-forums' ), array(
$this,
'meta_box_version_content',
), $this->post_type, 'normal', 'high' );
Expand Down Expand Up @@ -603,7 +603,7 @@ public function meta_box_save( $post_id ) {
public function enter_title_here( $title ) {
if ( get_post_type() === $this->post_type ) {
if ( 'post' === get_post_type() ) {
$title = __( 'Enter the article title here', 'helphub' );
$title = __( 'Enter the article title here', 'wporg-forums' );
}
}

Expand Down Expand Up @@ -643,16 +643,16 @@ public function get_custom_fields_post_display_settings() {
$fields = array();

$fields['read_time'] = array(
'name' => __( 'Article Read Time', 'helphub' ),
'description' => __( 'Leave this empty, calculation is automatic', 'helphub' ),
'name' => __( 'Article Read Time', 'wporg-forums' ),
'description' => __( 'Leave this empty, calculation is automatic', 'wporg-forums' ),
'type' => 'text',
'default' => '',
'section' => 'info',
);

$fields['custom_read_time'] = array(
'name' => __( 'Custom Read Time', 'helphub' ),
'description' => __( 'Only fill up this field if the automated calculation is incorrect', 'helphub' ),
'name' => __( 'Custom Read Time', 'wporg-forums' ),
'description' => __( 'Only fill up this field if the automated calculation is incorrect', 'wporg-forums' ),
'type' => 'text',
'default' => '',
'section' => 'info',
Expand All @@ -672,16 +672,16 @@ public function get_custom_fields_version_display_settings() {
$fields = array();

$fields['version_date'] = array(
'name' => __( 'Date Released', 'helphub' ),
'description' => __( 'Date this WordPress Version was released', 'helphub' ),
'name' => __( 'Date Released', 'wporg-forums' ),
'description' => __( 'Date this WordPress Version was released', 'wporg-forums' ),
'type' => 'date',
'default' => '',
'section' => 'info',
);

$fields['musician_codename'] = array(
'name' => __( 'Musician', 'helphub' ),
'description' => __( 'The Jazz Musician this release was named after', 'helphub' ),
'name' => __( 'Musician', 'wporg-forums' ),
'description' => __( 'The Jazz Musician this release was named after', 'wporg-forums' ),
'type' => 'text',
'default' => '',
'section' => 'info',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ public function __construct( $post_type = 'thing', $token = 'thing-category', $s
$this->plural = esc_html( $plural );

if ( '' === $this->singular ) {
$this->singular = __( 'Category', 'helphub' );
$this->singular = __( 'Category', 'wporg-forums' );
}
if ( '' === $this->plural ) {
$this->plural = __( 'Categories', 'helphub' );
$this->plural = __( 'Categories', 'wporg-forums' );
}

$this->args = wp_parse_args( $args, $this->_get_default_args() );
Expand Down Expand Up @@ -128,23 +128,23 @@ private function _get_default_args() {
*/
private function _get_default_labels() {
return array(
'name' => sprintf( _x( '%s', 'taxonomy general name', 'helphub' ), $this->plural ), /* @codingStandardsIgnoreLine */
'singular_name' => sprintf( _x( '%s', 'taxonomy singular name', 'helphub' ), $this->singular ), /* @codingStandardsIgnoreLine */
'search_items' => sprintf( __( 'Search %s', 'helphub' ), $this->plural ),
'name' => sprintf( _x( '%s', 'taxonomy general name', 'wporg-forums' ), $this->plural ), /* @codingStandardsIgnoreLine */
'singular_name' => sprintf( _x( '%s', 'taxonomy singular name', 'wporg-forums' ), $this->singular ), /* @codingStandardsIgnoreLine */
'search_items' => sprintf( __( 'Search %s', 'wporg-forums' ), $this->plural ),
/* translators: %s: Plural name of the post type. */
'all_items' => sprintf( __( 'All %s', 'helphub' ), $this->plural ),
'all_items' => sprintf( __( 'All %s', 'wporg-forums' ), $this->plural ),
/* translators: %s: Post type name. */
'parent_item' => sprintf( __( 'Parent %s', 'helphub' ), $this->singular ),
'parent_item' => sprintf( __( 'Parent %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Post type name. */
'parent_item_colon' => sprintf( __( 'Parent %s:', 'helphub' ), $this->singular ),
'parent_item_colon' => sprintf( __( 'Parent %s:', 'wporg-forums' ), $this->singular ),
/* translators: %s: Post type name. */
'edit_item' => sprintf( __( 'Edit %s', 'helphub' ), $this->singular ),
'edit_item' => sprintf( __( 'Edit %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Post type name. */
'update_item' => sprintf( __( 'Update %s', 'helphub' ), $this->singular ),
'update_item' => sprintf( __( 'Update %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Post type name. */
'add_new_item' => sprintf( __( 'Add New %s', 'helphub' ), $this->singular ),
'add_new_item' => sprintf( __( 'Add New %s', 'wporg-forums' ), $this->singular ),
/* translators: %s: Post type name. */
'new_item_name' => sprintf( __( 'New %s Name', 'helphub' ), $this->singular ),
'new_item_name' => sprintf( __( 'New %s Name', 'wporg-forums' ), $this->singular ),
'menu_name' => $this->plural,
);
} // End _get_default_labels()
Expand Down
Loading