PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 2.2.1
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v2.2.1
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
better-payment / src / blocks / payment-form / src / index.js

index.js in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 2.2.1, at src/blocks/payment-form/src/index.js

94 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Better Payment - Payment Form Block
3 *
4 * This is the main entry point for the Payment Form Gutenberg block.
5 * It registers the block with WordPress and imports all necessary components.
6 *
7 * @package Better_Payment
8 * @since 1.0.0
9 */
10
11 import { registerBlockType } from '@wordpress/blocks';
12 import { __ } from '@wordpress/i18n';
13
14 // Import block components
15 import Edit from './components/edit';
16 import save from './components/save';
17 import attributes from './components/attributes';
18
19 // Import styles
20 import './styles/editor.scss';
21 import './styles/style.scss';
22
23 // Import block icon
24 import BlockIcon from './components/icon';
25
26 /**
27 * Register the Payment Form block.
28 *
29 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
30 */
31 registerBlockType('better-payment/payment-form', {
32 /**
33 * Block title displayed in the inserter.
34 */
35 title: __('Payment Form', 'better-payment'),
36
37 /**
38 * Block description displayed in the block inspector.
39 */
40 description: __(
41 'Seamlessly collect payments with Stripe, PayPal, and Paystack in just a few clicks.',
42 'better-payment'
43 ),
44
45 /**
46 * Block category - groups blocks in the inserter.
47 */
48 category: 'better-payment',
49
50 /**
51 * Block icon.
52 */
53 icon: BlockIcon,
54
55 /**
56 * Keywords for block search.
57 */
58 keywords: [
59 __('payment', 'better-payment'),
60 __('stripe', 'better-payment'),
61 __('paypal', 'better-payment'),
62 __('paystack', 'better-payment'),
63 __('donate', 'better-payment'),
64 __('better payment', 'better-payment'),
65 __('betterpayment', 'better-payment'),
66 ],
67
68 /**
69 * Block attributes.
70 */
71 attributes,
72
73 /**
74 * Block example for preview.
75 */
76 example: {
77 attributes: {
78 formTitle: __('Payment Form', 'better-payment'),
79 formLayout: 'layout-1',
80 showTitle: true,
81 },
82 },
83
84 /**
85 * Edit component - renders in the editor.
86 */
87 edit: Edit,
88
89 /**
90 * Save component - returns null for dynamic blocks.
91 */
92 save,
93 });
94