Hi, I am trying to use a code element to execute some PHP code. Execute is enabled and a code element shows the HTML from the default ok, so I know it works.
But when I add some PHP code I am getting an error …
Parse error : syntax error, unexpected ‘‘orderby’ => ‘display_name’’ (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) in /home/…/…/wp-content/themes/bricks/includes/elements/code.php(135) : eval()'d code on line 3
Here’s my code to get a list of users emails and display it ( At least that is what it is supposed to do )
<?php // WordPress get all user emails $args = array('orderby' => 'display_name'); $wp_user_query = new WP_User_Query($args); $authors = $wp_user_query->get_results(); if (!empty($authors)) { echo '- ';
foreach ($authors as $author) {
$author_info = get_userdata($author->ID);
echo '
- ' . $author_info->user_email . ' '; } echo '
So is this a problem with the code? Or with Bricks?
Many thanks
Alan