Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mu-plugins/*
!mu-plugins/osi-sponsors-list
!websub-compat.php
!mu-plugins/osi-events-manager-tweaks
!mu-plugins/osi-editor-tweaks

themes/*
!themes/osi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'd82e2a784541e7d8afe6');

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
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'eb7b34d85380496c7763');
1 change: 1 addition & 0 deletions mu-plugins/osi-editor-tweaks/build/scripts/theme/theme.js

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
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '41cf24a395f305fb3768');

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

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '41cf24a395f305fb3768');

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

Empty file.
77 changes: 77 additions & 0 deletions mu-plugins/osi-editor-tweaks/osi-editor-tweaks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/**
* Plugin Name: OSI Editor Tweaks
* Plugin Description: A place where all custom block variations and syles are added.
* Version: 1.0.0
* Author: WordPress.com Special Projects
* Author URI: https://wpspecialprojects.wordpress.com/
*/

if ( ! defined( 'ABSPATH' ) ) {
return;
}

define( 'OSI_ET_VERSION', '1.0.0' );
define( 'OSI_ET_BUILD_PATH', plugin_dir_path( __FILE__ ) . 'build/' );
define( 'OSI_ET_BUILD_URL', plugin_dir_url( __FILE__ ) . 'build/' );


/**
* Renders the block editor scripts.
*
* @return void
*/
function osi_et_admin_scripts() {
// If file exists, enqueue the script.
if ( file_exists( OSI_ET_BUILD_PATH . 'scripts/editor/editor.asset.php' ) ) {
$assets = include OSI_ET_BUILD_PATH . 'scripts/editor/editor.asset.php';
wp_enqueue_script(
'osi-event-list',
OSI_ET_BUILD_URL . 'scripts/editor/editor.js',
$assets['dependencies'],
$assets['version'],
true
);
}

// If file exists, enqueue the editor styles.
if ( file_exists( OSI_ET_BUILD_PATH . 'styles/editor/editor.scss.css' ) ) {
wp_enqueue_style(
'osi-event-list-editor',
OSI_ET_BUILD_URL . 'styles/editor/editor.scss.css',
array(),
OSI_ET_VERSION
);
}
}
add_action( 'enqueue_block_editor_assets', 'osi_et_admin_scripts' );

/**
* Renders the front-end scripts.
*
* @return void
*/
function osi_et_frontend_scripts() {
// If file exists, enqueue the script.
if ( file_exists( OSI_ET_BUILD_PATH . 'scripts/theme/theme.asset.php' ) ) {
$assets = include OSI_ET_BUILD_PATH . 'scripts/theme/theme.asset.php';
wp_enqueue_script(
'osi-et-theme',
OSI_ET_BUILD_URL . 'scripts/theme/theme.js',
$assets['dependencies'],
$assets['version'],
true
);
}

// If file exists, enqueue the front-end styles.
if ( file_exists( OSI_ET_BUILD_PATH . 'styles/theme/theme.scss.css' ) ) {
wp_enqueue_style(
'osi-et-theme',
OSI_ET_BUILD_URL . 'styles/theme/theme.scss.css',
array(),
OSI_ET_VERSION
);
}
}
add_action( 'wp_enqueue_scripts', 'osi_et_frontend_scripts' );
Loading