Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block updates #130

Merged
merged 18 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# LSX Starter Plugin
LSX Starter Plugin for building LSX theme extensions.

- First download this repo to a folder on your desktop.

- Create a new Github Repository with the slug "your-plugin"
- Clone your Github repo to the wp-content/plugins/your-plugin

Next copy and paste the following files into "your-plugin" directory

![Screenshot 2025-01-29 at 16 14 53](https://github.com/user-attachments/assets/c431ae73-83fa-40e1-83b4-590d752ac784)

Do a case senstitive find and replace for the following.
- lsx_starter_plugin -> yp
- LSX_STARTER_PLUGIN -> YP
- lsx-starter-plugin -> your-plugin
- LSX Starter Plugin -> Your Plugin

Replace the following in all filenames
- lsx-starter-plugin -> your-plugin
9 changes: 6 additions & 3 deletions assets/css/lsx-starter-plugin.css

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

1 change: 1 addition & 0 deletions assets/css/lsx-starter-plugin.css.map

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

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* @package lsx-starter-plugin
*/

@import 'include-media';
@import 'scss/include-media';
1 change: 0 additions & 1 deletion assets/css/maps/lsx-starter-plugin-admin.css.map

This file was deleted.

1 change: 0 additions & 1 deletion assets/css/maps/lsx-starter-plugin.css.map

This file was deleted.

61 changes: 0 additions & 61 deletions classes/class-admin.php

This file was deleted.

77 changes: 29 additions & 48 deletions classes/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,22 @@ class Core {
protected static $instance = null;

/**
* @var object \lsx_starter_plugin\classes\Setup();
*/
public $setup;

/**
* @var object \lsx_starter_plugin\classes\Admin();
*/
public $admin;

/**
* @var object \lsx_starter_plugin\classes\Frontend();
*/
public $frontend;

/**
* @var object \lsx_starter_plugin\classes\Integrations();
*/
public $integrations;

/**
* The post types available
* An array of the classes initiated, the filename is the index.
*
* $classes['setup'] = \lsx_starter_plugin\classes\Setup();
* $classes['admin'] = \lsx_starter_plugin\classes\Admin();
* $classes['templates'] = \lsx_starter_plugin\classes\Templates();
*
* @var array
*/
public $post_types = array();
public $classes = [];

/**
* Contructor
*/
public function __construct() {
add_action( 'init', [ $this, 'load_vendor' ], 9 );
$this->load_classes();
$this->load_includes();
}

/**
Expand All @@ -68,39 +52,36 @@ public static function get_instance() {
}

/**
* Loads the variable classes and the static classes.
* Registers our block patterns with the
*
* @return void
*/
private function load_classes() {
// Load plugin settings related functionality.
require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-setup.php';
$this->setup = Setup::get_instance();

// Load plugin admin related functionality.
require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php';
$this->admin = Admin::get_instance();
public function load_classes() {
$directory = LSX_STARTER_PLUGIN_PATH . 'classes/';

foreach ( glob( $directory . '*.php') as $file ) {
if ( 'class-core.php' === $file ) {
continue;
}

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

// Load 3rd party integrations here.
require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-integrations.php';
$this->integrations = Integrations::get_instance();
}

/**
* Loads the plugin functions.
*/
private function load_includes() {
require_once LSX_STARTER_PLUGIN_PATH . '/includes/functions.php';
// Initiate the class.
$this->classes[ $filename ] = require_once $file;
if ( 'templates' === $filename ) {
$this->classes['templates']->set_path( LSX_STARTER_PLUGIN_PATH );
}
}
}

/**
* Returns the post types currently active
* Load the vendors
*
* @return void
*/
public function get_post_types() {
return apply_filters( 'lsx_starter_plugin_post_types', $this->post_types );
public function load_vendor() {
require_once LSX_STARTER_PLUGIN_PATH . 'vendors/create-content-model/create-content-model.php';
}
}
140 changes: 0 additions & 140 deletions classes/class-custom-post-type.php

This file was deleted.

Loading
Loading