Hi. Great plugin, thank you very much.
I’ve made a few tests and could not get it to work with WordPress multisite. The attributes box simply doesn’t show. It works fine with another site with the same plugins that doesn’t use multisite.
It’s not a unfiltered_html permissions issue, because in this site administrators do have that permission enabled.
Is this limitation something you have identified? Does it has a solution?
All the best and thank you very much.
]]>We have been using this for over a year and in one of the recent updates our editors lost access to the tool. Admins have no issues, but they are not normally responsible for the content. Is this a known issue? Is there a way to troubleshoot it to see why. This is in a multisite environment running current versions of everything.
]]>I am getting the occasional fatal error using litespeed cache and this plugin.
It looks like liespped calls pre_kses very early and the sanitize_attributes function which is hooked to that action filter then causes the following fatal error: PHP Fatal error: Uncaught Error: Undefined constant “SECURE_AUTH_COOKIE”
This can be prevented by amending the function to instead be:
]]>
/**
* StripsattributesForBlocks
block attribute when the current user doesn't haveunfiltered_html
capabilities.
*
* @param string $content Content to filter through KSES.
*/
function sanitize_attributes($content) {
if (!defined('SECURE_AUTH_COOKIE')) {
require_once(ABSPATH . WPINC . '/default-constants.php');
}
if(!function_exists('wp_get_current_user')) {
require ABSPATH . WPINC . '/pluggable.php';
}
hello and thanks for your plugin
I use it in some sites.
Now I am using it with dokan-lite and after updating i get this error
Fatal error: Uncaught Error: Call to undefined function wp_get_current_user() in /var/www/html/mysite.test/web/wp-includes/capabilities.php:877 Stack trace: #0 /var/www/html/
mysite.test
/web/wp-content/plugins/attributes-for-blocks/attributes-for-blocks.php(258): current_user_can() #1 /var/www/html/mysite.test
/web/wp-includes/class-wp-hook.php(326): wsd\afb\sanitize_attributes() #2 /var/www/html/mysite.test
/web/wp-includes/plugin.php(205): WP_Hook->apply_filters() #3 /var/www/html/mysite.test
/web/wp-includes/kses.php(946): apply_filters() #4 /var/www/html/mysite.test
/web/wp-includes/kses.php(754): wp_kses_hook() #5 /var/www/html/mysite.test
/web/wp-admin/includes/plugin.php(188): wp_kses() #6 /var/www/html/mysite.test
/web/wp-admin/includes/plugin.php(114): _get_plugin_data_markup_translate() #7 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/vendor/appsero/client/src/Client.php(194): get_plugin_data() #8 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/vendor/appsero/client/src/Client.php(107): Appsero\Client->set_basename_and_slug() #9 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/includes/Tracker.php(39): Appsero\Client->__construct() #10 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/includes/Tracker.php(28): WeDevs\Dokan\Tracker->appsero_init_tracker_dokan() #11 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/dokan.php(527): WeDevs\Dokan\Tracker->__construct() #12 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/dokan.php(124): WeDevs_Dokan->init_appsero_tracker() #13 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/dokan.php(137): WeDevs_Dokan->__construct() #14 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/dokan.php(591): WeDevs_Dokan::init() #15 /var/www/html/mysite.test
/web/wp-content/plugins/dokan-lite/dokan.php(595): dokan() #16 /var/www/html/mysite.test
web/wp-settings.php(522): include_once('...') #17 /var/www/html/mysite.
test/web/wp-config.php(106): require_once('...') #18 /var/www/html/mysite.test
/web/wp-load.php(50): require_once('...') #19 /var/www/html/mysite.test
/web/wp-blog-header.php(13): require_once('...') #20 /var/www/html/mysite.test
/web/index.php(17): require('...') #21 {main} thrown in /var/www/html/mysite.test
/web/wp-includes/capabilities.php on line 877
This is a nice plugin! Is there a way to add dynamic values to the newly added attribute?
Say I want the value to be the post title, instead of typing in the post title manually, is there a way to dynamically insert the post title?
Hi! GREAT plugin!
However, if someone needs to add an attribute name without a value, it adds a default value of “1”. Would it be possible not to add that? I tried to add 2 properties separated by a space(prop1 prop2) and give value only to the last one but it does not work.
Thanks!
]]>I have a policy that when a plugin has not been updated in 12 months, it has to go. I know I am only one person, but I suspect others do something similar. This is a valuable plugin, and I would hate to remove it. Is there any chance an update is coming soon?
]]>I would like to see the JS source code. And you are actually required to include it.
If you have Git repo that would be OK with me as well, but as mentioned above you must include it in the WP.org SVN anyway.
]]>Hi, your plugin is almost what I am looking for!
Would it be too hard to add some functionality for creating Global attributes for blocks that will be used in ALL posts without recreating the same attribute by hand for each new block?
Example:
For Pinterest, all images should have [data-pin-description=””] and [data-pin-title=””] attributes, or in many cases other attributes are used very frequently (id, rel, etc.)
Please, let me know if it’s something that can be done by users like myself (I have a medium-level experience with PHP,JS but an absolute zero in WP programming.
Thank you!!!
]]>Hi mate!
First of all I would like to thank you for this awesome plugin, really cool!
But I have 1 question. I’m trying to use your plugin to set the settings for the Slick Slider trough the data-attribute ‘data-slick’. (Here you can see how this works: https://kenwheeler.github.io/slick/).
So I’m adding the following data-attribute to my Post Template core/block: ‘data-slick’. And I insert the following code inside the input field: {“slidesToShow”: 4, “slidesToScroll”: 4}.
On frontend this results in: data-slick="{"slidesToShow": 4, "slidesToScroll": 4}"
I tried all different kind of settings, but I can’t get it working.
Could you please help?
Thanks already!
Kind Regards, Nick
]]>Hello – foremost, thank you for this helpful plugin!
I’ve experienced a possible bug when attempting to apply attributes to IMAGE blocks.
I added the following attributes to a paragraph block:
And the <p>
tag was accurately modified to be <p data-rellax-speed="1" data-rellax-percentage="0.5">
on the front-end.
Then, I added the following attributes to an image block:
But, on the front-end, the <figure>
tag had duplicate instance of each value, resulting in <figure class="wp-block-image size-large" sample-attribute="123 123" data-rellax-speed="1 1">
I performed this test on a basic install of WordPress (latest) with the “Twenty Twenty-Two” theme (latest) after experiencing the same issue on another site. (both sites are local, so I can’t provide a live example)
Thanks again for your work on this appreciated plugin!
]]>In WP 6.0-beta2 editor throws fatal JS errors when this plugin is active. Editor loads fine when just this plugin is deactivated.
]]>I’m curious if it would be possible to add attributes to the elements nested within blocks, based on which block it was. The specific use case for this I’m looking for is to be able to add a ‘download’ attribute to the anchor element within a button block, though it may be something to consider for other blocks. Thanks!
]]>Hi,
I have a problem after installing Attributes for Blocks Plugin. pods Plugin begin to give me Warning but after Deactivating everything is back to normal.
here is the Warning.
( ! ) Warning: trim() expects parameter 1 to be string, array given in /home/shereef/Local Sites/pods-theme/app/public/wp-content/plugins/pods/src/Pods/Blocks/Types/Item_List.php on line 372
]]>Hello, I have just noted that the activation of your plugin creates an error in the character encoding of Gutenberg Post Block (the block which retrieves block extracts from post categories).
For example, “à” is rendered as “?”.
If I deactivate the plugin, the problem disappears.
Thank you if you can look into it.
]]>Hi all. Thanks for the initiative on this! Are there plans to run a GH repo? Would ease stack adoption and future contribution potential a great deal. Cheers, L
]]>