/components/admin/component.php

  1. <?php 
  2. /** 
  3. * Facebook Fanpage Import Showdata Component. 
  4. * 
  5. * This class initializes the component. 
  6. * 
  7. * @author mahype, awesome.ug <very@awesome.ug> 
  8. * @package Facebook Fanpage Import 
  9. * @version 1.0.0 
  10. * @since 1.0.0 
  11. * @license GPL 2 
  12.   
  13. Copyright 2015 Awesome UG (very@awesome.ug) 
  14.   
  15. This program is free software; you can redistribute it and/or modify 
  16. it under the terms of the GNU General Public License, version 2, as  
  17. published by the Free Software Foundation. 
  18.   
  19. This program is distributed in the hope that it will be useful,  
  20. but WITHOUT ANY WARRANTY; without even the implied warranty of 
  21. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  22. GNU General Public License for more details. 
  23.   
  24. You should have received a copy of the GNU General Public License 
  25. along with this program; if not, write to the Free Software 
  26. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 
  27.   
  28. */ 
  29.  
  30. if ( !defined( 'ABSPATH' ) ) exit; 
  31.  
  32. use skip\v1_0_0 as skip; 
  33.  
  34. class FacebookFanpageImportAdmin{ 
  35. var $name; 
  36.  
  37. /** 
  38. * Initializes the Component. 
  39. * @since 1.0.0 
  40. */ 
  41. function __construct() { 
  42. $this->name = get_class( $this ); 
  43. $this->includes(); 
  44.  
  45.  
  46. if( 'status' == skip\value( 'fbfpi_settings', 'insert_post_type' ) ) 
  47. add_action( 'init', array( $this, 'custom_post_types' ), 11 ); 
  48.  
  49.  
  50. // Functions in Admin 
  51. if( is_admin() ): 
  52. // add_action( 'admin_menu', array( $this, 'admin_menu' ) ); 
  53. endif; 
  54. } // end constructor 
  55.  
  56.  
  57. /** 
  58. * Creates Custom Post Types 
  59. * @since 1.0.0 
  60. */  
  61. public function custom_post_types() { 
  62. $args_post_type = array( 
  63. 'labels' => array( 
  64. 'name' => __( 'Status Messages', 'fbfpi-locale' ),  
  65. 'singular_name' => __( 'Status Message', 'fbfpi-locale' ) 
  66. ),  
  67. 'public' => TRUE,  
  68. 'has_archive' => TRUE,  
  69. 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),  
  70. 'rewrite' => array( 
  71. 'slug' => 'status-message',  
  72. 'with_front' => TRUE 
  73. );  
  74. register_post_type( 'status-message', $args_post_type );  
  75.  
  76. /** 
  77. * Including needed Files. 
  78. * @since 1.0.0 
  79. */  
  80. private function includes() { 
  81. include( dirname(__FILE__) . '/settings.php' ); 
  82.  
  83. $FacebookFanpageImportAdmin = new FacebookFanpageImportAdmin(); 
.