REFACTOR Renaming block
This commit is contained in:
parent
877d75b437
commit
dedf5d157a
|
|
@ -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"
|
|
||||||
}
|
|
||||||
|
|
@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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,
|
|
||||||
});
|
|
||||||
|
|
@ -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>
|
|
||||||
Loading…
Reference in New Issue
Block a user