Adding admin for specific users

You can use add_role function : add_role( $role, $display_name, $capabilities ); Just set your custom values as you wish : add_role(‘basic_contributor’, ‘Basic Contributor’, array( ‘read’ => true, // True allows that capability ‘edit_posts’ => true, ‘delete_posts’ => false, // Use false to explicitly deny )); Plugin : https://wordpress.org/plugins/user-role-editor/

wordpress ajax return 0

So, if you want it to fire on the front-end for both visitors users and logged-in users, you can do this: add_action( ‘wp_ajax_my_action’, ‘my_action_callback’ ); add_action( ‘wp_ajax_nopriv_my_action’, ‘my_action_callback’ ); Example add_action( ‘wp_ajax_GetPostMedia’, ‘GetPostMedia’ ); add_action( ‘wp_ajax_nopriv_GetPostMedia’, ‘GetPostMedia’ );

Delete all blogs on multisite

I was able to get a work around in place. Since I was deleting all blogs with no user interaction. I created two mysql queries and ran them. The first was to drop all tables associated with the given $blog_id the second was to remove that row from the wp_blogs table. $blogs = wp_get_sites( array(‘limit’ … Read more

‘Conflict’ with action deleted_post and is_admin()

More importantly you should notice what link is produced by get_delete_post_link(). It’s an admin link is_admin() check will be always true. Instead you need something else that helps match the request. Try adding and query arg to your delete link. add_query_arg( ‘origin’, ‘fe’, get_delete_post_link( get_the_ID() ) ); then in the action add_action(‘deleted_post’, ‘woffice_trashed_post_handler’, 10); function … Read more

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