Shortcode returns string “Array”
-
Good day
Iv created an html table in my functions.php file, in the table data cell, I have a buddypress shortcode that should return results from a field with multiple checkboxs. The shortcode goes like this “bp_get_profile_field_data( ‘field=School Subjects’)”, what happens next is on display it returns string “Array” instead on the selected checkboxes. Please help on have I should allow my shortcode accept an array.
Below is my table code:
echo “<table border=’1′ align=’center’ width=’20’>”;
echo “<tr>”;
echo “<td style=’font-weight: bold;’>School Subjects</td>”;
echo “<td style=’font-weight: bold;’>Extra Curricula Activities</td>”;
echo “</tr>”;
echo “<tr>”;
echo “<td>“.do_shortcode(bp_get_profile_field_data( ‘field=School Subjects’)).”
</td>”;
echo “<td>”.bp_get_profile_field_data( ‘field=Number of Learners’).”</td>”;
echo “</tr>”;
echo “<tr>”;
echo “<td>Teachers:</td>”;
echo “<td>”.bp_get_profile_field_data( ‘field=Number of teachers in school’).”</td>”;
echo “</tr>”;
echo “</table>”;
- You must be logged in to reply to this topic.