User activation in wordpress
I would use my own usermeta to handle it to avoid having any sort of crossover issues with plugins/future updates. It should also allow you greater flexibility in what you store in the usermeta.
I would use my own usermeta to handle it to avoid having any sort of crossover issues with plugins/future updates. It should also allow you greater flexibility in what you store in the usermeta.
Do you have access to (installing) plugins? There are several plugins that lets you add the Open Graph tags: http://wordpress.org/extend/plugins/search.php?q=open+graph
if said user created any links or not, Which they probably didn’t.
The easiest way to overcome this would be to create a custom “getter” to pull the data from the user meta which will check and clean and update “on the fly” something like this: First create a function to check if the user exists, function does_user_exists($user_id){ global $wpdb; $user = $wpdb->get_var( $wpdb->prepare( ” SELECT user_login … Read more
What you’re referring to is serialized data. To save an array to MySQL the data is serialized upon submission, so the best way to read that data is to pull it out of the database with a function that unserializes it, which WordPress does for you. More details So somewhere in a theme or plugin … Read more
In response to the extended question, i.e. Another question is[…]: It is worth noting that WordPress’ plugin API does not persist between requests – that is to say, any functions associated with actions through WordPress’ add_action() are only associated for the duration of the script’s execution. Each subsequent request served by WordPress must once again … Read more
Here is some code that reads the highest number from the user meta table and then adds +1 to that number. This saves that number for each newly registered user. The code is triggered via the action hook “user_register”. add_action( ‘user_register’, ‘assignuserid’); function assignuserid($user_id) { global $wpdb; $latestid=$wpdb->get_var(“SELECT meta_value from $wpdb->usermeta where meta_key=’memnumber’ order by … Read more
No need to get Insert id for meta field.You get key value by using this function. $user_some_value = get_user_meta( $user_id, some_key );
You can use the WP_User_Query class which works much like WP_Query. The docs: http://codex.wordpress.org/Class_Reference/WP_User_Query Below is a dump of the WP_User object that it will return, in this example using: $wp_user_search = new WP_User_Query( array( ‘fields’ => ‘all_with_meta’ ) ); $get_users = $wp_user_search->get_results(); This should set you in the right direction because it was not … Read more
Try copying the following code into your functions.php file. It adds a custom og:image property for the authors with nicenames of michelle-robinson, mystery-man, john-smith, and a default fallback image, respectively. You can easily change this to suit your needs. add_action( ‘wp_head’, ‘wpse_70701_author_image’ ); function wpse_70701_author_image() { if ( is_author( ‘michelle-robinson’ ) ) { // set … Read more