REFACTOR Renaming block

This commit is contained in:
Antoine M 2026-03-25 16:01:17 +01:00
parent 877d75b437
commit dedf5d157a
7 changed files with 0 additions and 68 deletions

View File

@ -1,20 +0,0 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "carhop-plugin/dbmob-grid",
"version": "0.1.0",
"title": "Grid de dictionnaires",
"category": "carhop-blocks",
"icon": "smiley",
"description": "Grid de dictionnaires",
"example": {},
"supports": {
"html": false
},
"textdomain": "dbmob-grid",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"render": "file:./render.php",
"viewScript": "file:./view.js"
}

View File

@ -1,11 +0,0 @@
import { __ } from "@wordpress/i18n";
import { useBlockProps } from "@wordpress/block-editor";
import "./editor.scss";
export default function Edit() {
return (
<p {...useBlockProps()}>
{__("Grid de dictionnaires hello from the editor!", "dbmob-grid")}
</p>
);
}

View File

@ -1,9 +0,0 @@
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-carhop-plugin-latest-news {
border: 1px dotted #f00;
}

View File

@ -1,7 +0,0 @@
import { registerBlockType } from "@wordpress/blocks";
import "./style.scss";
import Edit from "./edit";
import metadata from "./block.json";
registerBlockType(metadata.name, {
edit: Edit,
});

View File

@ -1,21 +0,0 @@
<?php
$args = array(
'post_type' => 'dbmob',
'posts_per_page' => 8,
);
$query = new WP_Query($args);
?>
<section <?php echo get_block_wrapper_attributes(); ?>>
<h2>DBMOB SAAAALUUUT</h2>
<?php if ($query->have_posts()) : ?>
<div class="dbmob-grid">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<div class="dbmob-grid__item">
<?php the_title(); ?>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
</section>