PHP code example of dekodeinteraktiv / hogan-core

1. Go to this page and download the library: Download dekodeinteraktiv/hogan-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dekodeinteraktiv / hogan-core example snippets



class DemoModule extends extends \Dekode\Hogan\Module {
  …
}

add_action( 'hogan/include_modules', function( \Dekode\Hogan\Core $core ) {
  

add_filter( 'hogan/field_group/default/supported_post_types', function( array $post_types ) : array {
	$post_types[] = 'post'; // Add Hogan support for posts.
	return $post_types;
}, 10, 2 );

'name'                           => 'default',
'title'                          => __( 'Content Modules', 'hogan-core' ),
'modules'                        => [], // All modules.
'location'                       => [],
'hide_on_screen'                 => [],
'fields_before_flexible_content' => [],
'fields_after_flexible_content'  => [],

add_filter( 'hogan/field_group/default/enabled', '__return_false' );

add_action( 'hogan/our field group args.
  $core->register_field_group( $args );
}, 10, 1 );

add_action( 'hogan/field_group( [
    'name' => 'field_group_1',
    'title' => __( 'Field group title', 'text-domain' ),
    'modules' => [ 'text' ],
    'location' => [
      [
        [
		  'param' => 'post_type',
		  'operator' => '==',
          'value' => 'post',
        ],
      ],
    ],
  ] );
}, 10, 1);

add_filter( 'hogan/frontend/content_width', function( int $content_width ) {
	return 1920;
}

wp_deregister_style( 'hogan-core' );

add_filter( 'hogan/searchwp/index_modules_as_post_content', '__return_false' );

add_filter( 'hogan/module/text/heading/enabled', '__return_true' );
add_filter( 'hogan/module/text/lead/enabled', '__return_true' );