Allow users to manage some options without granting ‘manage_options’ capability
Allow users to manage some options without granting ‘manage_options’ capability
Allow users to manage some options without granting ‘manage_options’ capability
First, you need to ensure that your count($args[‘options’] is actually 1. Check the following example: You can see that when I print_r($args[‘options’]), I got 4 elements, so count($args[‘options’] here is 4. But if you look at the dropdown beneath it, you see that it only has 1 option. Why? Because variations (and their attributes) that … Read more
The $option_group parameter of register_setting should match the $option_group parameter of settings_fields, which is typically used as part of creating a custom settings page. When you use register settings with register_setting(), your registered settings are added to a global variable of allowed options, where they are grouped by the $option_group parameter. When you submit your … Read more
Now, do not ask me why, but the UPLOADS constant the upload_path option seem to work different. While declaring define( ‘UPLOADS’, ‘../uploads’ ); generates this: https://staging.mywebsite.com/core/../uploads/2024/02/image.png Removing that declaration and filling the upload_path option instead with the same value ../uploads gives a different result: https://staging.mywebsite.com/uploads/2024/02/image.png with the images being uploaded in the path I wanted … Read more
Recommend using htaccess to take care of SSL redirects as needed. Will prevent ‘mixed content’ errors. I don’t think WP does any redirects, other than to get the content. If your settings have non-SSL, that’s what people will get. Using htaccess will prevent problems.
How to disable the PDF preview in the file block by default
You can use update_user_option to update user options. Read more here: https://developer.wordpress.org/reference/functions/update_user_option/
On the page edit screen, Quick Edit the existing page and change the slug to something else temporarily. Then go and save your permalinks. Once that works you can go back and change the page’s slug back to blog.
Ok, I managed to get this far and hope it helps someone else a bit… so I solved the non-logged-in user issue like this (in theme functions.php or in my case my plugin functions) function first_visit(){ $ip = $_SERVER[‘REMOTE_ADDR’]; $value = get_option($ip); if ($value == ”) { update_option($ip,1); // test $affiliate = basename($_SERVER[‘REQUEST_URI’]); // in … Read more
What setting can I change as my email forms don’t work with some phones or ESIMs?