Skip to content

Instantly share code, notes, and snippets.

@billerickson billerickson/functions.php Secret
Last active Jul 4, 2018

Embed
What would you like to do?
<?php
/**
* Polylang support for Display Posts Shortcode
*
* @author Bill Erickson
* @see https://wordpress.org/support/topic/display-posts-in-a-specific-language/
*
* @param array $args, WP Query arguments
* @param array $atts, Shortcode attributes
* @return array $args
*
*/
function be_polylang_support_dps( $args, $atts ) {
if( !empty( $atts['lang'] ) )
$args['lang'] = esc_attr( $atts['lang'] );
return $args;
}
add_filter( 'display_posts_shortcode_args', 'be_polylang_support_dps', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.