Tag Info

New answers tagged

1

To get post meta fields, you can use get_post_meta() function, but obviously not get_user_meta(), the name of the functions are self-explanatory. The first parameter of get_post_meta() function is the post ID; here you define which post you want to get postmeta from. So, you need to get frist the post ID of the post you want and then pass this ID to ...


1

Use 'show_option_none' argument for this. wp_dropdown_users( array('show_option_none' => __('No user selected') ) );


0

The conceptual difference between users in a standalone site and a network site is that in a network the users do not belong to the site but to the network itself are are being automatically logged in into all the network site once they login to one. Most of the time the difference can be ignored but there are some edge cases in which the differences come to ...


0

Custom field data saved in the wp_postmeta table. Best way to access custom field is using wordpress built-in functions. for example: <?php $mykey_values = get_post_custom_values('my_key'); foreach ( $mykey_values as $key => $value ) { echo "$key => $value ('my_key')<br />"; } ?> 0 => First value ('my_key') 1 => Second value ...


0

I had a very similar situation, but I am using it for a family member with an illness to provide updates to the wider friends and family without relying on the primary caretaker to give these updates and a blog seemed the best way. We also wanted to allow people to add comments to the posts to give encouragement, etc. Your link to the OpenID somehow led me ...


0

Because I'm also storing the user IDs against each company, office and team post object as user taxonomy I can reverse the query and only include the user IDs assigned to that specific post object. A similar thing to what has been done here - http://mywebsiteadvisor.com/learning/tutorials/building-simple-groups-plugin-for-wordpress-tutorial/step-5/ Only ...


0

Try this. In dashboard/settings/buddypress/components make sure you click the box beside account settings and save. Otherwise Delete button won’t show up!. Check in the wordpress user list. Hopefully this helps. Thanks, sharma chelluri


0

If for "all the conversations a user is in" you mean "all the conversations where a user has commented" you dont need any additional table, just a SQL to get all the posts of conversation CPT where an user commented. Here a function that should do the trick: /** * Get posts (of a given CPT) an user has commented * * @param int|object|void $user User id ...


0

If you're referring to images that are inserted into the page or post content via the editor, you could hook into the 'the_content' filter, check if the visitor is anonymous or not via is_user_logged_in(), and use a regex to remove all img tags from the_content(). I'm mobile at the moment, but I'm happy to update this a little later with some example code.


0

Have you had a look at is_user_logged_in()? If you can explain how you're serving the photos I can perhaps suggest a way to authorize some images to be shown and the rest hidden to only logged in users.


1

Since the category widget on the post page only lets you create categories and not delete them, you could just hide access to the main category editor page for this user type, and allow them to still create categories within the post editor. You could do this with CSS or javascript, something like $('ul.wp-submenu ...


0

But when I update the page it shows the previous values saved in the back-end (admin) section of wordpress. Of course, any values saved in the back end are saved correctly and displayed on the front-end. I wanted to save either way, from back-end and from front-end. Just had this problem myself. Given that the meta was in fact updating but just not ...


0

You can use wp_insert_user. Since your old database has passwords in base64, you can easily get the original password string using base64_decode. $new_user_data = array( 'user_pass' => 'password',//pass your decoded password string 'user_login' => 'username',//pass your username 'user_email' => 'email', 'first_name' ...


2

Attach a custom user meta field to all of them - for e.g. a checkbox. Then, in your template, simply query the user meta field and if it is checked, just output the shared user name instead of the user profile field you would use for other users. If you want to make sure that users can not attach themselves to that "group", you will have to wrap the ...


1

Add to your functions.php file the following code, this will hook into your admin header section and will place the style you chose accordingly to the matching site. add_action('admin_enqueue_scripts', 'my_admin_background'); function my_admin_background() { wp_enqueue_style( 'custom-style', get_template_directory_uri() . '/css/custom_script.css' ...



Top 50 recent answers are included