WP Manifestindependent plugin directory
0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://gitlab.com/personal-projects9890238/first-custom-block-wordpress-react-plugin/-/archive/master/first-custom-block-wordpress-react-plugin-master.zip

Readme

Here's the updated README.md with the requested link added:

# CB Copyright Block

The **CB Copyright** block is a dynamic WordPress block that lets you easily display copyright information on your site. It includes an option to display a starting date, making it flexible for use cases like showing the first year of publication.

## Features

- **Dynamic Rendering:** Automatically updates copyright year using server-side rendering.
- **Customizable Starting Date:** Option to display the starting year alongside the current year.
- **React-powered:** Built with React and WordPress's block editor tools for seamless integration.
- **Modern Design:** Simple and stylish, with customizable styles.

## Installation

To use this block in your WordPress project:

1. Clone or download this repository.
2. Place the folder in the `wp-content/plugins/` directory of your WordPress installation.
3. Navigate to the block's directory and install dependencies:
   ```bash
   npm install
  1. Build the block:
    npm run build
  2. Activate the plugin in the WordPress admin dashboard.

Usage

  1. Open the WordPress block editor.
  2. Search for the CB Copyright block in the block inserter.
  3. Add it to your page or post.
  4. Customize the block settings:
    • Toggle the "Displaying starting date" option to show or hide the starting year.
    • Enter the starting year in the provided input field (if the option is enabled).

Resources

Screenshots

Default Block

CB Copyright Block Default

With Starting Date

CB Copyright Block With Starting Date

Files and Structure

  • src/: Source code for the block (React components).
  • build/: Compiled JavaScript files for production.
  • block.json: Metadata file for block registration.
  • index.php: Server-side block registration and rendering logic.

Development

To modify or enhance the block:

  1. Start the development server:
    npm start
  2. Edit the files in the src/ directory. Changes will be reflected in real time.

Scripts

  • npm start: Start the development server.
  • npm run build: Build the block for production.
  • npm run format: Format the code with Prettier.
  • npm run lint:css: Lint CSS files.
  • npm run lint:js: Lint JavaScript files.

Requirements

  • WordPress 5.8 or higher
  • Node.js 14 or higher
  • npm 6 or higher

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! If you find issues or have ideas for improvements, feel free to open an issue or submit a pull request.

Acknowledgments

This block was created using the @wordpress/create-block package.



The new "Resources" section includes the link to the WordPress Block Editor Components reference.

Read the full README on GitLab →