'object', 'default' => array(), ); return $args; } /** * Hands the block's saved options to the page data. Block themes render * the template before the head, so this runs before the page data is * printed. * * @param string $block_content Rendered block, returned unchanged. * @param array $block Parsed block. * @return string */ public function read_options( $block_content, $block ) { if ( ! empty( $block['attrs']['purplish'] ) && is_array( $block['attrs']['purplish'] ) ) { PageData::use_block_options( $block['attrs']['purplish'] ); } return $block_content; } /** * Loads the panel in the block and site editors. * * @return void */ public function enqueue_editor() { $asset = include PURPLISH_DIR . 'build/editor.asset.php'; wp_enqueue_script( self::HANDLE, PURPLISH_URL . 'build/editor.js', $asset['dependencies'], $asset['version'], true ); wp_set_script_translations( self::HANDLE, 'purplish' ); } }