Making WordPress.org

Changeset 13768


Ignore:
Timestamp:
06/04/2024 01:59:03 AM (6 weeks ago)
Author:
dufresnesteven
Message:

wporg-plugins-2024: Make translation bar on single page more prominent to recruit translators.

Fixes: https://github.com/WordPress/wordpress.org/issues/301
Props: tobifjellner, webdados, fcoveram

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/block-config.php

    r13765 r13768  
    1515add_filter( 'render_block_core/site-title', __NAMESPACE__ . '\filter_site_title_block' );
    1616add_filter( 'render_block_core/navigation', __NAMESPACE__ . '\filter_navigation_block', 10, 2 );
     17add_filter( 'render_block_wporg/language-suggest', __NAMESPACE__ . '\filter_language_suggest' );
    1718
    1819/**
     
    335336    return $block_content;
    336337}
     338
     339
     340/**
     341 * Increase the visibilit of the language suggest bar to recruit translators on plugin page.
     342 *
     343 * @see https://github.com/WordPress/wordpress.org/issues/301
     344 *
     345 * @param string $block_content
     346 * @return string
     347 */
     348function filter_language_suggest( $block_content ) {
     349    if ( ! is_single() ) {
     350        return $block_content;
     351    }
     352
     353    $html = new \WP_HTML_Tag_Processor( $block_content );
     354    $html->next_tag();
     355    $html->add_class( 'is-style-prominent' );
     356    return $html->get_updated_html();
     357}
Note: See TracChangeset for help on using the changeset viewer.