/modules/custom-content-types.php

  1. <?php 
  2.  
  3. /** 
  4. * Module Name: Custom Content Types 
  5. * Module Description: Organize and display different types of content on your site, separate from posts and pages. 
  6. * First Introduced: 3.1 
  7. * Requires Connection: No 
  8. * Auto Activate: Yes 
  9. * Module Tags: Writing 
  10. * Sort Order: 34 
  11. * Additional Search Queries: cpt, custom post types, portfolio, portfolios, testimonial, testimonials 
  12. */ 
  13.  
  14. function jetpack_load_custom_post_types() { 
  15. include dirname( __FILE__ ) . "/custom-post-types/portfolios.php"; 
  16.  
  17. function jetpack_custom_post_types_loaded() { 
  18. Jetpack::enable_module_configurable( __FILE__ ); 
  19. Jetpack::module_configuration_load( __FILE__, 'jetpack_custom_post_types_configuration_load' ); 
  20. add_action( 'jetpack_modules_loaded', 'jetpack_custom_post_types_loaded' ); 
  21.  
  22. function jetpack_custom_post_types_configuration_load() { 
  23. wp_safe_redirect( admin_url( 'options-writing.php#cpt-options' ) ); 
  24. exit; 
  25.  
  26. // Add Settings Section for CPT 
  27. function jetpack_cpt_settings_api_init() { 
  28. add_settings_section( 
  29. 'jetpack_cpt_section',  
  30. '<span id="cpt-options">' . __( 'Your Custom Content Types', 'jetpack' ) . '</span>',  
  31. 'jetpack_cpt_section_callback',  
  32. 'writing' 
  33. ); 
  34. add_action( 'admin_init', 'jetpack_cpt_settings_api_init' ); 
  35.  
  36. /** 
  37. * Settings Description 
  38. */ 
  39. function jetpack_cpt_section_callback() { 
  40. ?> 
  41. <p> 
  42. <?php esc_html_e( 'Use these settings to display different types of content on your site.', 'jetpack' ); ?> 
  43. <a target="_blank" href="http://jetpack.me/support/custom-content-types/"><?php esc_html_e( 'Learn More', 'jetpack' ); ?></a> 
  44. </p> 
  45. <?php 
  46.  
  47. jetpack_load_custom_post_types(); 
.