-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from Piratenpartei/dev
Dev
- Loading branch information
Showing
19 changed files
with
1,448 additions
and
1,257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<?php | ||
/** | ||
* @package WordPress | ||
* @subpackage Pirate Rogue | ||
* @since FAU 1.4.10 | ||
*/ | ||
|
||
/* | ||
* Settings for Gutenberg Editor | ||
* See also: | ||
* https://wordpress.org/gutenberg/handbook/reference/theme-support/ | ||
* https://themecoder.de/2018/09/20/gutenberg-farbpalette/ | ||
* https://www.elmastudio.de/wordpress-themes-fuer-gutenberg-vorbereiten/ | ||
* https://www.billerickson.net/getting-your-theme-ready-for-gutenberg/ | ||
* https://wordpress.stackexchange.com/questions/320653/how-to-detect-the-usage-of-gutenberg | ||
*/ | ||
|
||
|
||
|
||
/*-----------------------------------------------------------------------------------*/ | ||
/* We use our own color set in this theme and dont want autors to change text colors | ||
/*-----------------------------------------------------------------------------------*/ | ||
function pirate_rogue_gutenberg_settings() { | ||
global $is_gutenberg_enabled; | ||
|
||
$is_gutenberg_enabled = pirate_rogue_blockeditor_is_active(); | ||
|
||
if ($is_gutenberg_enabled) { | ||
return; | ||
} | ||
|
||
// Disable color palette. | ||
add_theme_support( 'editor-color-palette' ); | ||
|
||
// Disable color picker. | ||
add_theme_support( 'disable-custom-colors' ); | ||
|
||
// Dont allow font sizes of gutenberg | ||
// https://wordpress.org/gutenberg/handbook/extensibility/theme-support/#block-font-sizes | ||
add_theme_support('disable-custom-font-sizes'); | ||
|
||
// allow responsive embedded content | ||
add_theme_support( 'responsive-embeds' ); | ||
|
||
// Remove Gutenbergs Userstyle and SVGs Duotone injections from 5.9.2 | ||
remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' ); | ||
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); | ||
|
||
} | ||
add_action( 'after_setup_theme', 'pirate_rogue_gutenberg_settings' ); | ||
|
||
/*-----------------------------------------------------------------------------------*/ | ||
/* Activate scripts and style for backend use of Gutenberg | ||
/*-----------------------------------------------------------------------------------*/ | ||
function pirate_rogue_add_gutenberg_assets() { | ||
// Load the theme styles within Gutenberg. | ||
global $is_gutenberg_enabled; | ||
|
||
if ($is_gutenberg_enabled) { | ||
wp_enqueue_style( 'pirate-rogue-gutenberg', get_theme_file_uri( '/css/pirate-rogue-theme-gutenberg.css' ), false ); | ||
} | ||
} | ||
// add_action( 'enqueue_block_editor_assets', 'pirate_rogue_add_gutenberg_assets' ); | ||
|
||
/*-----------------------------------------------------------------------------------*/ | ||
/* Remove Block Style from frontend as long wie dont use it | ||
/*-----------------------------------------------------------------------------------*/ | ||
function pirate_rogue_deregister_blocklibrary_styles() { | ||
global $is_gutenberg_enabled; | ||
|
||
if (!$is_gutenberg_enabled) { | ||
wp_dequeue_style( 'wp-block-library'); | ||
wp_dequeue_style( 'wp-block-library-theme' ); | ||
wp_dequeue_style( 'wp-blocks-style' ); | ||
} | ||
} | ||
add_action( 'wp_enqueue_scripts', 'pirate_rogue_deregister_blocklibrary_styles', 100 ); | ||
|
||
|
||
/** | ||
* Check if Block Editor is active. | ||
* Must only be used after plugins_loaded action is fired. | ||
* | ||
* @return bool | ||
*/ | ||
function pirate_rogue_blockeditor_is_active() { | ||
// Gutenberg plugin is installed and activated. | ||
$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); | ||
|
||
// Block editor since 5.0. | ||
$block_editor = version_compare( $GLOBALS['wp_version'], '5.0.0', '>' ); | ||
|
||
if ( ! $gutenberg && ! $block_editor ) { | ||
return false; | ||
} | ||
|
||
if ( pirate_rogue_is_classic_editor_plugin_active() ) { | ||
$editor_option = get_option( 'classic-editor-replace' ); | ||
$block_editor_active = array( 'no-replace', 'block' ); | ||
return in_array( $editor_option, $block_editor_active, true ); | ||
} | ||
if (pirate_rogue_is_newsletter_plugin_active()) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* Check if Classic Editor plugin is active. | ||
* | ||
* @return bool | ||
*/ | ||
function pirate_rogue_is_classic_editor_plugin_active() { | ||
|
||
if ( ! function_exists( 'is_plugin_active' ) ) { | ||
include_once ABSPATH . 'wp-admin/includes/plugin.php'; | ||
} | ||
|
||
if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
/* | ||
* Check if our Block Editor based Newsletter Plugin is active | ||
*/ | ||
function pirate_rogue_is_newsletter_plugin_active() { | ||
if ( ! function_exists( 'is_plugin_active' ) ) { | ||
include_once ABSPATH . 'wp-admin/includes/plugin.php'; | ||
} | ||
|
||
|
||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,77 @@ | ||
{ | ||
"name": "Pirate-Rogue", | ||
"textdomain": "pirate-rogue", | ||
"version": "1.4.9", | ||
"keywords": [ | ||
"WordPress", | ||
"Theme", | ||
"Piratenpartei" | ||
], | ||
"compatibility": { | ||
"wprequires": "5.0", | ||
"wptestedup": "5.7", | ||
"phprequires": "7.3" | ||
}, | ||
"author": { | ||
"name": "xwolf", | ||
"url": "https://xwolf.de" | ||
}, | ||
"description": "Theme for pirate parties worldwide. This theme allows to chose between the mostly used color combinations (purple and orange) as main colors for designing elements. It uses several free to use pirate symbols and allows custom CSS. It was created for the german pirate party as replacement for their prior wordpress theme.", | ||
"license": "GPL-3.0-or-later", | ||
"licenseurl": "http://www.gnu.org/licenses/gpl-3.0.html", | ||
"tags": "three-columns, two-columns, one-column, right-sidebar, featured-images", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Piratenpartei/Pirate-Rogue.git", | ||
"issues": "https://github.com/Piratenpartei/Pirate-Rogue/issues", | ||
"clone": "git+https://github.com/Piratenpartei/Pirate-Rogue.git" | ||
}, | ||
"browserslist": [ | ||
"last 3 years", | ||
"ie 11" | ||
], | ||
"contributors": [], | ||
"dependencies": { | ||
"postcss": "^8.2.4" | ||
}, | ||
"main": "index.php", | ||
"maincss": "style.css", | ||
"scripts": { | ||
"start": "gulp", | ||
"dev": "gulp dev", | ||
"build": "gulp build", | ||
"pot": "gulp pot" | ||
}, | ||
"source": { | ||
"js": "./js/", | ||
"sass": "./src/sass/" | ||
}, | ||
"jsdir": "./js/", | ||
"cssdir": "./css/", | ||
"devDependencies": { | ||
"@babel/core": "^7.12.10", | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/register": "^7.12.10", | ||
"autoprefixer": "^10.2.3", | ||
"cssnano": "^4.1.10", | ||
"gulp": "^4.0.2", | ||
"gulp-babel": "^8.0.0", | ||
"gulp-bump": "^3.2.0", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-dart-sass": "^1.0.2", | ||
"gulp-header": "^2.0.9", | ||
"gulp-postcss": "^9.0.0", | ||
"gulp-rename": "^2.0.0", | ||
"gulp-sass": "^4.1.0", | ||
"gulp-touch-cmd": "0.0.1", | ||
"gulp-w3c-css": "^2.0.0", | ||
"gulp-wp-pot": "^2.5.0", | ||
"map-stream": "0.0.7", | ||
"semver": "^7.3.4" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Piratenpartei/Pirate-Rogue/issues" | ||
}, | ||
"homepage": "https://github.com/Piratenpartei/Pirate-Rogue#readme" | ||
} | ||
{ | ||
"name": "Pirate-Rogue", | ||
"textdomain": "pirate-rogue", | ||
"version": "1.4.10", | ||
"keywords": [ | ||
"WordPress", | ||
"Theme", | ||
"Piratenpartei" | ||
], | ||
"compatibility": { | ||
"wprequires": "5.9", | ||
"wptestedup": "6.0", | ||
"phprequires": "7.4" | ||
}, | ||
"author": { | ||
"name": "xwolf", | ||
"url": "https://xwolf.de" | ||
}, | ||
"description": "Theme for pirate parties worldwide. This theme allows to chose between the mostly used color combinations (purple and orange) as main colors for designing elements. It uses several free to use pirate symbols and allows custom CSS. It was created for the german pirate party as replacement for their prior wordpress theme.", | ||
"license": "GPL-3.0-or-later", | ||
"licenseurl": "http://www.gnu.org/licenses/gpl-3.0.html", | ||
"tags": "three-columns, two-columns, one-column, right-sidebar, featured-images", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Piratenpartei/Pirate-Rogue.git", | ||
"issues": "https://github.com/Piratenpartei/Pirate-Rogue/issues", | ||
"clone": "git+https://github.com/Piratenpartei/Pirate-Rogue.git" | ||
}, | ||
"browserslist": [ | ||
"last 3 years", | ||
"ie 11" | ||
], | ||
"contributors": [], | ||
"dependencies": { | ||
"npm-check-updates": "^16.1.2", | ||
"postcss": "^8.2.4" | ||
}, | ||
"main": "index.php", | ||
"maincss": "style.css", | ||
"scripts": { | ||
"start": "gulp", | ||
"dev": "gulp dev", | ||
"build": "gulp build", | ||
"pot": "gulp pot" | ||
}, | ||
"source": { | ||
"js": "./js/", | ||
"sass": "./src/sass/" | ||
}, | ||
"jsdir": "./js/", | ||
"cssdir": "./css/", | ||
"devDependencies": { | ||
"@babel/core": "^7.12.10", | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/register": "^7.12.10", | ||
"autoprefixer": "^10.2.3", | ||
"cssnano": "^4.1.10", | ||
"gulp": "^4.0.2", | ||
"gulp-babel": "^8.0.0", | ||
"gulp-bump": "^3.2.0", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-dart-sass": "^1.0.2", | ||
"gulp-header": "^2.0.9", | ||
"gulp-postcss": "^9.0.0", | ||
"gulp-rename": "^2.0.0", | ||
"gulp-sass": "^5.1.0", | ||
"gulp-touch-cmd": "0.0.1", | ||
"gulp-w3c-css": "^2.0.0", | ||
"gulp-wp-pot": "^2.5.0", | ||
"map-stream": "0.0.7", | ||
"semver": "^7.3.4" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Piratenpartei/Pirate-Rogue/issues" | ||
}, | ||
"homepage": "https://github.com/Piratenpartei/Pirate-Rogue#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.