regEx wp core file

I was able to answer my own question. Simply adding a 0-9 into the code above remedied the situation. Here is the final code: if (!name || !/^[a-z0-9][a-z0-9\-\_:\.]*$/i.test(name)) { tinyMCEPopup.alert(‘advanced_dlg.anchor_invalid’); return; }

Show items by user_role

Here is an easy way to check if a user has a role. Note that I used your way of getting the WP_User, but there are others: $user = new WP_User( $item->post_author ); // $user = get_userdata( get_current_user_id()); // another way to get logged in user if ( !user_can($user->ID,’directory_4′) ) { // show items, user … Read more

Displaying Results From Custom Taxonomy Query

$regions = get_terms(‘region’, array(‘hide_empty’ => false) ); foreach( $regions as $region ){ ?> <li class=”location large-3 columns”> <img src=”https://wordpress.stackexchange.com/questions/126131/<?php echo get_template_directory_uri(); ?>/images/<?php echo $region->slug; ?>.jpg” alt=”” /> <span class=”location-title”><?php echo $region->name; ?></span> </li><?php }