Skip to content

Instantly share code, notes, and snippets.

View breizhwave's full-sized avatar

Erwan Pianezza breizhwave

View GitHub Profile
@yunusga
yunusga / gist:33cf0ba9e311e12df4046722e93d4123
Created April 5, 2017 11:55
Debug WordPress 404 issues (permalinks, rewrite rules, etc.)
/* Produces a dump on the state of WordPress when a not found error occurs */
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */
ini_set( 'error_reporting', -1 );
ini_set( 'display_errors', 'On' );
echo '<pre>';
add_action( 'parse_request', 'debug_404_rewrite_dump' );
function debug_404_rewrite_dump( &$wp ) {
@breizhwave
breizhwave / ArticleCrudController.php
Created September 12, 2018 08:06
backpack hierachical select for nested items : example for newscrud
$this->crud->addField([ // SELECT
'label' => 'Category',
'type' => 'select2_grouped',//https://github.com/Laravel-Backpack/CRUD/issues/502
'name' => 'category_id',
'entity' => 'category',
'attribute' => 'name',
'model' => "Backpack\NewsCRUD\app\Models\Category",
'group_label_attribute' => 'name',
'group_entity' => 'Children'
]);