Dekadinious
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Can’t get admin notices to displaySolved, but there are probably better ways?
/** * Notice utility function. Adds WC_notice if not admin page, adds admin notice if admin page */ function dd_notice($message, $type, $userid) { if (is_admin()) { update_option('dd_notice', $message); update_option('dd_notice_userid', $userid); } else { wc_add_notice(__($message, 'woocommerce'), $type); } } function dd_add_notice() { if (get_option('dd_notice')) { //Get the URL of the current page $currentUrl = wp_get_referer(); //Check if URL contains query parameters and set ? or & as character if (!strpos($currentUrl, '?')) { $queryChar = '?'; } else { $queryChar = '&'; } //Notice to be added echo sprintf( '<div class="notice notice-error"><p>Notice for %s: %s</p><p><a href = "%s%sdd_remove_notice">Remove notice</a></p></div>', get_user_meta(get_option('dd_notice_userid'), 'billing_email', true), get_option('dd_notice'), $currentUrl, $queryChar ); } } add_action('admin_notices', 'dd_add_notice'); //Remove notice if remove link was clicked function dd_remove_notice() { if (isset($_GET['dd_remove_notice'])) { delete_option('dd_notice'); } } add_action('init', 'dd_remove_notice');Forum: Developing with WordPress
In reply to: Get old email from edit_user_profile_updateThanks! That will work 🙂
I am now struggling with adding notices because I have a complicated system for this… But let’s do that in another thread 🙂
Forum: Developing with WordPress
In reply to: Get old email from edit_user_profile_updateIt doesn’t seem to. Hmm, I’m stumped here.
- This reply was modified 5 years, 9 months ago by Dekadinious.
Forum: Developing with WordPress
In reply to: Get old email from edit_user_profile_updateDoes “profile_update” fire on user self-update (after clicking confirmation link), and on admin update of user?
Forum: Developing with WordPress
In reply to: Get old email from edit_user_profile_updateget_userdata() gives me the same email that is in the $_POST, so it seems the database has been updated after all.
Are there any other ways to get the old email?
Forum: Developing with WordPress
In reply to: Get old email from edit_user_profile_updateThanks!
Forum: Plugins
In reply to: [LiteSpeed Cache] Warnings from consoleThis problem disappeared by itself after some updates to Chrome without adding forms.min.js to excludes.
Forum: Plugins
In reply to: [Textmetrics] Textmetrics available to contributorsSorry for being late to the party here!
This works, but it still doesn’t hide the meta-box in Gutenberg. I did that using JavaScript, but it’s still available in the source for those who have some skills to remove CSS-rules.
Forum: Developing with WordPress
In reply to: Is there a hook after email address is verified?I mean “hookable” 🙂
Thanks for the explanation, I did not know that there were more than what was shown in the documentation online. I will be sure to check out the code also from now on!
Forum: Developing with WordPress
In reply to: Is there a hook after email address is verified?Thank you very much!
But can I add an action to any WordPress function? The codex didn’t state that this was “bookable” if you know what I mean?
Forum: Developing with WordPress
In reply to: Is there a hook after email address is verified?Well, I seem to be confused actually… How do I hook into this? Do you have any pointers? 🙂
Forum: Developing with WordPress
In reply to: Is there a hook after email address is verified?That’s a perfect solution, thanks!
Forum: Fixing WordPress
In reply to: Is it possible to add following extra function to WP?It should certainly be possible. The thing is that it needs to be maintained as the theme is updated and the theme-code is changed.
Maybe the best thing here is to use a plugin after all, and try to make that specific function as stand-alone as possible in the environment. Plugins are just “custom code” and will not add to any load time or anything like that. Plugins are often a very good option.
Stating a price would be close to impossible without looking closer at the theme and the needed functionality. The developer needs to understand exactly how it all goes together before stating a price.
In my experience, you are looking at a couple of thousand dollars if you want this done right by an experienced developer. Possibly more if you have to integrate with the Dokan API. You might get a cheaper price with an inexperienced developer, but the work often reflects the price in terms of maintainability and extendability in the future.
Sorry to hijack this, but I feel it fits here because I have the exact opposite problem. The form shows before the customer chooses the variation, and not all variations are out of stock. Therefore we need the customer to choose variation before the form appears (only on out of stock variations).
This should be an option to enable or disable in the plugin.
Forum: Plugins
In reply to: [LiteSpeed Cache] Weird javascript issue…Thank you!!
This solved all the problems even with JS-combine and minify turned on. It also solved the Analytics problem. This should probably be part of the documentation? That unexpected results may happen.