From bf495c0998c333989b69a0bb40c48f6f779b1d24 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Fri, 10 May 2024 03:14:28 +0200 Subject: [PATCH] Update Patreon list table column values --- includes/functions/_setup-meta-fields.php | 15 +++++---------- includes/functions/_utility.php | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/includes/functions/_setup-meta-fields.php b/includes/functions/_setup-meta-fields.php index 504cd8e5..73380b29 100644 --- a/includes/functions/_setup-meta-fields.php +++ b/includes/functions/_setup-meta-fields.php @@ -4291,13 +4291,13 @@ add_action( 'save_post', 'fictioneer_save_recommendation_metaboxes' ); */ function fictioneer_add_patreon_posts_columns( $post_columns ) { - $post_columns[ 'fictioneer_patreon_lock_tiers' ] = + $post_columns[ 'fictioneer_patreon_lock_tiers' ] = _x( 'Patreon Tiers', 'Patreon tiers list table column title.', 'fictioneer' ); - $post_columns[ 'fictioneer_patreon_lock_amount' ] = + $post_columns[ 'fictioneer_patreon_lock_amount' ] = _x( 'Patreon Cents', 'Patreon amount cents list table column title.', 'fictioneer' ); - return $post_columns; + return $post_columns; } /** @@ -4310,15 +4310,10 @@ function fictioneer_add_patreon_posts_columns( $post_columns ) { */ function fictioneer_manage_posts_custom_column( $column_name, $post_id ) { - switch( $column_name ) { - case 'fictioneer_patreon_lock_tiers': - $tiers = get_post_meta( $post_id, 'fictioneer_patreon_lock_tiers', true ) ?: []; - $tiers = is_array( $tiers ) ? $tiers : []; - echo $tiers ? implode( ', ', $tiers ) : '—'; break; case 'fictioneer_patreon_lock_amount': - echo get_post_meta( $post_id, 'fictioneer_patreon_lock_amount', true ) ?: '—'; - break; + echo get_post_meta( $post_id, 'fictioneer_patreon_lock_amount', true ) ?: '—'; + break; } } diff --git a/includes/functions/_utility.php b/includes/functions/_utility.php index 24913fee..ccad16b8 100644 --- a/includes/functions/_utility.php +++ b/includes/functions/_utility.php @@ -1786,7 +1786,7 @@ function fcntr( $key, $escape = false ) { 'future_prefix' => _x( 'Scheduled:', 'Chapter list status prefix.', 'fictioneer' ), 'trashed_prefix' => _x( 'Trashed:', 'Chapter list status prefix.', 'fictioneer' ), 'private_prefix' => _x( 'Private:', 'Chapter list status prefix.', 'fictioneer' ), - 'free_patreon_tier' => _x( 'Follower (free)', 'Free Patreon tier (follower).', 'fictioneer' ) + 'free_patreon_tier' => _x( 'Follower (Free)', 'Free Patreon tier (follower).', 'fictioneer' ) ); // Filter static translations