{"id":25805,"date":"2013-10-22T23:15:06","date_gmt":"2013-10-22T23:15:06","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/widget-attributes\/"},"modified":"2015-11-18T15:06:58","modified_gmt":"2015-11-18T15:06:58","slug":"widget-attributes","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/widget-attributes\/","author":319029,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.2.2","stable_tag":"0.2.2","tested":"4.4.34","requires":"3.6.1","requires_php":"","requires_plugins":"","header_name":"Widget Attributes","header_author":"Dzikri Aziz","header_description":"","assets_banners_color":"","last_updated":"2015-11-18 15:06:58","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/kucrut.org\/#coffee","header_plugin_uri":"http:\/\/kucrut.org\/widget-attributes\/","header_author_uri":"http:\/\/kucrut.org\/","rating":4.7,"author_block_rating":0,"active_installs":50,"downloads":2112,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"2"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.2","0.2.1","0.2.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"895067","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"895067","resolution":"2","location":"assets"}},"screenshots":{"1":"Widget configuration form","2":"Widget attributes inserted into the markup"}},"plugin_section":[],"plugin_tags":[162],"plugin_category":[43],"plugin_contributors":[78133],"plugin_business_model":[],"class_list":["post-25805","plugin","type-plugin","status-closed","hentry","plugin_tags-widget","plugin_category-customization","plugin_contributors-kucrut","plugin_committers-kucrut"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/widget-attributes.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/widget-attributes\/assets\/screenshot-1.png?rev=895067","caption":"Widget configuration form"},{"src":"https:\/\/ps.w.org\/widget-attributes\/assets\/screenshot-2.png?rev=895067","caption":"Widget attributes inserted into the markup"}],"raw_content":"<!--section=description-->\n<p>This plugin is intended to be used by theme authors that need to have custom attributes for the widgets so they can define common classes for similar widgets, etc.<\/p>\n\n<p>When activated, you'll get two additional input fields in the widget configuration forms, where you can assign a custom ID and classes for the widgets.<\/p>\n\n<p>Please note that before the attributes are saved, they will be passed through <a href=\"http:\/\/core.trac.wordpress.org\/browser\/tags\/3.6.1\/wp-includes\/formatting.php#L1079\">sanitize_html_class()<\/a> so all blacklisted characters will be stripped.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>widget-attributes<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Go to <em>Plugins<\/em> and activate <em>Widget Attributes<\/em><\/li>\n<li>Go to <em>Appearance<\/em> &gt; <em>Widgets<\/em> and add the attributes<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Do I need to add code to my theme's `functions.php` file?<\/dt>\n<dd><p>No, you don't. This plugin just works(TM). However, you will need to add the style for the classes you use for your widgets.<\/p><\/dd>\n<dt>Is there any known bug?<\/dt>\n<dd><p>In short, maybe. If your theme or one of your plugins is replacing the default widget callback in a weird way, this plugin may not work.<\/p><\/dd>\n<dt>Do you provide filters?<\/dt>\n<dd><p>YES! You can hook into <code>widget_attribute_id<\/code> and\/or <code>widget_attribute_classes<\/code> if you need to validate\/sanitize the attributes provided by the user. For example:<\/p>\n\n<pre><code>\/**\n * Check for widget classes provided by the user\n *\n * @param string $classes Widget class(es), separated by spaces\n *\/\nfunction my_widget_classes_filter( $classes ) {\n    \/\/ do your thing...\n    return $classes;\n}\nadd_filter( 'widget_attribute_classes', 'my_widget_classes_filter' );\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.2.2<\/h4>\n\n<ul>\n<li>Update compatibility info<\/li>\n<\/ul>\n\n<h4>0.2.1<\/h4>\n\n<ul>\n<li>Fix attributes saving, props <a href=\"https:\/\/github.com\/iamunick\">@iamunick<\/a><\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>Cleanup<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Add custom attributes (classes and ID) to your widgets, the easy way!","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/25805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=25805"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/kucrut"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=25805"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=25805"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=25805"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=25805"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=25805"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=25805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}