How do I set a maximum upload size for a specific user role (Editor)
How do I set a maximum upload size for a specific user role (Editor)
How do I set a maximum upload size for a specific user role (Editor)
You can use the add_post_meta and update_post_meta filters to accomplish this. If you return anything other than null in these filters the post meta will not be saved. add_filter(‘add_post_metadata’, ‘check_metadata’, 10, 5); function check_metadata($check, $object_id, $meta_key, $meta_value, $prev_value){ /*** Check if the metadata exists via sql ***/ if($exists) { /*** Notify you or something ***/ … Read more
I ended up just adding a second hook to remove_user_role using the same function add_action( ‘remove_user_role’, ‘update_user_department’, 10, 1 );
I’d suggest editing your single template, instead of functions.php. So, in a child theme, edit single.php and whatever other templates your theme uses for the CPTs, at the location where it outputs the author’s name. Where the author’s name is being displayed, you can then also grab their user meta (gender and country) and output … Read more
Is there a reason why you don’t just want to make the “author archive” a page and list them all on the page with a shortcode ? If that’s an option, simply put your single author template in author.php Author templates – Template hierarchy If not, you could take your current template (that you’ve put … Read more
It’s an weird one. Go to the database and check users table to see if the deleted users are there or not. If they are there, delete the unwanted users except the admin.
You should be able to use get_current_user_id(). Note that it will return ‘0’ if the user isn’t logged in. <a href=”https://example.com/?user_id=<?php echo get_current_user_id(); ?>”>Link</a> Update 2: Got bored, made a plugin: https://github.com/AndyMardell/append-user-id/releases/tag/v1.0.0-alpha Download the zip and install 🙂 Submitted to WordPress but it’s still under review. Installation and Usage: https://github.com/AndyMardell/append-user-id#installation Update: you won’t be able … Read more
How can i add user display name drop down menu in frontend?
First of all, as you can see in the documentation, the function <?php // is deprecated get_currentuserinfo(); has been deprecated. So, you should not build new projects with it. Also, you are not declaring a variable for the function get_currentuserinfo, meaning that the result of that function is floating around somewhere in the air, not … Read more
You should use append paginate_comments_links() into $output like so: add_shortcode ( ‘show_recent_comments’, ‘show_recent_comments_handler’ ); function show_recent_comments_handler( $atts, $content = null ) { extract( shortcode_atts( array( “count” => 20, “pretty_permalink” => 0 ), $atts )); $output=””; // this holds the output if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $args = array( ‘user_id’ => $current_user->ID, ‘number’ … Read more