Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't change column names for AJAX calls.

  • Loading branch information...
commit 435dfe59dca57030338a1ef0713f2e6e6b8f5fc5 1 parent 1134ddf
Michael Sisk authored
Showing with 15 additions and 22 deletions.
  1. +5 −4 -/php/posts.php
  2. +10 −18 -/php/taxonomy.php
View
9 -/php/posts.php
@@ -408,11 +408,12 @@ public function view_edit_webcomic( $views ) {
*/
public function manage_edit_webcomic_columns( $columns ) {
$pre = array_slice( $columns, 0, 1 );
- //$mid = array_slice( $columns, 1, 2 );
-
$pre[ 'webcomic_attachments' ] = '';
- $columns[ "taxonomy-{$_GET[ 'post_type' ]}_character" ] = __( 'Characters', 'webcomic' );
- $columns[ "taxonomy-{$_GET[ 'post_type' ]}_storyline" ] = __( 'Storylines', 'webcomic' );
+
+ if ( isset( $_GET[ 'post_type' ] ) ) {
+ $columns[ "taxonomy-{$_GET[ 'post_type' ]}_character" ] = __( 'Characters', 'webcomic' );
+ $columns[ "taxonomy-{$_GET[ 'post_type' ]}_storyline" ] = __( 'Storylines', 'webcomic' );
+ }
return array_merge( $pre, $columns );
}
View
28 -/php/taxonomy.php
@@ -45,8 +45,8 @@ public function __construct() {
add_filter( "manage_{$k}_storyline_custom_column", array( $this, 'manage_custom_column' ), 10, 3 );
add_filter( "manage_{$k}_character_custom_column", array( $this, 'manage_custom_column' ), 10, 3 );
- add_filter( "manage_edit-{$k}_storyline_columns", array( $this, 'manage_edit_webcoimc_storyline_columns' ), 10, 3 );
- add_filter( "manage_edit-{$k}_character_columns", array( $this, 'manage_edit_webcoimc_character_columns' ), 10, 3 );
+ add_filter( "manage_edit-{$k}_storyline_columns", array( $this, 'manage_edit_columns' ), 10, 3 );
+ add_filter( "manage_edit-{$k}_character_columns", array( $this, 'manage_edit_columns' ), 10, 3 );
}
}
@@ -337,29 +337,21 @@ public function manage_custom_column( $value, $column, $id ) {
}
}
- /** Rename the 'Posts' column and add the image column for storylines.
+ /** Rename the 'Posts' column and add the image column for terms.
*
* @param array $columns Array of of term columns.
* @return array
* @hook manage_edit-(webcomic\d+)_storyline_columns
*/
- public function manage_edit_webcoimc_storyline_columns( $columns ) {
+ public function manage_edit_columns( $columns ) {
$pre = array_slice( $columns, 0, 1 );
- $pre[ 'webcomic_image' ] = __( 'Cover', 'webcomic' );
- $columns[ 'posts' ] = __( 'Webcomics', 'webcomic' );
- return array_merge( $pre, $columns );
- }
-
- /** Rename the 'Posts' column and add the image column for characters.
- *
- * @param array $columns Array of of term columns.
- * @return array
- * @hook manage_edit-(webcomic\d+)_character_columns
- */
- public function manage_edit_webcoimc_character_columns( $columns ) {
- $pre = array_slice( $columns, 0, 1 );
- $pre[ 'webcomic_image' ] = __( 'Avatar', 'webcomic' );
+ if ( isset( $_GET[ 'taxonomy' ] ) ) {
+ $pre[ 'webcomic_image' ] = false !== strpos( $_GET[ 'taxonomy' ], '_storyline' ) ? __( 'Cover', 'webcomic' ) : __( 'Avatar', 'webcomic' );
+ } else {
+ $pre[ 'webcomic_image' ] = '';
+ }
+
$columns[ 'posts' ] = __( 'Webcomics', 'webcomic' );
return array_merge( $pre, $columns );
Please sign in to comment.
Something went wrong with that request. Please try again.