{"id":43359,"date":"2016-04-23T14:49:44","date_gmt":"2016-04-23T14:49:44","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-atomic-content\/"},"modified":"2017-03-10T07:58:10","modified_gmt":"2017-03-10T07:58:10","slug":"wp-atomic-content","status":"closed","type":"plugin","link":"https:\/\/mg.wordpress.org\/plugins\/wp-atomic-content\/","author":14051490,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.3","stable_tag":"trunk","tested":"4.7.33","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"WP atomic content","header_author":"David Duquenoy","header_description":"","assets_banners_color":"","last_updated":"2017-03-10 07:58:10","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"http:\/\/www.partage-it.com","rating":4,"author_block_rating":0,"active_installs":10,"downloads":1409,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.3"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[529,170,86],"plugin_category":[],"plugin_contributors":[98029],"plugin_business_model":[],"class_list":["post-43359","plugin","type-plugin","status-closed","hentry","plugin_tags-content","plugin_tags-page","plugin_tags-post","plugin_contributors-partage-it","plugin_committers-partage-it"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-atomic-content.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>WP atomic content allows to create content blocks to use in posts, pages and custom post types.<\/p>\n\n<h4>Getting started<\/h4>\n\n<ol>\n<li>create a new block in the WordPress admin interface (in the block menu), write some contents and publish it<\/li>\n<li>copy the suggested shortcode<\/li>\n<li>in a page, post, or whatever, paste the shortcode where you want to see the block's content<\/li>\n<li>you're done<\/li>\n<\/ol>\n\n<h4>The shortcode, basically<\/h4>\n\n<pre><code>[block id=\"my-block-name\"]\n<\/code><\/pre>\n\n<p>This shortcode includes the content of the <code>my-block-name<\/code> block in the page.<\/p>\n\n<p>If the block is not found, nothing happens, no errors, no additional spaces. Nothing.<\/p>\n\n<h4>Spaced content<\/h4>\n\n<pre><code>[block id=\"my-block-name\" spacebefore=\"1em\" spaceafter=\"30px\" \/]\n<\/code><\/pre>\n\n<p>It is possible to set space before and after the content with <code>spacebefore<\/code> and <code>spaceafter<\/code> shortcode parameters.<\/p>\n\n<p>Units are CSS compatible, so feel free to use <code>px<\/code>, <code>em<\/code>, <code>rem<\/code>, <code>cm<\/code>, ...<\/p>\n\n<h4>Custom CSS classes<\/h4>\n\n<pre><code>[block id=\"my-block-name\" class=\"my-class\"]\n<\/code><\/pre>\n\n<p>Adding the <code>class<\/code> parameter, the CSS class is added to the block, in order to customize it.<\/p>\n\n<p>It is possible to set many classes, with a space as separator.<\/p>\n\n<p>You should note that two classes, <code>atomic-content-block<\/code> and <code>block-&lt;id&gt;<\/code>, are added to every included blocks, without any customization.<\/p>\n\n<p>Moreover, an identifier is added, to easily link the block with anchors (<code>id=\"&lt;id&gt;\"<\/code>).<\/p>\n\n<h4>Block content<\/h4>\n\n<p>The block editor is the same as the post editor. In other words, it is possible to format content (add paragraphs, titles, ...).<\/p>\n\n<p>It is also possible to add shortcodes, even to include blocks.<\/p>\n\n<p>So you can make blocks composed of blocks, but be careful to not make cyclic references (<code>a<\/code> includes <code>b<\/code> which includes <code>a<\/code>).<\/p>\n\n<h4>PHP use<\/h4>\n\n<p>You can include blocks from PHP code (i.e. in theme or plugin code), without shortcode.<\/p>\n\n<p>The PHP functions, named <code>atomicContent<\/code> works like the shortcode, with the same parameters.<\/p>\n\n<p>The signature:<\/p>\n\n<pre><code>string atomicContent($id, $classes = array(), $spaceBefore = null, $spaceAfter = null, $display = true)\n<\/code><\/pre>\n\n<p>When <code>$display<\/code> is <code>true<\/code>, the result is directly displayed. Otherwise it is returned as result of the function.<\/p>\n\n<p>Sample:<\/p>\n\n<pre><code>atomicContent(\"my-block-name\", array(\"my-class\"), \"1em\", \"30px\")\n<\/code><\/pre>\n\n<!--section=installation-->\n<p>Use the WordPress administration interface, otherwise, you know what to do.<\/p>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>The first version<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Class according to the block id added automatically<\/li>\n<li>Id according to the block id added automatically (for anchors)<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Incorrect version number in the PHP file<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Noob error v2: the PHP file was not commited...<\/li>\n<\/ul>","raw_excerpt":"WP atomic content allows to create content blocks to use in posts, pages and custom post types.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/43359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=43359"}],"author":[{"embeddable":true,"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/partage-it"}],"wp:attachment":[{"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=43359"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=43359"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=43359"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=43359"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=43359"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/mg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=43359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}