homonk
Forum Replies Created
-
Thanks.
If you still need it I’m using WordPress 6.3.2 and SuperPWA 2.2.20
Forum: Plugins
In reply to: [Short URL] WordPress database errorNo, nothing like that – never mind. Thanks for your help.
Forum: Plugins
In reply to: [Short URL] WordPress database errorThanks – I assume their is no easy way of restoring the previous links
Forum: Plugins
In reply to: [Short URL] WordPress database errorI’ve looked at phpmyadmin and can’t see the table.
What would have deleted it?
Forum: Hacks
In reply to: Help creating shortcode that queries custom field checkboxThank you!
I managed to get it to work combining your info and some code I found elsewhere.
//Add steering member list shortcode function steering_list_authors() { $args = array( 'orderby' => 'display_name', 'meta_query' => array( array( 'key' => 'steering', 'value' => 'true' ) )); $wp_user_query = new WP_User_Query($args); $authors = $wp_user_query->get_results(); if (!empty($authors)) { echo '<div id="mason2">'; foreach ($authors as $author) { $archive_url = get_author_posts_url($author->ID); $author_info = get_userdata($author->ID); echo '<div class="author-entry">'; echo '<a href="'. $archive_url . '" title="' . __('View ') . $author->display_name . '">'; echo get_avatar($author->user_email); echo '<a>'; echo '<a href="'. $archive_url . '" title="' . __('View ') . $author->display_name . '"><h3>' . $author->display_name . '</h3></a>'; echo '</div>'; } echo '</div>'; } else { echo 'No authors found'; } } add_shortcode('steering_list', 'steering_list_authors');
Forum: Hacks
In reply to: Help creating shortcode that queries custom field checkboxThanks for replying, I’m still really struggling – could I be doing something else wrong
I’m using this as the input
<input type="checkbox" name="steering" id="steering" value="true" <?php if (esc_attr( get_the_author_meta( "steering", $user->ID )) == "true") echo "checked"; ?> />
and this to save the the values
update_usermeta( $user_id, 'steering', $_POST['steering'] );
It is saving in the database on a table wp_usermeta with the meta_key ‘steering’ and the meta_value “true’
I can’t workout how to use this data
I tried just adding
$authors = get_users(array( 'orderby' => 'display_name', 'count_totals' => false, 'who' => 'authors', 'steering' => true ));
but it didn’t work.
Any ideas?