Skip to content

Commit d8c7457

Browse files
authored
Merge pull request #130 from lightspeedwp/block-updates
Block updates
2 parents 1135165 + 94f8dfc commit d8c7457

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2083
-3694
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
# LSX Starter Plugin
22
LSX Starter Plugin for building LSX theme extensions.
3+
4+
- First download this repo to a folder on your desktop.
5+
6+
- Create a new Github Repository with the slug "your-plugin"
7+
- Clone your Github repo to the wp-content/plugins/your-plugin
8+
9+
Next copy and paste the following files into "your-plugin" directory
10+
11+
![Screenshot 2025-01-29 at 16 14 53](https://github.com/user-attachments/assets/c431ae73-83fa-40e1-83b4-590d752ac784)
12+
13+
Do a case senstitive find and replace for the following.
14+
- lsx_starter_plugin -> yp
15+
- LSX_STARTER_PLUGIN -> YP
16+
- lsx-starter-plugin -> your-plugin
17+
- LSX Starter Plugin -> Your Plugin
18+
19+
Replace the following in all filenames
20+
- lsx-starter-plugin -> your-plugin

assets/css/lsx-starter-plugin.css

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/lsx-starter-plugin.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/scss/lsx-starter-plugin.scss renamed to assets/css/lsx-starter-plugin.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* @package lsx-starter-plugin
55
*/
66

7-
@import 'include-media';
7+
@import 'scss/include-media';

assets/css/maps/lsx-starter-plugin-admin.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/css/maps/lsx-starter-plugin.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

classes/class-admin.php

Lines changed: 0 additions & 61 deletions
This file was deleted.

classes/class-core.php

Lines changed: 29 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,22 @@ class Core {
1818
protected static $instance = null;
1919

2020
/**
21-
* @var object \lsx_starter_plugin\classes\Setup();
22-
*/
23-
public $setup;
24-
25-
/**
26-
* @var object \lsx_starter_plugin\classes\Admin();
27-
*/
28-
public $admin;
29-
30-
/**
31-
* @var object \lsx_starter_plugin\classes\Frontend();
32-
*/
33-
public $frontend;
34-
35-
/**
36-
* @var object \lsx_starter_plugin\classes\Integrations();
37-
*/
38-
public $integrations;
39-
40-
/**
41-
* The post types available
21+
* An array of the classes initiated, the filename is the index.
4222
*
23+
* $classes['setup'] = \lsx_starter_plugin\classes\Setup();
24+
* $classes['admin'] = \lsx_starter_plugin\classes\Admin();
25+
* $classes['templates'] = \lsx_starter_plugin\classes\Templates();
26+
*
4327
* @var array
4428
*/
45-
public $post_types = array();
29+
public $classes = [];
4630

4731
/**
4832
* Contructor
4933
*/
5034
public function __construct() {
35+
add_action( 'init', [ $this, 'load_vendor' ], 9 );
5136
$this->load_classes();
52-
$this->load_includes();
5337
}
5438

5539
/**
@@ -68,39 +52,36 @@ public static function get_instance() {
6852
}
6953

7054
/**
71-
* Loads the variable classes and the static classes.
55+
* Registers our block patterns with the
56+
*
57+
* @return void
7258
*/
73-
private function load_classes() {
74-
// Load plugin settings related functionality.
75-
require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-setup.php';
76-
$this->setup = Setup::get_instance();
77-
78-
// Load plugin admin related functionality.
79-
require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php';
80-
$this->admin = Admin::get_instance();
59+
public function load_classes() {
60+
$directory = LSX_STARTER_PLUGIN_PATH . 'classes/';
61+
62+
foreach ( glob( $directory . '*.php') as $file ) {
63+
if ( 'class-core.php' === $file ) {
64+
continue;
65+
}
8166

82-
// Load front-end related functionality.
83-
require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-frontend.php';
84-
$this->frontend = Frontend::get_instance();
67+
// Extract the filename and classname without the directory path and extension
68+
$filename = basename( $file, '.php' );
69+
$filename = str_replace( 'class-', '', $filename );
8570

86-
// Load 3rd party integrations here.
87-
require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-integrations.php';
88-
$this->integrations = Integrations::get_instance();
89-
}
90-
91-
/**
92-
* Loads the plugin functions.
93-
*/
94-
private function load_includes() {
95-
require_once LSX_STARTER_PLUGIN_PATH . '/includes/functions.php';
71+
// Initiate the class.
72+
$this->classes[ $filename ] = require_once $file;
73+
if ( 'templates' === $filename ) {
74+
$this->classes['templates']->set_path( LSX_STARTER_PLUGIN_PATH );
75+
}
76+
}
9677
}
9778

9879
/**
99-
* Returns the post types currently active
80+
* Load the vendors
10081
*
10182
* @return void
10283
*/
103-
public function get_post_types() {
104-
return apply_filters( 'lsx_starter_plugin_post_types', $this->post_types );
84+
public function load_vendor() {
85+
require_once LSX_STARTER_PLUGIN_PATH . 'vendors/create-content-model/create-content-model.php';
10586
}
10687
}

classes/class-custom-post-type.php

Lines changed: 0 additions & 140 deletions
This file was deleted.

0 commit comments

Comments
 (0)