WordPress at Your Fingertips
class is not described

Automattic\WooCommerce\Blocks\BlockTypes

AtomicBlock{} WC 1.0

AtomicBlock class.

No Hooks.

Return

null. Nothing.

Usage

$AtomicBlock = new AtomicBlock();
// use class methods

Methods

  1. get_block_type_editor_script( $key = null )
  2. get_block_type_editor_style()
  3. get_block_type_script( $key = null )
  4. get_block_type_style()
  5. get_html_data_attributes( array $attributes )
  6. render( $attributes, $content )

Code of AtomicBlock{} WC 5.5.2

<?php
class AtomicBlock extends AbstractBlock {
	/**
	 * Inject attributes and block name.
	 *
	 * @param array  $attributes Block attributes.
	 * @param string $content    Block content.
	 * @return string Rendered block type output.
	 */
	protected function render( $attributes, $content ) {
		return $this->inject_html_data_attributes( $content, $attributes );
	}

	/**
	 * Get the editor script data for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return null
	 */
	protected function get_block_type_editor_script( $key = null ) {
		return null;
	}

	/**
	 * Get the editor style handle for this block type.
	 *
	 * @return null
	 */
	protected function get_block_type_editor_style() {
		return null;
	}

	/**
	 * Get the frontend script handle for this block type.
	 *
	 * @param string $key Data to get, or default to everything.
	 * @return null
	 */
	protected function get_block_type_script( $key = null ) {
		return null;
	}

	/**
	 * Get the frontend style handle for this block type.
	 *
	 * @return null
	 */
	protected function get_block_type_style() {
		return null;
	}

	/**
	 * Converts block attributes to HTML data attributes.
	 *
	 * @param array $attributes Key value pairs of attributes.
	 * @return string Rendered HTML attributes.
	 */
	protected function get_html_data_attributes( array $attributes ) {
		$data = parent::get_html_data_attributes( $attributes );
		return trim( $data . ' data-block-name="' . esc_attr( $this->namespace . '/' . $this->block_name ) . '"' );
	}
}