Paypal API and WordPress

Try working through the source code of a plugin such as PayPal Framework. From your question, the WP side is fairly trivial, but you should study general PayPal tutorials to understand the API, for example, here’s the first search result from Google for PayPal API tutorial: Using PayPal’s IPN with PHP Also some additional helpful … Read more

add_cap for editor but no admin role

Giving the capability to delete and edit users would compromise your security, as then the editors would have the ability to modify your profile too. What you could do is just give the create_users capability to the editors. But the users thus created would be allotted “Subscribers” role by deafult. EDIT: Try the following code … Read more

Only Admin can Edit, Delete or Update

Summary of Roles: Super Admin – Someone with access to the blog network administration features controlling the entire network (See Create a Network). Administrator – Somebody who has access to all the administration features Editor – Somebody who can publish and manage posts and pages as well as manage other users’ posts, etc. Author – … Read more

How can I manage and limit disk usage for each author?

Okey so this is just an example how you can archive this.. First change the upload directory to the current users username. eg uploads/admin function wpse_16722_type_upload_dir( $args ) { // Get current user data $current_user = wp_get_current_user(); // Make upload dir to current username $newdir=”https://wordpress.stackexchange.com/” . $current_user->user_login; $args[‘path’] = str_replace( $args[‘subdir’], ”, $args[‘path’] ); //remove … Read more

Plugin creation – how to add user rights?

Here how register a role specifically for a plugin and add plugin specific capabilities to selected core roles function my_plugin_install() { // add a new role for plugin with some capabilities add_role(‘my_plugin_role’, ‘My Plugin Role’, array( ‘manage_my_plugin’ => true, // plugin specific capability ‘read’ => true // core capability )); // add plugin capabilities for … Read more

How to get a users list by who created them?

I’ve found it. /*** Adding extra field to get the the user who creates the another user during ADD NEW USER ***/ function custom_user_profile_fields($user){ if(is_object($user)) $created_by = esc_attr( get_the_author_meta( ‘created_by’, $user->ID ) ); else $created_by = null; ?> <h3>Extra profile information</h3> <table class=”form-table”> <tr> <th><label for=”created_by”>Created By</label></th> <td> <input type=”text” class=”regular-text” name=”created_by” value=”<?php echo $created_by; … Read more

How do I apply/target CSS to a specific user role or roles?

If you’re looking for a way to add the roles into the body class, like here: <body class=” … role-administrator role-jedi role-knight … “> then you could try the following: add_filter( ‘body_class’, function( $classes ) { if( is_user_logged_in() ) { $classes = array_merge( (array) $classes, array_map( function( $class ) { return ‘role-‘ . $class; // … Read more

Get and display a user’s profile info?

You could create a custom template page for this purpose and take advantage of the appropriate class provided by WordPress itself: WP_User_Query Eg: // Create the WP_User_Query object $wp_user_query = new WP_User_Query(array ( ‘role’ => ‘Manager’, ‘order’ => ‘ASC’, ‘orderby’ => ‘display_name’ )); // Get the results $managers = $wp_user_query->get_results(); // Looping managers if (!empty($managers)) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)