Beef Supreme
Forum Replies Created
-
Forum: Plugins
In reply to: [KIA Subtitle] Unexpected error when activated for custom post typeThank you, adding “custom-fields” worked for me. With your new update it seems the subtitle is not shown, when you don’t have custom-fields in your custom post, which I guess is fine.
Forum: Plugins
In reply to: [KIA Subtitle] Unexpected error when activated for custom post typeActually the error still persists. After doing all the above and then trying to add a subtitle, I still get the error.
This happens even with all other plugins disabled and switching to the twentytwenty theme (with my custom post type code in the functions.php of that theme). It happens with any browser.
I even created a completely new WordPress installation with nothing else installed, just the KIA subtitle plugin and the twentytwenty theme and get the error.
So actually I think you should be able to reproduce this, if you use my code for the custom post type and use it in the twentytwenty theme.
I can give you access to that said installation, if you want to investigate it.
- This reply was modified 4 years, 4 months ago by Beef Supreme.
Do I have to pass the
edit_field
method anything else other than $key and $data in order for the values to be correct?Forum: Plugins
In reply to: [KIA Subtitle] Unexpected error when activated for custom post typeI disabled every plugin as you suggested and also changed the theme to twentytwenty. First this didn’t do anything about the error. But then I used the Chrome incognito mode to edit a recipe. The error was gone. Also when I used Firefox instead of Chrome.
I then disabled all plugins in Chrome and deleted all the browser data. Now the error was also gone in Chrome without incognito. Then I reenabled all Chrome plugins, WP plugins and switched back to my theme. Still the error is gone.
Don’t know what happened there, something must have been saved in the browser cache that broke everything. Before I did all this, I clicked on “copy error” from the error message and this is what it reads:
Error: An error occurred while running 'mapSelect': Cannot read property 'kia_subtitle' of undefined The error may be correlated with this previous error: TypeError: Cannot read property 'kia_subtitle' of undefined at https://mywebsite.de/wp-content/plugins/kia-subtitle/js/dist/index.js?ver=3.0.0:1:1618 at Object.current (https://mywebsite.de/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2:28125) at e (https://mywebsite.de/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2:27752) at https://mywebsite.de/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2:27861 at Vb (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:104:431) at Ti (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:148:85) at unstable_runWithPriority (https://mywebsite.de/wp-includes/js/dist/vendor/react.min.js?ver=16.9.0:26:340) at Ma (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52:280) at Ia (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:140:407) at ze (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118:14) Original stack trace: at Fe (https://mywebsite.de/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2:27544) at https://mywebsite.de/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2:28100 at je (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:78:476) at qe (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:89:115) at ph (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:216:489) at lh (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:126:409) at O (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:121:71) at ze (https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118:14) at https://mywebsite.de/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53:49 at unstable_runWithPriority (https://mywebsite.de/wp-includes/js/dist/vendor/react.min.js?ver=16.9.0:26:340)
- This reply was modified 4 years, 4 months ago by Beef Supreme.
For some reason, the select options in the HTML of the account form only have numerical values, like this:
<option value="0" data-select2-id="16">City</option>
While in the registration, it looks like this:
<option value="City" data-select2-id="14">City</option>
The output from the account form is generated by the UM method “edit_field”. I just give it the $data array related to the field (as you can see in my code), which looks correct to me, especially since it correctly identifies the field as “select” type:
krumo($data); (Array, 9 elements) type (String, 6 characters ) select title (String, 15 characters ) Therapiezentrum metakey (String, 14 characters ) therapy_center options (Array, 5 elements) visibility (String, 3 characters ) all label (String, 15 characters ) Therapiezentrum public (String, 1 characters ) 1 required (String, 1 characters ) 1 editable (String, 1 characters ) 1
I don’t know what the edit_field method does inside. It’s several hundred lines of code, but it returns the HTML code with the value as numbers instead of the actual values.
- This reply was modified 4 years, 4 months ago by Beef Supreme.
- This reply was modified 4 years, 4 months ago by Beef Supreme.
Hi @champsupertramp,
I use this code (the code from my first post is the wrong part of the code): I just create a field in the form editor called “therapy_center” (metakey) and then I add the field with said code:
/** * Add extra fields to user account tab */ function showUMExtraFields() { $id = um_user('ID'); $output = ''; $names = array('si_gender', 'therapy_center'); $fields = array(); foreach ($names as $name) $fields[$name] = UM()->builtin()->get_specific_field($name); $fields = apply_filters('um_account_secure_fields', $fields, $id); foreach ($fields as $key => $data) $output .= UM()->fields()->edit_field($key, $data); echo $output; } add_action('um_after_account_general', 'showUMExtraFields', 100); /** * Get content for extra fields in user account tab */ function getUMFormData() { $id = um_user('ID'); $names = array('si_gender', 'therapy_center'); foreach ($names as $name) update_user_meta($id, $name, $_POST[$name]); } add_action('um_account_pre_update_profile', 'getUMFormData', 100);
The code hooks into two filters, that the Ultimate Member plugin provides, um_after_account_general and um_account_pre_update_profile.
- This reply was modified 4 years, 4 months ago by Beef Supreme.
- This reply was modified 4 years, 4 months ago by Beef Supreme.
I finally figured out how it works. So if anyone else has the same issue, I added the following code, which I found in this thread:
/** * Add extra fields to user account tab */ function showUMExtraFields() { $id = um_user('ID'); $output = ''; $names = array('gender', 'therapy_center'); $fields = array(); foreach ($names as $name) $fields[$name] = UM()->builtin()->get_specific_field($name); $fields = apply_filters('um_account_secure_fields', $fields, $id); foreach ($fields as $key => $data) $output .= UM()->fields()->edit_field($key, $data); echo $output; } add_action('um_after_account_general', 'showUMExtraFields', 100); /** * Get content for extra fields in user account tab */ function getUMFormData() { $id = um_user('ID'); $names = array('gender', 'therapy_center'); foreach ($names as $name) update_user_meta($id, $name, $_POST[$name]); } add_action('um_account_pre_update_profile', 'getUMFormData', 100);
You can also use this for custom fields, that are not from the default set of fields. You will have to create the field and then use the meta key you specified in the form editor.
The solution from the link above doesn’t seem to work anymore. So I used this solution:
https://www.champ.ninja/2020/05/add-a-custom-account-tab-with-profile-form-fields/#comment-35Now I have a custom tab on my profile page where can add my own profile form. I used the default fields user_login, first_name, last_name, user_email as well as my own custom field user_title.
The problem now is, user_login and user_email don’t show up in my form. What could be the reason for this? Also when I click save, I get the error message “This is not possible for security reasons”. I already checked for any plugin/theme compatibility issues, but there are none.
The only problem with above code is, that even though I get the field I desired, I can’t save the field. Saving doesn’t seem to work.
This does not work, because no normal form is displayed on the profile page. The profile page that the plugin created after installation had this shortcode in it:
[ultimatemember_account]It’s not a normal form that you can edit in the form editor, right?
Edit: I figured it out. It seems I can do it with this code:
https://hookr.io/filters/um_account_secure_fields/- This reply was modified 4 years, 4 months ago by Beef Supreme.
- This reply was modified 4 years, 4 months ago by Beef Supreme.
- This reply was modified 4 years, 4 months ago by Beef Supreme.
Hi @webtoffee,
yes, I tested it with incognito mode and also with other browsers I never use. Are you saying that this is no behavior I can set in the options?
Forum: Fixing WordPress
In reply to: Deferring YouTube Videos with GutenbergI actually did it with a filter now, as you suggested. I did surpass my previous Regex skills there I guess, but it works like a charm!
Forum: Plugins
In reply to: [Fast Velocity Minify] jQuery not definedThank you for your detailed answer. It helped me understand more about the problem.
The parent theme I’m using seems to be causing some issues, which makes it not work well with the JS handling of FVM. Namely, it deregisteres “jquery” (which is why I reregistered another version) and it also puts the “async defer” in any added JS script, so it also puts it on my registered version of jQuery.
My theme and FVM seem to not work well together. I’m aware that the theme I’m using is not super professionally made and doesn’t meet all the standards, but I can only use this one, because it’s specially made for my purpose. So I’ll simply deactivate the JS handling completely by FVM, I guess that should work for now.
Can someone help me with this? If it’s a matter of adding CSS or JS, that’s no problem, I have set up a child theme and I have FTP access. Coming up with the correct code just seems a bit complicated and if there were a theme option to do this, I would of course prefer that.
Forum: Plugins
In reply to: [Contact Form 7] Send autoresponder to clientHello Takayuki,
thank you for the link! The problem was, that my field was required, but a text field instead of email.
[text* your-email]
Changing to this solved it:
[email* your-email]