Comments (3)
Hey thanks for reporting the issue. We'll look into whether we can apply your fix to the Lumberjack core. In the meantime, you can replace the core CustomPostTypeServiceProvider
with your own version.
In config/app.php
all the service providers are defined here:
https://github.com/Rareloop/lumberjack/blob/master/config/app.php#L22
You should be able to add your own service provider inside of your theme. Here are some docs on creating a service provider if that's new to you:
https://docs.lumberjack.rareloop.com/container/service-providers#creating-service-providers
Once you have your own service provider, replace our one with yours in config/app.php
. For example:
/**
* List of providers to initialise during app boot
*/
'providers' => [
Rareloop\Lumberjack\Providers\RouterServiceProvider::class,
Rareloop\Lumberjack\Providers\WordPressControllersServiceProvider::class,
Rareloop\Lumberjack\Providers\TimberServiceProvider::class,
Rareloop\Lumberjack\Providers\ImageSizesServiceProvider::class,
// Rareloop\Lumberjack\Providers\CustomPostTypesServiceProvider::class,
Rareloop\Lumberjack\Providers\MenusServiceProvider::class,
Rareloop\Lumberjack\Providers\LogServiceProvider::class,
Rareloop\Lumberjack\Providers\ThemeSupportServiceProvider::class,
Rareloop\Lumberjack\Providers\QueryBuilderServiceProvider::class,
Rareloop\Lumberjack\Providers\SessionServiceProvider::class,
Rareloop\Lumberjack\Providers\EncryptionServiceProvider::class,
// Application Providers
App\Providers\AppServiceProvider::class,
App\Providers\CustomPostTypesServiceProvider,
],
Hope this helps!
from lumberjack.
@adamtomat thanks for the temp fix! Great work. I've manage to get the CPT labels translated with my own Service Provider
from lumberjack.
Small update if you are looking for this. I think this is a beter solutions for the service provider:
<?php
namespace App\Providers;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Providers\ServiceProvider;
class CustomBlocksServiceProvider extends ServiceProvider
{
public function boot(Config $config)
{
$blocks = $config->get('blocks.register');
foreach ($blocks as $block) {
add_action('init', [$block, 'register']);
}
}
}
from lumberjack.
Related Issues (20)
- Post Type not registering HOT 6
- Wrong class on the WordPress Controllers documentation? HOT 2
- Undefined Illuminate classes
- Custom Taxonomy support in Lumberjack HOT 5
- Enqueue Assets HOT 2
- Popularity HOT 4
- lumberjack-bedrock permission error while cloning Bedrock repository HOT 3
- Lumberjack doesn't see archive-{post_type}.php with proper controller class HOT 4
- Incomplete theme HOT 2
- Request with a dot (".") inside a Custom Route paramter returns a 404 (not found) exception HOT 2
- WooCommerce products in Lumberjack HOT 1
- How can I return a 404 Not Found error from my product controller? HOT 1
- [bug] site stop working after install wp-browser
- Twig dump error? HOT 4
- QueryBuilder - Collection error after installing Intervention/ImageCache HOT 1
- pass cache time to TimberResponse?
- Access correct pagination information when using the Query Builder HOT 1
- php 8.0.0 not compatible with v4 (composer issue)
- PHP8 Compatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lumberjack.