Josh Visick
Forum Replies Created
-
Thanks for the response @wfadam
I did try that whitelist rule and unfortunately it doesn’t work.
It sounds like there is no option for wildcards in the params then.
We have had learning mode going for a while and it continues to pick up every variation but I don’t believe it can tell that we want all ACF related calls to be ok. As soon as we turn off learning mode it will flag a new request on a page setting that hasn’t been touched.
Unless you have any other suggestions I think there is no way WF can accommodate this scenario. It would be a great feature to have wildcards in whitelist rules!
Thank you,
JoshForum: Plugins
In reply to: [Safe SVG] Width/height now set as attributesHi Jay,
I came across this thread because I am trying to get svgs to show width/height attributes when outputting an ACF gallery. I see there is the method to add dimensions when using
the wp_get_attachment_image()
but whenwp_get_attachment_image_src()
is called the ‘one_pixel_fix’ method just sets the dimensions to false? Is there a reason the same dimensions aren’t set here as well? That would be what I need to get dimensions in ACF since it uses the _src() function.Thanks
- This reply was modified 5 years, 11 months ago by Josh Visick.
Forum: Hacks
In reply to: action set_user_role missing additional rolesYour welcome!
Forum: Hacks
In reply to: action set_user_role missing additional rolesHey there,
This question might need some clarification but I’ll take a first stab at what I think you are asking. The set_user_role action is called at the end of the encompassing set_role() function which removes all previous roles and sets the new role passed to it. Your SQL query reflects that the DB is indeed cleared of all caps except the new single role added at the point this action is called.
I believe The WPFront User Role Editor plugin manages additional roles by using the above set_role() function to first set the primary role, and then iteratively calls the add_role() function to add back all secondary roles associated with a user.(which appends, rather than replaces the existing roles) This would account for why the later query appears to have all the roles in it again. As a test, you could hook into the related add_user_role action called at the end of the add_role() function to see the other roles added one by one.
Depending on what you need to do, you may be able to get all the roles by using the $old_roles parameter that is passed from the set_user_role action. This is an array of all the roles that were just removed. It is important to note though that this won’t reflect different roles were added back than were before the roles were updated. (Like through the User Role Editor plugin). If you truly need the current roles then you might need to find a different spot to hook into after the User Role Editor plugin has finished executing all it’s code.
Forum: Plugins
In reply to: [WordPress Widgets Shortcode] it does not work! pity!I initially ran into problems with it working too. The screenshots are confusing because they show adding the name shown in the wp dashboard, but it actually needs to refer to the id, which is often different. For instance, on wp default themes, “Primary Sidebar” is “sidebar-1” and “Secondary Sidebar” would be “sidebar-2”. Once I plugged in the id it worked great.
Hi Sayontan,
Sorry I didn’t respond sooner. I just got around to updating this plugin. I like the check for current content solution. However, there still needs to be a comma added to separate the stylesheet that WP passes to it and $content_css like so:
if (isset($opt[‘content_css’])) {
$opt[‘content_css’] .= ‘,’ .$content_css;
}Hope that makes sense,
JoshHi Sayontan,
Thanks for the quick response. A filter would be a cool addition too. Though in this case, I’m not extending the use of the plugin, but keeping it from breaking other WP functionality. I think the plugin would be better if by default it added to, rather overwrote URLs the WP core places in content_css.
Thanks,
Josh