nonprofitweb
Forum Replies Created
-
Forum: Plugins
In reply to: [The Events Calendar] New Calendar View Mobile IssueThank you for the info on customizing the tooltip. I missed those templates when I was looking initially.
An example of the datepicker z-index issue can be seen here:
https://www.adventistedge.com/events/list/. I also realized it happens in regular desktop view as well.Thank you.
Forum: Plugins
In reply to: [Import and export users and customers] Send Email ActionI haven’t implemented these hooks yet but you can read more about hooks here:
https://developer.www.ads-software.com/plugins/hooks/filters/In essence, to conditionally change the subject of an email based on whether a user was added or not, it would be something like this:
function custom_csv_import_subject($subject, $headers, $data, $created){ if ($created) { //check if $created is true $subject = 'Welcome to our website'; } else $subject = 'Your account has been updated'; return $subject; } add_filter( 'acui_import_email_subject', 'custom_csv_import_subject', 10, 4 );
Hope this helps.
Forum: Plugins
In reply to: [Import and export users and customers] Non Admin User Can Delete SelfUpdate: While the above solution works in my particular use case, a more robust solution that checks against the editable roles is as follows:
// first get all roles global $wp_roles; $all_roles = $wp_roles->roles; // now remove editable roles $exclude_roles = array_diff(array_keys($all_roles), $editable_roles); // make sure administrator role is still in array. This continues current method of excluding administrator role in $args if ( !in_array('administrator', $exclude_roles )){ $exclude_roles[] = 'administrator'; } $args = array( 'fields' => array( 'ID' ), 'role__not_in' => $exclude_roles, 'exclude' => array(get_current_user_id()), );
Note that role__in can’t be used in the situation a user has multiple roles and at least one of the roles is not in the editable_roles list and at least one of the roles is in the editable_roles list. In this situation, the user would be removed even though they have a role that is not editable by the person performing the import.
Hope this is helpful.
- This reply was modified 4 years, 9 months ago by nonprofitweb. Reason: Code inclusion didn't work right
Forum: Plugins
In reply to: [Import and export users and customers] Import User with Higher RoleI went digging into the code a little bit and came up with this solution, all modifications to importer.php:
At the top where you are assigning variables, add:
$editable_roles = array_keys(get_editable_roles());
And then after line 221, after the new/modified user array of roles is defined, add the following:
if (!empty(array_diff($role, $editable_roles))) { $error_string = 'You do not have permission to assign this role'; echo '<script>alert("' . __( 'Problems with user:', 'import-users-from-csv-with-meta' ) . $username . __( ', we are going to skip. \r\nError: ', 'import-users-from-csv-with-meta') . $error_string . '");</script>'; $created = false; continue; }
I have not tested with cron or frontend but it appears to be working fine on the backend.
An additional improvement to the backend page would be to ad id’s to the form fields. This way they can be targeted through css to hide and clean up the UI for options that are not important for non administrators. I’ll be glad to do this if you like and send you my revisions.
Forum: Plugins
In reply to: [Import and export users and customers] Send Email ActionFor me, hooks to filter the email being sent when a user is added and when a user is updated would work for me.
ie:acui_update_user_email_notification
acui_new_user_email_notificationThank you for your quick response and interest in adding this functionality.
Forum: Plugins
In reply to: [Import and export users and customers] Send Email ActionI think your options are good, but how I can hook into this to use my own email content and not use your templates?
The purpose is for 2 reasons:
a) I need it easy and “dummy proof” so the person doing the import doesn’t have to change templates. It all happens automatically based on the type of user that is being added/updated
b) The content of a user updated email is different than a user added email
c) If an import contains both updates and new users (which is one thing your plugin does that others don’t!), I need to determine which message and subject content to send.For now I have worked out a solution using the wp_new_user_notification_email hook combined with a meta key & value, but it really is a work around that relies on Excel macros and is somewhat open to human error.
Not sure if I follow your clarifying question, but it did lead me to a solution. Maybe it is the best way, but if not, look forward to your reply.
I am using the restriction editor (Wp-admin –> Settings –> Content Control) to restrict pages of content. I am using the shortcode on one specific page.
Use case: A user logs in and is redirected to a landing page. On that page is content that I need visible based on the role(s) the user has.
On that landing page, I am using shortcodes to restrict content based on role. Based on your reply, I added message=”” to the shortcode and that appears to provide the intended result. Thank you.
For anyone who might come across this, choosing “ancestors of” does in fact apply the content restriction to children, grandchildren, etc. pages.
Ancestors yes, but my understanding is ancestors are typically parents, grand parents, etc.
@larrydaniele and @florianziegler, thank you for your method of removing the recaptcha. While this does stop the Google recaptcha from loading, the code to stop CF7 scripts from loading wasn’t working for me:
add_filter( 'wpcf7_load_js', '__return_false' );
I’m guessing the load order of wp_enqueue_scripts comes after wpcf7_load_js, even adding a priority to the action. What I ended up doing is moving the wpcf7_load_js block outside of the function.
For additional optimization, you can also disable CF7 css from loading and enqueue that only on pages with CF7 shortcode.
Forum: Plugins
In reply to: [Weight Tracker] Add Entry UXThank you!
Forum: Plugins
In reply to: [Weight Tracker] Gateway TimeoutThank you!
Forum: Plugins
In reply to: [Weight Tracker] Table Date BugThank you. Created Pull Request. I applied the change to the minified version, but I’m guessing it will also need to be applied to the unminified file.
Forum: Plugins
In reply to: [Weight Tracker] Table Date BugI finally dug into this myself. The issue is with jQuery dates and how it parses the info if no timezone is set. To fix this, in data.footable.min.js, instead of getDate(), it should be getUTCDate(). Instead of reworking the whole function, I also applied this change to the month and year variables.
Hopefully this can be fixed in an upcoming version/update!
Forum: Plugins
In reply to: [Weight Tracker] Table Date BugHello, is there any update on this? This issue is causing a lot of confusion for our users.