Answer the question
In order to leave comments, you need to log in
How to get individual elements of a php array?
Help please,
There is a function in which there are arrays (given by the plugin)
$icons['avatar-upload'] = array(
'content'=> '<span><input type="file" id="userpicupload" accept="image/*" name="userpicupload"></span>',
'atts' => array(
'title' => __('Avatar upload','wp-recall'),
'url' => '#'
)
);
if(get_user_meta($user_ID,'rcl_avatar',1)){
$icons['avatar-delete'] = array(
'atts' => array(
'title' => __('Delete avatar','wp-recall'),
'href' => wp_nonce_url( rcl_format_url(get_author_posts_url($user_ID)).'rcl-action=delete_avatar', $user_ID )
)
);
}
return $icons;
foreach($icons as $icon ){
$atts = array();
if(isset($icon['atts'])){
foreach($icon['atts'] as $attr => $val){
$val = (is_array($val))? implode(' ',$val): $val;
$atts[] = $attr.'="'.$val.'"';
}
}
$string = '<a '.implode(' ',$atts).'>';
if(isset($icon['content']))
$string .= $icon['content'];
$html[] = $string;
}
echo implode('',$html);
$icons['avatar-upload'], $icons['avatar-delete']
foreach($icons['avatar-upload'] as $icon )
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question