Can I do something like this to add a capability after someone purchases a product in my child's function file? Please note, I'm using s2member and woocommerce, and I am a newbie. add_action( 'cap_added', 'change_user_cap_with_purchase', 1 ); function change_user_cap_with_purchase ( $order_id ){ $order = wc_get_order( $order_id ); foreach( $order->get_items() as $item ) { // Product ID if ( $item['product_id'] == 999 ) { function add_cap_to_role() { $customer = get_role('customer'); $customer->add_cap('cst11'); } } }
How to mask external download links to be only accessible by logged-in users? Like the direct download link example: www.example.com/direct-download-link1 We want to mask it like: www.ourwebsite.com/direct-download-link1 and this above link should only be accessible by logged-in members. How to do?
With the s2member plugin, whenever you want new posts protected, you have to manually go into the plugin options and add the post ID to a list of comma separated post IDs. When you save anything at all in the options, the plugin saves it all in a gigantic record in the wp_options table under the option name, ws_plugin__s2member_options. So I figured I would write a function that grabs the post ID and updates that record. It works fine except …
I want to create membership website, as a form of passive income and also a way of improving my skills (I'm a UI/UX designer and front-end developer). The problem is that in theory, I would like it to grow to an almost 6 figure income per year and I don't have experience making these type of "complex" websites. My main fear is the website security. I'm good at Wordpress, well to some extent, but I can't write complex PHP websites …
I am using s2member pro plugin. I asked in plugin support too but no response tell yet. I want to send json data to a url using php, the server is located some where else forexample(//123.456.78,58:44005)/singleMethodname=JSONService___myfunctionofuserRegister() when he/she registers and or make any changes to their profile. s2member is suggesting this but its not what i need https://s2member.com/kb-article/building-an-api-notification-handler-webhook/ My code is <?php header('Content-Type: application/json'); $fields = get_s2member_custom_fields(); $p_iva_field = $fields["p_iva"]["config"]; $user_detail[]= array( $p_iva_field, "user_login" => get_user_field ("user_login"), "user_email" => get_user_field …
here is the thing that i want to achive: s2_member_level0 has the second role "customer" - when upgrading the account via shortcode provided by s2member the account should upgrade to s2member_level1 and change it's second role to "vendor" and s2_member_level1 has the second role "vendor" - when downgrading the account via shortcode provided by s2member the account should downgrade itself to s2member_level0 and change it's second role back to "customer" i'm setting the roles for the different accounts while they …
i have a s2member free registration form on my website, but my problem is this, the s2member captcha recaptcha thing is out of my box on mobile i want to make it responsive but i am not sure how to. i looked into the authnet-registration-form.php and i could not find the HTML for the captcha i googled it but they did not have any thing on the subject. i tryed doing some CSS but it does nothing like for example …
I develop wordpress membership sites and I never enable any caching plugin on those sites. I presume, if I enable caching then members might have some issues due to cache or there might be an issue during checkout process. I have never tried this though: The membership plugins I use are: Wishlist Members, Digital Access Pass (DAP), OptimizeMember Similarly cache plugins are: Wp Super Cache, WP Total Cache I need expert advice on this matter. Whether should I enable cache …
I want to build the home page to show just a login box when logged out and the normal home page when logged in. Alternatively i can also allow redirection to another page when a logged in user clicks home. I am using WP membership plugin for membership access. Thanks
I have a site that allows user registration and login but not via the standard wp-login.php etc - it's all done within the theme and a bit of s2member as well. I've been encountering problems where, with page caching enabled, my code shows either a login button or a 'your account' button, showing cached material. I use the below code to decide which button is shown depending on whether the right user level member is logged in. <?php if (current_user_is("s2member_level1")) …
I have quite a peculiar scenario. I have one WordPress site (Site A) where I have a large amount of users that have registered and I use the s2member plugin to subscribe these members to allow access to parts of the website. I want to release another product that users need to subscribe separately for but a limitation with the s2member plugin means that I can't have two subscriptions for one user at the same time. I've come to the …
I'm trying to interpret this action hook name: ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts What is meaning of BEFORE and AFTER in this hook name? Do the underscores mean anything? It seems that the hook name contains two function names, sc_authnet_form and shortcode_atts, that are connected by BEFORE and AFTER words.
Using the S2member plugin, a meta_key for the last-payment-time is automatically stored in WordPress DB under table wp_usermeta (custom field is called wp_meds2member_last_payment_time). From wp_usermeta, the column called meta_key has a value 'wp_meds2member_last_payment_time'. But the content I'm trying to collect is its meta_value equivalent. I didn't find how to call this meta_value to the function below where I use the date of the last payment time to start a new count of the posts created by the user. function check_post_limit(){ …
I noticed that my plugin doesnt work when s2member is activated but unfortunately it is needed for the site functionality, i did some research if I comment out this line on hooks.inc.php then my plugin works, how can I remove it from my plugin ? because once s2member is updated it removes my // and we are back with the same issue. this is the line: //add_action("wp_login", "c_ws_plugin__s2member_login_redirects::login_redirect", 10, 2); I looked up the codex and found this function : …
I'm using S2Member + Buddypress on a compatible template. I have 8 menu items and am using the "Menu Items Visibility Control" to limit the 7th for view only to current_user_is(s2member_level1) | in_array('administrator', $GLOBALS['current_user']->roles) This visibility is working correctly. I'm in need of a way to create a custom menu item that will link to a page containing the following structure: http://localhost/%%current_user_nicename%%/events/my-events/?action=edit I don't know how to incorporate the current user name into the URL. I've come across this post:. …
I am using the following action; add_action( 'user_new_form', 'epx_add_user_form_to_admin_area',489); function epx_add_user_form_to_admin_area($current){ $current .= 'this is a test'; echo $current; } The issue is the minute i put that in s2member which displays a load of options on the add user page in the admin not to display ^^That is when i have not got anything that whats s2 member shows ^^That is when i use the code above. It is like it is overwritten what s2member wants to display. What …
I'm using wordpress multisite. I installed s2member plugin. s2member plugin creates 4 extra level. I mean like level1,level2,.... I'm displaying content using this code if (current_user_can("access_s2member_level1")){ the_content(); } Here level1 member is premium member. If the user is not a premium member then the content will be hidden. My problem I created separate site for each niche. I'm the only admin for all sites. My goal is user buys the premium account in my main site and access all my …
I know the built in user manager doesn't allow a user to see what her current pass is, just recover / reset it via email or write in a new one in the admin but I am looking for a plugin or other method to circumvent this and allows for the creation of a user profile page that permits a user to see her current password in a field and update it form there, if they wish. I realize standard …
so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", "c_ws_plugin__s2member_login_redirects::login_redirect", 10, 2); and the custom plugin is using the same add action : add_action( 'wp_login', array(&$this, 'login_success') , 100); it didnt have any priority which is by default 10. so I changed it to 100 to see if it will resolve the issue but it did not. If I …
I have been working on Developing a Tutorial site. I am using WordPress, ACF, s2member, amazon s3 & cloudfront and JW Player. I have integrated amazon cloudfront with s2member but now I am having problem to play video in JW Player. I actually want to open the video player in a new window. I am going to use a custom post type for tutorials. Then custom field for Video name & links. Can anybody help me find a way to …