Welcome Guest, Not a member yet? Register   Sign In
Tendoo CMS: New upcoming "Post Type"
#3

(This post was last modified: 08-03-2015, 01:32 PM by Blair2004.)

After advanced review, using "load_post_types" within "after_app_init" hook no work properly.
i'm working on hook priority to fix it. Unless that, "load_post_types" hook must be called out any other hook, like this :

PHP Code:
<?php

class blog extends CI_model
{
 
   function __construct()
 
   {
 
       parent::__construct();
 
       $this->events->add_action'after_app_init' , array( $this 'loader' ) );
        
$this->events->add_action'load_post_types' , array( $this 'blog_post_type' ) ); // loaded out any hooks
 
   }
 
    
    function loader
()
 
   {
 
       if( ! Modules::is_active'post_type' ) ) // if module is not active add a notice...
 
       {
 
           $this->events->add_filter'ui_notices' , function( $notices ){
 
               $notices[]       array(
 
                   'msg'    =>    __'Post Type module is not enabled...' ),
 
                   'icon'    => 'times',
 
                   'type'    =>    'warning'
 
               );
 
               return $notices;
 
           });
 
       }
 
   }
 
   function blog_post_type()
 
   {
 
       // Blog
 
       $this->load->library'PostType' , array(
 
           'namespace'                =>    'blog',
 
           'label'                    =>    __'Blog Post' ),
 
           'menu-icon'                =>    'fa fa-newspaper-o',
 
           'is-hierarchical'               =>    false
        
) , 'blog' );
 
       
        $this
->blog->define_taxonomy   'category' __'Category' ) , array() );
 
       
        $this
->blog->define_taxonomy   'tag' __'Tags' ) , array() );    
        
        $this
->blog->run();
 
       
        
// Page
 
       $this->load->library'PostType' , array(
 
           'namespace'        =>    'page',
 
           'label'            =>    __'Pages' ),
 
           'menu-icon'        =>    'fa fa-file',
 
           'is-hierarchical'    =>    true
        
) , 'page' );
 
       
        $this
->page->run();
 
   }

NexoPOS 2.6.2 available on CodeCanyon.
Reply


Messages In This Thread
RE: Tendoo CMS: New upcoming "Post Type" - by Blair2004 - 08-03-2015, 01:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB