shortcode_attrs got changed in this version

This commit is contained in:
Vasil Kolev 2018-05-23 23:01:48 +03:00 committed by Openfest
parent 2bb875d771
commit 80a1dee4b0
1 changed files with 7 additions and 3 deletions

View File

@ -27,10 +27,14 @@ add_action( 'init', 'register_shortcodes');
function sh_latest_posts($atts){ function sh_latest_posts($atts){
$atts = shortcode_atts( array( if (of_get_lang()=='bg')
'cat' => 'news', $ncat = "news-bg";
else
$ncat = "news";
$atts = array(
'cat' => $ncat,
'label' => __('News', 'initfest') 'label' => __('News', 'initfest')
), $atts ); );
$result = '<section class="content"><h3>'.$atts['label'].' | <small><a href="'.esc_url(get_term_link($atts['cat'], 'category')).'">'.__('see all', 'initfest').'</a></small></h3><div class="grid">'; $result = '<section class="content"><h3>'.$atts['label'].' | <small><a href="'.esc_url(get_term_link($atts['cat'], 'category')).'">'.__('see all', 'initfest').'</a></small></h3><div class="grid">';