PageRenderTime 45ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/news/plugins/news-post-types/news-post-types.php

https://bitbucket.org/lgorence/quickpress
PHP | 99 lines | 53 code | 9 blank | 37 comment | 0 complexity | 0c1fd224516252e7e22dcd6feb2a0b24 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
  1. <?php
  2. /**
  3. * Plugin Name: News Post Types
  4. * Plugin URI: http://justintadlock.com/archives/2009/09/17/members-wordpress-plugin
  5. * Description: Registers post types for the News theme for backward compatibility with the original theme release.
  6. * Version: 0.1
  7. * Author: Justin Tadlock
  8. * Author URI: http://justintadlock.com
  9. *
  10. * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
  11. * General Public License version 2, as published by the Free Software Foundation. You may NOT assume
  12. * that you can use any other version of the GPL.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  15. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. *
  17. * You should have received a copy of the GNU General Public License along with this program; if not, write
  18. * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. * @package NewsPostTypes
  21. * @version 0.1.0
  22. * @author Justin Tadlock <justin@justintadlock.com>
  23. * @copyright Copyright (c) 2010 - 2012
  24. * @link http://themehybrid.com/themes/news
  25. * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  26. */
  27. /* Register custom post types. */
  28. add_action( 'init', 'news_register_post_types' );
  29. /**
  30. * Registers custom post types. We're registering the Video and Slideshow post types.
  31. *
  32. * @since 0.1.0
  33. */
  34. function news_register_post_types() {
  35. /* Labels for the video post type. */
  36. $video_labels = array(
  37. 'name' => __( 'Videos', 'news' ),
  38. 'singular_name' => __( 'Video', 'news' ),
  39. 'add_new' => __( 'Add New', 'news' ),
  40. 'add_new_item' => __( 'Add New Video', 'news' ),
  41. 'edit' => __( 'Edit', 'news' ),
  42. 'edit_item' => __( 'Edit Video', 'news' ),
  43. 'new_item' => __( 'New Video', 'news' ),
  44. 'view' => __( 'View Video', 'news' ),
  45. 'view_item' => __( 'View Video', 'news' ),
  46. 'search_items' => __( 'Search Videos', 'news' ),
  47. 'not_found' => __( 'No videos found', 'news' ),
  48. 'not_found_in_trash' => __( 'No videos found in Trash', 'news' ),
  49. );
  50. /* Arguments for the video post type. */
  51. $video_args = array(
  52. 'labels' => $video_labels,
  53. 'capability_type' => 'post',
  54. 'public' => true,
  55. 'can_export' => true,
  56. 'query_var' => true,
  57. 'rewrite' => array( 'slug' => 'videos', 'with_front' => false ),
  58. 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields', 'comments', 'trackbacks', 'entry-views' ),
  59. );
  60. /* Labels for the slideshow post type. */
  61. $slideshow_labels = array(
  62. 'name' => __( 'Slideshows', 'news' ),
  63. 'singular_name' => __( 'Slideshow', 'news' ),
  64. 'add_new' => __( 'Add New', 'news' ),
  65. 'add_new_item' => __( 'Add New Slideshow', 'news' ),
  66. 'edit' => __( 'Edit', 'news' ),
  67. 'edit_item' => __( 'Edit Slideshow', 'news' ),
  68. 'new_item' => __( 'New Slideshow', 'news' ),
  69. 'view' => __( 'View Slideshow', 'news' ),
  70. 'view_item' => __( 'View Slideshow', 'news' ),
  71. 'search_items' => __( 'Search Slideshows', 'news' ),
  72. 'not_found' => __( 'No slideshows found', 'news' ),
  73. 'not_found_in_trash' => __( 'No slideshows found in Trash', 'news' ),
  74. );
  75. /* Arguments for the slideshow post type. */
  76. $slideshow_args = array(
  77. 'labels' => $slideshow_labels,
  78. 'capability_type' => 'post',
  79. 'public' => true,
  80. 'can_export' => true,
  81. 'query_var' => true,
  82. 'rewrite' => array( 'slug' => 'slideshows', 'with_front' => false ),
  83. 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields', 'comments', 'trackbacks', 'entry-views' ),
  84. );
  85. /* Register the video post type. */
  86. register_post_type( apply_filters( 'news_video_post_type', 'video' ), apply_filters( 'news_video_post_type_args', $video_args ) );
  87. /* Register the slideshow post type. */
  88. register_post_type( apply_filters( 'news_slideshow_post_type', 'slideshow' ), apply_filters( 'news_slideshow_post_type_args', $slideshow_args ) );
  89. }
  90. ?>