dmhendricks / wordpress-base-plugin Goto Github PK
View Code? Open in Web Editor NEWA starter template for WordPress plugins, with autoloading, namespaces and object caching (where available).
License: GNU General Public License v2.0
A starter template for WordPress plugins, with autoloading, namespaces and object caching (where available).
License: GNU General Public License v2.0
Hey man,
just a quick hint. In your composer.json
you require "php": ">=5.3.29"
. But in multiple files you're using PHP's short array syntax [ 'value' ]
, which is available from PHP 5.4+.
In case anyone needs to add Gutenbergs blocks to the plugin:
Gutenbergs_Loader.php content:
<?php
namespace VendorName\PluginName\Gutenbergs;
use VendorName\PluginName\Plugin;
class Gutenbergs_Loader extends Plugin
{
public function __construct()
{
new MyGutenberg();
}
}
MyGutenberg.php content:
<?php
namespace VendorName\PluginName\Gutenbergs;
use VendorName\PluginName\Plugin;
use Carbon_Fields\Block;
use Carbon_Fields\Field;
class MyGutenberg extends Plugin {
public function __construct() {
CARBON FIELDS BLOCK CODE
}
}
https://docs.carbonfields.net/learn/containers/gutenberg-blocks.html
Plugin.php content
// Load Gutenbergs new Gutenbergs\Gutenbergs_Loader();
at load_plugin()
vendor/
from repoIn wordpress-base-plugin.php
is the closing tag ?>
used. I learnt that this is bad practice and should be avoided.
Hi,
thank you first off all for inviting me as collaborator. I appreciate that. As you already saw I forked the project and worked on some own ideas. The reason why I did not send a pull request is, I have the feeling we have different ideas how things should be built. I don't say my style is better than your's but different. So before I join forces, I would like to see how this thing might work out.
I would like to build nice boilerplate plugin, which implements current best practices (from the PHP world not only WordPress) and is ready to run and has some example code already on board. But I guess this not the main issue because your repo already goes in that direction ๐
The things that keep me thinking are different design decisions. Based on my last issues, I conclude we do things differently. And so I would like hear what you think about some ideas I implemented on my fork.
PostTypes/
, Shortcodes/
, 'Widgets/`)WdigetLoader
and ExampleWidget
)ShortcodeLoader
according to WidgetLoader
. And to make things more OOP I also added an interface ShortcodeInterface
to make sure every shortcodes follows the some structureassets/
to resources/
and all compiled files are placed in public/
. (This is how Laravel does it)$settings
variable in Plugin
is nice, but I would go a step further an decouple that from that class and introduce a registry.These are the things I changed so far. What do you think?
Hi ,
I don't know if im doing something wrong, but I edit and installed the pluggin twice, in the same wordpress installation.
I did all the steps in the Documentation, Installing carbon field with composer in both of them.
both have a custom posttype with custom fields created with carbon fields.
but the fields in the second plugin are saved with a wrong prefix . Both custom posts, from two different plugins, get the same prefix for theirs metas.
if I deactivate the first plugin, the other plugin gets fixed, and its custom fields are saved right.
Thanks!
Add PHP Check wpupdatephp/wp-update-php
.
I like to use WPupdatePHP in my plugins, because I thinks it is good practice to inform the user if their PHP version does not fit my requirements.
Especially useful, when PHP 7 is used in a Plugin.
When installing on a windows machine, I'm getting this error:
Warning: fopen(C:\Users\admin\Code\CES-Wordpress-Base\wp-content\plugins\CES-Client/CES-Client/CES-Client.php): failed to open stream: No such file or directory in C:\Users\admin\Code\CES-Wordpress-Base\wp-includes\functions.php on line 4835
This folder doesn't exist:
C:\Users\admin\Code\CES-Wordpress-Base\wp-content\plugins\CES-Client/CES-Client/
Plugin is installed at
C:\Users\admin\Code\CES-Wordpress-Base\wp-content\plugins\CES-Client/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.