Can’t get the user_meta correctly
Maybe you can try get_user_meta($user->ID, $course_field_name, true) ? By default, get_user_meta() returns an array See http://codex.wordpress.org/Function_Reference/get_user_meta
Maybe you can try get_user_meta($user->ID, $course_field_name, true) ? By default, get_user_meta() returns an array See http://codex.wordpress.org/Function_Reference/get_user_meta
In WordPress is pretty simple create custom roles and also assign specific capabilities to specific user roles (no matter if from core or custom). In my plugins I often create an user role that has all the capabilities required by my plugin, and then I attach some of thos capabilities to existing roles. I’ll give … Read more
First of all get_users_of_blog has been deprecated, so you should use get_users instead, or run a WP_User_Query. After that, the_author_meta echo the meta value, not return anything. To return the meta you should use get_the_author_meta() $blogusers = get_users( $args ); // for args see codex if ($blogusers) { foreach ( $blogusers as $bloguser ) { … Read more
User taxonomies can help you achieve this, I’m working on something similar. You can install the plugin http://wordpress.org/plugins/user-taxonomies/, and register a custom taxonomy , although in my case the plugin has some limitations, may be it helps you. register_taxonomy(‘profession’, ‘user’, array( ‘public’ =>true, ‘labels’ =>array( ‘name’ =>’Professions’, ‘singular_name’ =>’Profession’, ‘menu_name’ =>’Professions’, ‘search_items’ =>’Search Professions’, ‘popular_items’ … Read more
functions.php is not more nor less secure than any other file in your WordPress installation, just like post meta is not more nor less secure than any other table in your WordPress database. That means that they are secure until your site is hacked. So question become “is WordPress secure?” and I think that: that … Read more
You don’t need a checkbox, you can code one if you want, but you can use the default Custom Fields. Make sure they are enabled: Then add some data on the posts you want to have a specific style on, you will need to add this to each post you want to have set to … Read more
You will need to do a JOIN on the users table in your old database, and also select the display name. One key thing to note here, is that I aliased dbold_posts as P, and dbold_users as U – when dealing with multiple table, it’s always best practice to specify which table you are referring … Read more
The way you suggest doing this, it won’t ever be secure. If I understand you, just disabling Javascript would spoil the security. What you’d need to do is run a script that uses an AJAX request to query for and then add data to the page, but only if the user is logged in. That … Read more
the_author_meta() is going to echo content directly. It will not pass a string back that can be processed by do_shortcode(). You want get_the_author_meta(), which is essentially the same as the_author_meta() but it returns a string instead of echoing the data.
It looks like the plugin is using the update_post_meta function, which in turn uses the update_metadata function which includes the action hooks update_postmeta and updated_postmeta which fire immediately before and after the post meta is stored to the database. You could hook into one of these to update the user meta of the author of … Read more