Different registration form for different roles

I don’t know how “Cimy User Extra Fields” works, but you can add fields to the user registration page with: function extra_user_profile_fields_wpse_92164() { echo ‘<label for=”extra_field”>’,_(“Extra Field”).'</label>’; echo ‘<input type=”text” name=”extra_field” value=”” size=”25″ id=”extra_field” />’; } add_action( ‘register_form’, ‘extra_user_profile_fields_wpse_92164’ ); To switch subscriber types you could pass in $_GET parameters, which is how the default … Read more

Rating system for users

From what you’ve mentioned, this could be done by adding a new field to the user_meta on the back end. Then, you could use an approach similar to what’s documented here for front end editing by users: How to edit a user profile on the front end?

How to embed a new string in url?

try this add_filter( ‘rewrite_rules_array’,’my_insert_rewrite_rules’ ); add_filter( ‘query_vars’,’my_insert_query_vars’ ); function my_insert_rewrite_rules( $rules ) { $newrules = array(); $newrules[‘(.+?)/custom_post_type_slug/(.+?)/?$’] = ‘index.php?post_type=custom_post_type_slug&dynamic_string=$matches[1]&custom_post_type_slug=$matches[2]’; return $newrules + $rules; } function my_insert_query_vars( $vars ) { array_push($vars, ‘dynamic_string’); return $vars; }

Completely remove ability to create users?

Okay, so the code above does work, but not for super admins, you must explicitly remove permissions from super admins, like this: // restrict super admin capabilites add_filter(‘map_meta_cap’, ‘restrict_super_admins’, 10, 4); function restrict_super_admins($caps, $cap, $user_id, $args){ $super = array( ‘add_users’, ‘create_users’, ); if( in_array($cap, $super) ) { $caps[] = ‘do_not_allow’; } return $caps; }

WordPress truncate posts question (plugin related)

This is a rather sloppily coded plugin, unfortunately. However, to answer your questions: Replace the function gopiplus_clean with this function gopiplus_clean( $excerpt, $length = 0 ) { $string = strip_tags( str_replace( ‘[…]’, ‘…’, $excerpt ) ); if ( $length > 0 ) { $words_array = preg_split( “/[\n\r\t ]+/”, $excerpt, $length + 1, PREG_SPLIT_NO_EMPTY ); $words … Read more

Adding featured image to posts created by a plugin

The quickest and dirtiest way to do this is to add one line to the insert_posts() function, just before the $imported++; line: } add_post_meta( $post_id, ‘raw_import_data’, json_encode( $twitter_raw ) ); // NEW LINE (change 1001 to the image ID): set_post_thumbnail( $post_id, 1001 ); $imported++; } This will obviously disappear if you ever update the plugin. … Read more