2017-09-27 4 views
-3

Ich weiß nicht, PHP, aber ich muss darin arbeiten. Ich brauche $attr['ids'] Array mit $gallery_setting hinzufügen.Hinzufügen Array-Attribute zu implode()

function the_featured_image_gallery($atts = array()) { 

    $gallery_setting = get_theme_mod('featured_image_gallery'); 

    if (is_array($gallery_setting) && ! empty($gallery_setting)) { 
     $atts['ids'] = implode(',', $gallery_setting); 

     echo gallery_shortcode($atts); 
    } 
} 

Im Idealfall würde Ich mag:

echo gallery_shortcode($atts, array(
    'order'  => 'ASC', 
    'size'  => 'full', 
    'link'  => 'none' 
)); 

aber ich weiß, dass es nicht funktioniert.

Antwort

0

Bitte klären Sie Ihre Frage. Es ist nicht klar, was dein Problem ist ...

Um einen Schuss im Dunkeln versuchen:

function the_featured_image_gallery($atts = array()) { 

    $gallery_setting = get_theme_mod('featured_image_gallery'); 

    if (is_array($gallery_setting) && ! empty($gallery_setting)) { 
     $atts['ids'] = implode(',', $gallery_setting); 

     $additional_atts = array(
      'order'  => 'ASC', 
      'size'  => 'full', 
      'link'  => 'none' 
     );    
     $atts = array_merge($atts, $additional_atts); 

     echo gallery_shortcode($atts); 
    } 
} 
+0

Vielen Dank, sehr viel) – BrooonS