mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-20 18:13:44 +03:00
Run phpcs code formatter
This commit is contained in:
parent
37b7e4451a
commit
f412bc8fba
|
@ -85,8 +85,8 @@ function use_archive_template( $templates ) {
|
||||||
function add_body_class( $classes ) {
|
function add_body_class( $classes ) {
|
||||||
global $wp;
|
global $wp;
|
||||||
// Get the main menu using the hooked function.
|
// Get the main menu using the hooked function.
|
||||||
$menus = Block_Config\add_site_navigation_menus( [] );
|
$menus = Block_Config\add_site_navigation_menus( [] );
|
||||||
$slug = $wp->request;
|
$slug = $wp->request;
|
||||||
$has_page = array_filter(
|
$has_page = array_filter(
|
||||||
$menus['main'],
|
$menus['main'],
|
||||||
function ( $item ) use ( $slug ) {
|
function ( $item ) use ( $slug ) {
|
||||||
|
|
|
@ -20,8 +20,8 @@ function register_block_bindings() {
|
||||||
register_block_bindings_source(
|
register_block_bindings_source(
|
||||||
'wporg-5ftf/pledge-meta',
|
'wporg-5ftf/pledge-meta',
|
||||||
array(
|
array(
|
||||||
'label' => 'Pledge meta',
|
'label' => 'Pledge meta',
|
||||||
'uses_context' => [ 'postId' ],
|
'uses_context' => [ 'postId' ],
|
||||||
'get_value_callback' => __NAMESPACE__ . '\get_meta_binding_value',
|
'get_value_callback' => __NAMESPACE__ . '\get_meta_binding_value',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -90,15 +90,15 @@ function get_sort_options( $options ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'label' => $label,
|
'label' => $label,
|
||||||
'title' => __( 'Sort', 'wporg-5ftf' ),
|
'title' => __( 'Sort', 'wporg-5ftf' ),
|
||||||
'key' => 'order',
|
'key' => 'order',
|
||||||
'action' => home_url( '/pledges/' ),
|
'action' => home_url( '/pledges/' ),
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'' => __( 'Random', 'wporg-5ftf' ),
|
'' => __( 'Random', 'wporg-5ftf' ),
|
||||||
'alphabetical' => __( 'Alphabetical', 'wporg-5ftf' ),
|
'alphabetical' => __( 'Alphabetical', 'wporg-5ftf' ),
|
||||||
'contributors' => __( 'Total Contributors', 'wporg-5ftf' ),
|
'contributors' => __( 'Total Contributors', 'wporg-5ftf' ),
|
||||||
'hours' => __( 'Total Hours', 'wporg-5ftf' ),
|
'hours' => __( 'Total Hours', 'wporg-5ftf' ),
|
||||||
),
|
),
|
||||||
'selected' => [ $sort ],
|
'selected' => [ $sort ],
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,7 +17,7 @@ $is_truncated = isset( $attributes['className'] ) && str_contains( $attributes['
|
||||||
$count_more = 0;
|
$count_more = 0;
|
||||||
|
|
||||||
if ( $is_truncated ) {
|
if ( $is_truncated ) {
|
||||||
$count_more = count( $contributors ) - TRUNCATED_MAX;
|
$count_more = count( $contributors ) - TRUNCATED_MAX;
|
||||||
$contributors = array_splice( $contributors, 0, TRUNCATED_MAX );
|
$contributors = array_splice( $contributors, 0, TRUNCATED_MAX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue