Making WordPress.org

Changeset 12867


Ignore:
Timestamp:
08/29/2023 07:42:59 PM (18 months ago)
Author:
coffee2code
Message:

Photo Directory, Admin: Remove the likes column (output by Jetpack) from the listing of pending photos.

See #7171.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php

    r12783 r12867  
    3030        add_filter( "manage_{$post_type}_posts_columns",       [ __CLASS__, 'add_flags_column' ] );
    3131        add_action( "manage_{$post_type}_posts_custom_column", [ __CLASS__, 'handle_flags_column_data' ], 10, 2 );
    32         add_filter( "manage_edit-{$post_type}_columns",        [ __CLASS__, 'remove_photo_colors_column' ] );
     32        add_filter( "manage_edit-{$post_type}_columns",        [ __CLASS__, 'remove_columns_from_pending_photos' ] );
    3333        add_filter( 'post_row_actions',                        [ __CLASS__, 'add_post_action_photo_links' ], 10, 2 );
    3434        add_filter( 'the_author',                              [ __CLASS__, 'add_published_photos_count_to_author' ] );
     
    370370
    371371    /**
    372      * Removes the colors column from the listing of pending photos.
    373      *
    374      * Currently colors aren't auto-assigned, so rarely is there antyhing
    375      * to show.
     372     * Removes certain columns from the listing of pending photos.
     373     *
     374     * Removes these columns:
     375     * - The colors column. (Currently colors aren't auto-assigned, so rarely
     376     *   is there antyhing to show.)
     377     * - The number of likes, as provided by Jetpack.
    376378     *
    377379     * @param  array $columns Array of post column titles.
    378380     * @return array
    379381     */
    380     public static function remove_photo_colors_column( $columns ) {
     382    public static function remove_columns_from_pending_photos( $columns ) {
    381383        if (
    382384            filter_input( INPUT_GET, 'post_type' ) === Registrations::get_post_type()
     
    385387        ) {
    386388            unset( $columns[ 'taxonomy-' . Registrations::get_taxonomy( 'colors' ) ] );
     389            unset( $columns['likes'] );
    387390        }
    388391
Note: See TracChangeset for help on using the changeset viewer.