taskereasy-plugin.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <?php
  2. /**
  3. * Plugin Name: Taskereasy
  4. * Plugin URI: https://www.slidesigma.com/themes/wp/taskereasy/plugins
  5. * Description: A Plugin developed solely for Taskereasy theme
  6. * Version: 1.0.0
  7. * Author: Slidesigma
  8. * Author URI: slidesigma.com
  9. * License: GPL2
  10. * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  11. * Text Domain: taskereasy
  12. */
  13. if( !defined( 'ABSPATH' ) ) {
  14. die;
  15. }
  16. /*-------------------------------------------------------
  17. * Custom Widgets
  18. *-------------------------------------------------------*/
  19. require plugin_dir_path( __FILE__ ) . 'widget/instagram-widgets.php';
  20. /*-------------------------------------------------------
  21. * Custom Meta
  22. *-------------------------------------------------------*/
  23. require plugin_dir_path( __FILE__ ) . 'inc/metaboxes/category-meta.php';
  24. require plugin_dir_path( __FILE__ ) . 'inc/metaboxes/banner-meta.php';
  25. add_action( 'init', 'taskereasy_plugin_functions', 0 );
  26. function taskereasy_plugin_functions() {
  27. include_once(WP_PLUGIN_DIR.'/taskereasy-plugin/inc/metaboxes/post-type.php');
  28. }
  29. /************************Start Portfolio posttype***************/
  30. function portfolioplugin_setup_post_type() {
  31. // register the "book" custom post type
  32. register_post_type( 'Portfolios', array(
  33. 'labels' => array(
  34. 'name' =>esc_html__( 'Portfolios' ),
  35. 'singular_name' =>esc_html__( 'Portfolio' )
  36. ),
  37. 'public' => true,
  38. 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
  39. 'taxonomies' => array( 'categories' ),
  40. 'rewrite' => array('slug' => 'portfolios'),
  41. 'hierarchical' => true,
  42. 'public' => true,
  43. 'show_ui' => true,
  44. 'show_in_menu' => true,
  45. 'show_in_nav_menus' => true,
  46. 'show_in_admin_bar' => true,
  47. 'menu_position' => 50,
  48. 'can_export' => true,
  49. 'has_archive' => true,
  50. 'exclude_from_search' => false,
  51. 'publicly_queryable' => true,
  52. 'capability_type' => 'page',
  53. )
  54. );
  55. }
  56. add_action( 'init', 'portfolioplugin_setup_post_type' );
  57. add_action( 'init', 'create_portfolio_tax' );
  58. function create_portfolio_tax() {
  59. register_taxonomy(
  60. 'portfoliocategories',
  61. 'portfolios',
  62. array(
  63. 'label' =>esc_html__( 'Portfolio Categories' ),
  64. 'rewrite' => array( 'slug' => 'portfoliocategories' ),
  65. 'hierarchical' => true,
  66. )
  67. );
  68. }
  69. /************************Start Services posttype***************/
  70. function services_post_type() {
  71. // register the "book" custom post type
  72. register_post_type( 'Services', array(
  73. 'labels' => array(
  74. 'name' =>esc_html__( 'Services' ),
  75. 'singular_name' =>esc_html__( 'Service' )
  76. ),
  77. 'public' => true,
  78. 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields' ),
  79. 'taxonomies' => array( 'categories' ),
  80. 'rewrite' => array('slug' => 'services'),
  81. 'hierarchical' => true,
  82. 'public' => true,
  83. 'show_ui' => true,
  84. 'show_in_menu' => true,
  85. 'show_in_nav_menus' => true,
  86. 'show_in_admin_bar' => true,
  87. 'menu_position' => 50,
  88. 'can_export' => true,
  89. 'has_archive' => true,
  90. 'exclude_from_search' => false,
  91. 'publicly_queryable' => true,
  92. 'capability_type' => 'page',
  93. )
  94. );
  95. }
  96. add_action( 'init', 'services_post_type' );
  97. //services custom taxonomy
  98. add_action( 'init', 'create_services_tax' );
  99. function create_services_tax() {
  100. register_taxonomy(
  101. 'servicecategories',
  102. 'services',
  103. array(
  104. 'label' =>esc_html__( 'Services Categories' ),
  105. 'rewrite' => array( 'slug' => 'servicecategories' ),
  106. 'hierarchical' => true,
  107. )
  108. );
  109. }
  110. /************************Start Services posttype***************/
  111. /*******************Activation*****************/
  112. function taskereasy_install() {
  113. // trigger our function that registers the custom post type
  114. portfolioplugin_setup_post_type(); //portfolio custom posttype
  115. create_portfolio_tax();
  116. // portfolio_shortcode();
  117. services_post_type(); //service custom posttype
  118. //testimonial_post_type(); //testimonial custom posttype
  119. // clear the permalinks after the post type has been registered
  120. flush_rewrite_rules();
  121. }
  122. register_activation_hook( __FILE__, 'taskereasy_install' );
  123. /**************Deactivation*****************/
  124. function taskereasy_deactivation() {
  125. // unregister the post type, so the rules are no longer in memory
  126. unregister_post_type( 'book' );
  127. // clear the permalinks to remove our post type's rules from the database
  128. flush_rewrite_rules();
  129. }
  130. register_deactivation_hook( __FILE__, 'taskereasy_deactivation' );
  131. /*-------------------------------------------------------
  132. * Visual Composer Shortcodes
  133. *-------------------------------------------------------*/
  134. function taskereasy_load_vc_addons() {
  135. if (class_exists('WPBakeryVisualComposerAbstract')) {
  136. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-heading.php';
  137. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-testimonials.php';
  138. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-single-image.php';
  139. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-services.php';
  140. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-faq.php';
  141. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-button.php';
  142. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-image-text.php';
  143. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-timeline.php';
  144. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-team.php';
  145. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-pricing.php';
  146. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-logo.php';
  147. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-tabs.php';
  148. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-logos.php';
  149. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-blog.php';
  150. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-icon-text.php';
  151. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-portfolios.php';
  152. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-counter.php';
  153. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-address.php';
  154. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-map.php';
  155. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-youtube.php';
  156. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-cta.php';
  157. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-services-blog.php';
  158. require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-portfolios-post.php';
  159. }
  160. }
  161. add_action( 'init','taskereasy_load_vc_addons');