Skip to content

Commit

Permalink
🚀 RELEASE: v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
colorful-tones committed Nov 28, 2023
1 parent a929b6a commit 309ac58
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 68 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Slider Block plugin

__Fork it, or download the [latest release](https://github.com/colorful-tones/slider-block/releases), and make it your own!__

This is a demonstration of how you might create a custom [Slider Block](https://www.advancedcustomfields.com/resources/blocks/), which is a slider carousel UI. We're using SwiperJS (3rd-party dependency) for the slider JavaScript and CSS (mostly).

## Installation

### Manual

1. Upload the `slider-block` folder to the plugins directory (typically `wp-content/plugins`) in your WordPress installation.
2. Activate the Slider Block plugin.
3. Create a new post or page, and insert the Slider block.
4. That's it.

## Changelog

### 0.1.0 – 2023-11-28

Initial release, which includes:

- Slider Block which uses [SwiperJS](https://swiperjs.com/) (v11.0.5)

## Resources

- Need help converting your block markup to PHP nested arrays or JS objects? Check out [WPHTML Converter](https://happyprime.github.io/wphtml-converter/)
- [SwiperJS](https://swiperjs.com/).
8 changes: 4 additions & 4 deletions build/blocks/slide/block.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "colorful-tones/slide",
"version": "0.1.4",
"name": "wpe/slide",
"version": "0.1.0",
"title": "Slide",
"category": "widgets",
"icon": "cover-image",
Expand All @@ -15,7 +15,7 @@
},
"example": {},
"parent": [
"colorful-tones/slider"
"wpe/slider"
],
"supports": {
"align": [
Expand All @@ -25,7 +25,7 @@
"className": true,
"html": false
},
"textdomain": "slider-block",
"textdomain": "wpe",
"editorScript": "file:./index.js",
"render": "file:./render.php"
}
2 changes: 1 addition & 1 deletion build/blocks/slide/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-hooks'), 'version' => 'e14cd374b6d31d66768e');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-hooks'), 'version' => 'de9db5073676682bab66');
2 changes: 1 addition & 1 deletion build/blocks/slide/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/blocks/slide/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @var string $content Block default content.
* @var \WP_Block $block Block instance.
*
* @package colorful-tones/slider-block
* @package wpe/slider-block
*/

// Pass along Swiper desired class.
Expand Down
10 changes: 3 additions & 7 deletions build/blocks/slider/block.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "colorful-tones/slider",
"name": "wpe/slider",
"title": "Slider",
"category": "widgets",
"description": "Display your images in a horizontal carousel.",
Expand All @@ -22,10 +22,6 @@
"pagination": {
"type": "boolean",
"default": true
},
"slidesPerView": {
"type": "number",
"default": 1
}
},
"example": {},
Expand All @@ -50,8 +46,8 @@
]
}
},
"textdomain": "slider-block",
"version": "0.1.4",
"textdomain": "wpe",
"version": "0.1.0",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"render": "file:./render.php",
Expand Down
2 changes: 1 addition & 1 deletion build/blocks/slider/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '465f976cdfa4d6ccbea7');
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'fe5e00eb9597bb99cf08');
2 changes: 1 addition & 1 deletion build/blocks/slider/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/blocks/slider/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/blocks/slider/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @var string $content Block default content.
* @var \WP_Block $block Block instance.
*
* @package colorful-tones/slider-block
* @package wpe/slider-block
*/

$autoplay = empty( $attributes['autoplay'] ) ? false : $attributes['autoplay'];
Expand Down
Loading

0 comments on commit 309ac58

Please sign in to comment.