Skip to content

Commit 48b2c44

Browse files
committed
init: plugins
1 parent d58e275 commit 48b2c44

31 files changed

Lines changed: 20277 additions & 9 deletions

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ services:
2525
volumes:
2626
- ./.srv/wordpress:/var/www/html
2727
- ./.srv/custom.ini:/usr/local/etc/php/conf.d/custom.ini
28-
- './themes/:/var/www/html/wp-content/themes/'
29-
- './plugins/:/var/www/html/wp-content/plugins/'
30-
- './mu-plugins/:/var/www/html/wp-content/mu-plugins/'
28+
- ./themes/:/var/www/html/wp-content/themes/
29+
- ./plugins/:/var/www/html/wp-content/plugins/
30+
- ./mu-plugins/:/var/www/html/wp-content/mu-plugins/
3131
depends_on:
3232
- mysql
3333
links:

mu-plugins/gamestore-general.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/*
3+
* Plugin Name: Gamestore General
4+
* Description: General plugin for the Gamestore site.
5+
* Version: 1.0.0
6+
* Author: GKVSO
7+
* License: GPL2
8+
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
9+
* Text Domain: gamestore-general
10+
* Domain Path: /languages
11+
*/
12+
13+
function gkvso_remove_dashboard_widgets() {
14+
global $wp_meta_boxes;
15+
16+
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity'] ); // Activity
17+
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] ); // Quick Draft
18+
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); // Incoming Links
19+
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );
20+
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] ); // Plugins
21+
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts'] ); // Recent Drafts
22+
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] ); // Recent Comments
23+
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // WordPress Events and News
24+
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] ); // Other WordPress News
25+
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_right_now'] ); // At a Glance
26+
unset( $wp_meta_boxes['dashboard']['normal']['core']['yoast_db_widget'] ); // Yoast SEO
27+
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_site_health'] ); //
28+
}
29+
add_action( 'wp_dashboard_setup', 'gkvso_remove_dashboard_widgets' );
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[*.{yml,yaml}]
17+
indent_style = space
18+
indent_size = 2
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Coverage directory used by tools like istanbul
9+
coverage
10+
11+
# Compiled binary addons (https://nodejs.org/api/addons.html)
12+
build/Release
13+
14+
# Dependency directories
15+
node_modules/
16+
17+
# Optional npm cache directory
18+
.npm
19+
20+
# Optional eslint cache
21+
.eslintcache
22+
23+
# Output of `npm pack`
24+
*.tgz
25+
26+
# Output of `wp-scripts plugin-zip`
27+
*.zip
28+
29+
# dotenv environment variables file
30+
.env
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php
2+
/**
3+
* Plugin Name: Blocks Gamestore
4+
* Description: Example block scaffolded with Create Block tool.
5+
* Version: 1.0.0
6+
* Requires at least: 6.7
7+
* Requires PHP: 7.4
8+
* Author: The WordPress Contributors
9+
* License: GPL-2.0-or-later
10+
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
11+
* Text Domain: blocks-gamestore
12+
*
13+
* @package CreateBlock
14+
*/
15+
16+
if ( ! defined( 'ABSPATH' ) ) {
17+
exit; // Exit if accessed directly.
18+
}
19+
/**
20+
* Registers the block using a `blocks-manifest.php` file, which improves the performance of block type registration.
21+
* Behind the scenes, it also registers all assets so they can be enqueued
22+
* through the block editor in the corresponding context.
23+
*
24+
* @see https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
25+
* @see https://make.wordpress.org/core/2024/10/17/new-block-type-registration-apis-to-improve-performance-in-wordpress-6-7/
26+
*/
27+
function create_block_blocks_gamestore_block_init() {
28+
/**
29+
* Registers the block(s) metadata from the `blocks-manifest.php` and registers the block type(s)
30+
* based on the registered block metadata.
31+
* Added in WordPress 6.8 to simplify the block metadata registration process added in WordPress 6.7.
32+
*
33+
* @see https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
34+
*/
35+
if ( function_exists( 'wp_register_block_types_from_metadata_collection' ) ) {
36+
wp_register_block_types_from_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
37+
return;
38+
}
39+
40+
/**
41+
* Registers the block(s) metadata from the `blocks-manifest.php` file.
42+
* Added to WordPress 6.7 to improve the performance of block type registration.
43+
*
44+
* @see https://make.wordpress.org/core/2024/10/17/new-block-type-registration-apis-to-improve-performance-in-wordpress-6-7/
45+
*/
46+
if ( function_exists( 'wp_register_block_metadata_collection' ) ) {
47+
wp_register_block_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
48+
}
49+
/**
50+
* Registers the block type(s) in the `blocks-manifest.php` file.
51+
*
52+
* @see https://developer.wordpress.org/reference/functions/register_block_type/
53+
*/
54+
$manifest_data = require __DIR__ . '/build/blocks-manifest.php';
55+
foreach ( array_keys( $manifest_data ) as $block_type ) {
56+
register_block_type( __DIR__ . "/build/{$block_type}" );
57+
}
58+
}
59+
add_action( 'init', 'create_block_blocks_gamestore_block_init' );
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "blocks-gamestore/test",
5+
"version": "1.0.0",
6+
"title": "Blocks Gamestore",
7+
"category": "widgets",
8+
"icon": "smiley",
9+
"description": "Example block scaffolded with Create Block tool.",
10+
"example": {},
11+
"supports": {
12+
"html": false
13+
},
14+
"textdomain": "blocks-gamestore",
15+
"editorScript": "file:./index.js",
16+
"editorStyle": "file:./index.css",
17+
"style": "file:./style-index.css",
18+
"viewScript": "file:./view.js"
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*!*********************************************************************************************************************************************************************************************************************************************************!*\
2+
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks-gamestore/editor.scss ***!
3+
\*********************************************************************************************************************************************************************************************************************************************************/
4+
/**
5+
* The following styles get applied inside the editor only.
6+
*
7+
* Replace them with your own styles or remove the file completely.
8+
*/
9+
.wp-block-create-block-blocks-gamestore {
10+
border: 1px dotted #f00;
11+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '08aed23aad1f47f9702d');

plugins/blocks-gamestore/build/blocks-gamestore/index.css

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

plugins/blocks-gamestore/build/blocks-gamestore/index.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.

0 commit comments

Comments
 (0)