Skip to content

Commit

Permalink
Update get_available_post_type_locales parameter order
Browse files Browse the repository at this point in the history
Optional parameter should be last in PHP 8
  • Loading branch information
adamwoodnz committed May 2, 2023
1 parent 6807634 commit 4cb6519
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion wp-content/plugins/wporg-learn/inc/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function add_admin_list_table_filters( $post_type, $which ) {
}

$post_status = filter_input( INPUT_GET, 'post_status', FILTER_SANITIZE_STRING );
$available_locales = get_available_post_type_locales( 'language', $post_type, 'english', $post_status );
$available_locales = get_available_post_type_locales( 'language', $post_type, $post_status );
$language = filter_input( INPUT_GET, 'language', FILTER_SANITIZE_STRING );

?>
Expand Down
4 changes: 2 additions & 2 deletions wp-content/plugins/wporg-learn/inc/post-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ function get_workshop_duration( WP_Post $workshop, $format = 'raw' ) {
*
* @param string $meta_key
* @param string $post_type
* @param string $label_language
* @param string $post_status
* @param string $label_language
*
* @return array
*/
function get_available_post_type_locales( $meta_key, $post_type, $label_language = 'english', $post_status ) {
function get_available_post_type_locales( $meta_key, $post_type, $post_status, $label_language = 'english' ) {
global $wpdb;

$and_post_status = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
),
);

$locales = \WPOrg_Learn\Post_Meta\get_available_post_type_locales( 'language', 'lesson-plan', 'native', 'publish' );
$locales = \WPOrg_Learn\Post_Meta\get_available_post_type_locales( 'language', 'lesson-plan', 'publish', 'native' );
?>

<form class="sidebar-filters col-3" method="get" action="<?php echo esc_url( get_post_type_archive_link( 'lesson-plan' ) ); ?>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
array(
'label' => __( 'Language', 'wporg-learn' ),
'name' => 'language',
'items' => \WPOrg_Learn\Post_Meta\get_available_post_type_locales( 'language', 'wporg_workshop', 'native', 'publish' ),
'items' => \WPOrg_Learn\Post_Meta\get_available_post_type_locales( 'language', 'wporg_workshop', 'publish', 'native' ),
),
array(
'label' => __( 'Subtitles', 'wporg-learn' ),
'name' => 'captions',
'items' => \WPOrg_Learn\Post_Meta\get_available_post_type_locales( 'video_caption_language', 'wporg_workshop', 'native', 'publish' ),
'items' => \WPOrg_Learn\Post_Meta\get_available_post_type_locales( 'video_caption_language', 'wporg_workshop', 'publish', 'native' ),
),
array(
'label' => __( 'WordPress Version', 'wporg-learn' ),
Expand Down

0 comments on commit 4cb6519

Please sign in to comment.