How to add an extra button on woocommerce shop page and use it to send the product info with image in a mail? [closed]
How to add an extra button on woocommerce shop page and use it to send the product info with image in a mail? [closed]
How to add an extra button on woocommerce shop page and use it to send the product info with image in a mail? [closed]
Recently I had to tackle the same issue. Instead of setting the capability permanently for editors, I used user_has_cap filter to allow access dynamically. add_filter(‘user_has_cap’, ‘editor_allow_edit_menu’, 10, 4); function editor_allow_edit_menu($allcaps, $caps, $args, $user) { if ( ! isset( $allcaps[‘editor’] ) || true !== $allcaps[‘editor’] ) { return $allcaps; } global $pagenow; // new items are … Read more
I would suggest having a generic form that can be completed by the public on the front end. The submission of the form would would generate the post, saving a random string in its meta data (the password), and send an email containing a link to /?p=PAGEID&post_id=THE_POST_ID&pw=THE_PASSWORD. THE_POST_ID and THE_PASSWORD are those values from the … Read more
In a similar use case scenario, I had a client with 5 locations which could be assigned to the user. This will need to be changed for you because it’s based on location being assigned to both a user and a post, whereas you’re just going to assigning entire posts to users rather than matching … Read more
How to set individual capability of post type in individual category
The Download stats Metabox has a check for view_product_stats capability in EDD codes. in /easy-digital-downloads/includes/admin/downloads/metabox.php Line:42 if ( current_user_can( ‘view_product_stats’, get_the_ID() ) ) { /** Product Stats */ add_meta_box( ‘edd_product_stats’, sprintf( __( ‘%1$s Stats’, ‘easy-digital-downloads’ ), edd_get_label_singular(), edd_get_label_plural() ), ‘edd_render_stats_meta_box’, $post_type, ‘side’, ‘high’ ); } You can simply remove the view_product_stats capability for Your special … Read more
Adding user capabilities for a custom taxonomy of a custom post type for a custom user
My subscriber has the “edit comment” capability but can’t edit comment
There are a couple of “timing” issues you’re running into here. When you’re calling wp_get_current_user() this isn’t really available at the moment of logging in, so to capture the logging-in user, you have to use a slightly different approach. The same is with logout, as it uses the same method of getting the current user. … Read more
Add menu items/actions for multisite users who are registered on the network but do not have a role or capability in any sites