Making WordPress.org

Changeset 13998


Ignore:
Timestamp:
08/26/2024 11:32:19 PM (6 weeks ago)
Author:
coffee2code
Message:

Photo Directory, Admin: Shrink height of content editor.

Props topher1kenobe, coffee2code.
Fixes #7757.

File:
1 edited

Legend:

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

    r13997 r13998  
    8888        add_action( "add_meta_boxes_{$post_type}",             [ __CLASS__, 'add_skip_queued_photo_meta_box' ], 10, 2 );
    8989        add_action( 'admin_init',                              [ __CLASS__, 'admin_redirect_to_next_photo' ] );
     90
     91        // Shrink height of content editor.
     92        add_filter( 'wp_editor_settings',                      [ __CLASS__, 'shrink_editor_height' ], 10, 2 );
    9093    }
    9194
     
    15971600    }
    15981601
     1602    /**
     1603     * Shrinks the height of the content editor when editing photo posts.
     1604     *
     1605     * @param array  $settings  Array of editor arguments.
     1606     * @param string $editor_id Unique editor identifier.
     1607     * @return array
     1608     */
     1609    public static function shrink_editor_height( $settings, $editor_id ) {
     1610        global $post_type;
     1611
     1612        if ( Registrations::get_post_type() === $post_type ) {
     1613            $settings['editor_height'] = '80px';
     1614        }
     1615
     1616        return $settings;
     1617    }
     1618
    15991619}
    16001620
Note: See TracChangeset for help on using the changeset viewer.