PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/wordpress/wp-content/themes/hybrid/library/legacy/deprecated.php

https://github.com/nerdfiles/sideshowtramps.com
PHP | 555 lines | 314 code | 116 blank | 125 comment | 2 complexity | 4823c4fc07569ac654eec3f17282e4f3 MD5 | raw file
  1. <?php
  2. /**
  3. * Deprecated functions that should be avoided in favor of newer functions. Also handles
  4. * removed functions to avoid errors. Users should not use these functions in their child
  5. * themes. The functions below will all be removed at some point in a future release. If your
  6. * child theme is using one of these, you should use the listed alternative or remove it from
  7. * your child theme if necessary.
  8. *
  9. * @package Hybrid
  10. * @subpackage Legacy
  11. */
  12. /**
  13. * Old equivalent of hybrid_entry_class().
  14. *
  15. * @since 0.2
  16. * @deprecated 0.5 Use hybrid_entry_class() instead.
  17. */
  18. function hybrid_post_class( $deprecated = '' ) {
  19. _deprecated_function( __FUNCTION__, '0.5', 'hybrid_entry_class()' );
  20. hybrid_entry_class( $deprecated );
  21. }
  22. /**
  23. * Displays the category navigation menu and wraps it in a <div> element.
  24. *
  25. * @deprecated 0.6 Child themes should manually add a category menu using wp_list_categories().
  26. * @internal This function needs to stay for the long haul (post-1.0).
  27. *
  28. * @since 0.1
  29. */
  30. function hybrid_cat_nav() {
  31. _deprecated_function( __FUNCTION__, '0.6', 'wp_list_categories()' );
  32. echo "<div id='cat-navigation'>";
  33. do_action( 'hybrid_before_cat_nav' );
  34. echo apply_filters( 'hybrid_cat_nav', hybrid_category_menu( 'echo=0' ) );
  35. do_action( 'hybrid_after_cat_nav' );
  36. echo '</div>';
  37. }
  38. /**
  39. * Menu listing for categories. Much like WP's wp_page_menu() functionality.
  40. *
  41. * @deprecated 0.6 Child themes should manually add a category menu using wp_list_categories().
  42. * @internal This function needs to stay for the long haul (post-1.0).
  43. *
  44. * @since 0.2.3
  45. * @uses wp_list_categories() Creates a list of the site's categories
  46. * @link http://codex.wordpress.org/Template_Tags/wp_list_categories
  47. * @param array $args
  48. */
  49. function hybrid_category_menu( $args = array() ) {
  50. _deprecated_function( __FUNCTION__, '0.6', 'wp_nav_menu()' );
  51. $defaults = array( 'menu_class' => 'cat-nav', 'style' => 'list', 'hide_empty' => 1, 'use_desc_for_title' => 0, 'depth' => 4, 'hierarchical' => true, 'echo' => 1 );
  52. $args = apply_filters( 'hybrid_category_menu_args', $args );
  53. $args = wp_parse_args( $args, $defaults );
  54. extract( $args );
  55. $args['title_li'] = false;
  56. $args['echo'] = false;
  57. $menu = '<div id="' . $menu_class . '" class="' . $menu_class . '"><ul class="menu sf-menu">';
  58. $menu .= str_replace( array( "\t", "\n", "\r" ), '', wp_list_categories( $args ) );
  59. $menu .= '</ul></div>';
  60. $menu = apply_filters( 'hybrid_category_menu', $menu );
  61. if ( $echo )
  62. echo $menu;
  63. else
  64. return $menu;
  65. }
  66. /**
  67. * Loads the theme search form.
  68. *
  69. * @deprecated 0.6 Users should add get_search_form() whenever needed.
  70. * @since 0.1
  71. */
  72. function hybrid_search_form() {
  73. _deprecated_function( __FUNCTION__, '0.6', 'get_search_form()' );
  74. $search = apply_filters( 'hybrid_search_form', false );
  75. if ( empty( $search ) )
  76. get_search_form();
  77. else
  78. echo $search;
  79. }
  80. /**
  81. * After single posts but before the comments template.
  82. * @since 0.2
  83. * @deprecated 0.7 Use hybrid_after_singular().
  84. */
  85. function hybrid_after_single() {
  86. _deprecated_function( __FUNCTION__, '0.7', 'hybrid_after_singular()' );
  87. hybrid_after_singular();
  88. }
  89. /**
  90. * After page content but before the comments template.
  91. * @since 0.2
  92. * @deprecated 0.7 Use hybrid_after_singular().
  93. */
  94. function hybrid_after_page() {
  95. _deprecated_function( __FUNCTION__, '0.7', 'hybrid_after_singular()' );
  96. hybrid_after_singular();
  97. }
  98. /**
  99. * Loads the Utility: After Single widget area.
  100. *
  101. * @since 0.4
  102. * @deprecated 0.7 Use hybrid_get_utility_after_singular().
  103. */
  104. function hybrid_get_utility_after_single() {
  105. _deprecated_function( __FUNCTION__, '0.7', 'hybrid_get_utility_after_singular()' );
  106. hybrid_get_utility_after_singular();
  107. }
  108. /**
  109. * Loads the Utility: After Page widget area.
  110. *
  111. * @since 0.4
  112. * @deprecated 0.7 Use hybrid_get_utility_after_singular().
  113. */
  114. function hybrid_get_utility_after_page() {
  115. _deprecated_function( __FUNCTION__, '0.7', 'hybrid_get_utility_after_singular()' );
  116. hybrid_get_utility_after_singular();
  117. }
  118. /**
  119. * Displays the page navigation menu. Also adds some extra classes and IDs for
  120. * better CSS styling. To customize, filter wp_page_menu or wp_page_menu_args.
  121. *
  122. * @deprecated 0.8 Theme now supports the WordPress 3.0+ menu system. Since this
  123. * function and its accompanying hooks have been such a huge part of the theme, this
  124. * needs to stay for a while. Maybe remove around v.2.0. ;)
  125. *
  126. * @since 0.1
  127. * @uses wp_page_menu() Creates a menu of pages
  128. * @link http://codex.wordpress.org/Template_Tags/wp_page_menu
  129. */
  130. function hybrid_page_nav() {
  131. _deprecated_function( __FUNCTION__, '0.8', 'hybrid_get_primary_menu()' );
  132. /* Opening wrapper for the navigation area. */
  133. echo '<div id="navigation">' . "\n\t\t\t";
  134. /* Before page nav hook. */
  135. do_atomic( 'before_page_nav' );
  136. /* Arguments for wp_page_menu(). Users should filter 'wp_page_menu_args' to change. */
  137. $args = array(
  138. 'show_home' => __( 'Home', hybrid_get_textdomain() ),
  139. 'menu_class' => 'page-nav',
  140. 'sort_column' => 'menu_order',
  141. 'depth' => 4,
  142. 'echo' => 0
  143. );
  144. /* Strips formatting and spacing to make the code less messy on display. */
  145. $nav = str_replace( array( "\r", "\n", "\t" ), '', wp_page_menu( $args ) );
  146. /* Adds the #page-nav ID to the wrapping element. */
  147. $nav = str_replace( '<div class="', '<div id="page-nav" class="', $nav );
  148. /* Adds the .menu and .sf-menu classes for use with the drop-down JavaScript. */
  149. echo preg_replace( '/<ul>/', '<ul class="menu sf-menu">', $nav, 1 );
  150. /* After page nav hook. */
  151. do_atomic( 'after_page_nav' );
  152. /* Closes the navigation area wrapper. */
  153. echo "\n\t</div><!-- #navigation -->\n";
  154. }
  155. /**
  156. * Check for widgets in widget-ready areas.
  157. *
  158. * @since 0.2
  159. * @deprecated 0.6.1 Use WP's is_active_sidebar() instead.
  160. * @param string|int $index name|ID of widget area.
  161. * @return bool
  162. */
  163. function is_sidebar_active( $index = 1 ) {
  164. _deprecated_function( __FUNCTION__, '0.6.1', 'is_active_sidebar()' );
  165. return is_active_sidebar( $index );
  166. }
  167. /**
  168. * Loads the comment form.
  169. *
  170. * @since 0.7
  171. * @deprecated 0.8 Theme now uses the comment_form() WordPress 3.0+ function.
  172. */
  173. function hybrid_get_comment_form() {
  174. _deprecated_function( __FUNCTION__, '0.8', 'comment_form()' );
  175. comment_form();
  176. }
  177. /**
  178. * Fires before the comment form.
  179. *
  180. * @since 0.6
  181. * @deprecated 0.8 Theme now uses the comment_form() WordPress 3.0+ function.
  182. */
  183. function hybrid_before_comment_form() {
  184. _deprecated_function( __FUNCTION__, '0.8' );
  185. do_atomic( 'before_comment_form' );
  186. }
  187. /**
  188. * Fires after the comment form.
  189. *
  190. * @since 0.6
  191. * @deprecated 0.8 Theme now uses the comment_form() WordPress 3.0+ function.
  192. */
  193. function hybrid_after_comment_form() {
  194. _deprecated_function( __FUNCTION__, '0.8' );
  195. do_atomic( 'after_comment_form' );
  196. }
  197. /**
  198. * Displays an individual comment author.
  199. *
  200. * @since 0.2.2
  201. * @deprecated 0.8 Use hybrid_comment_author_shortcode() instead.
  202. */
  203. function hybrid_comment_author() {
  204. _deprecated_function( __FUNCTION__, '0.8', 'hybrid_comment_author_shortcode()' );
  205. return hybrid_comment_author_shortcode();
  206. }
  207. /* === Removed Functions === */
  208. /* Functions removed in the 0.4 branch. */
  209. function hybrid_theme_meta() {
  210. hybrid_function_removed( 'hybrid_theme_meta' );
  211. }
  212. function hybrid_meta_other() {
  213. hybrid_function_removed( 'hybrid_meta_other' );
  214. }
  215. function hybrid_load_SimplePie() {
  216. hybrid_function_removed( 'hybrid_load_SimplePie' );
  217. }
  218. function hybrid_lifestream() {
  219. hybrid_function_removed( 'hybrid_lifestream' );
  220. }
  221. function hybrid_admin_enqueue_style() {
  222. hybrid_function_removed( 'hybrid_admin_enqueue_style' );
  223. }
  224. function hybrid_page_id() {
  225. hybrid_function_removed( 'hybrid_page_id' );
  226. }
  227. function hybrid_page_class() {
  228. hybrid_function_removed( 'hybrid_page_class' );
  229. }
  230. /* Functions removed in the 0.5 branch. */
  231. function hybrid_all_tags() {
  232. hybrid_function_removed( 'hybrid_all_tags' );
  233. }
  234. function hybrid_get_users() {
  235. hybrid_function_removed( 'hybrid_get_users' );
  236. }
  237. function hybrid_footnote() {
  238. hybrid_function_removed( 'hybrid_footnote' );
  239. }
  240. function hybrid_related_posts() {
  241. hybrid_function_removed( 'hybrid_related_posts' );
  242. }
  243. function hybrid_insert() {
  244. hybrid_function_removed( 'hybrid_insert' );
  245. }
  246. /* Functions removed in the 0.6 branch. */
  247. function hybrid_get_authors() {
  248. hybrid_function_removed( 'hybrid_get_authors' );
  249. }
  250. function hybrid_credit() {
  251. hybrid_function_removed( 'hybrid_credit' );
  252. }
  253. function hybrid_query_counter() {
  254. hybrid_function_removed( 'hybrid_query_counter' );
  255. }
  256. function hybrid_copyright() {
  257. hybrid_function_removed( 'hybrid_copyright' );
  258. }
  259. function hybrid_series() {
  260. hybrid_function_removed( 'hybrid_series' );
  261. }
  262. /* Functions removed in the 0.7 branch. */
  263. function hybrid_all_cats() {
  264. hybrid_function_removed( 'hybrid_all_cats' );
  265. }
  266. function hybrid_all_cat_slugs() {
  267. hybrid_function_removed( 'hybrid_all_cat_slugs' );
  268. }
  269. function hybrid_all_tag_slugs() {
  270. hybrid_function_removed( 'hybrid_all_tag_slugs' );
  271. }
  272. function hybrid_mime_type_icon() {
  273. hybrid_function_removed( 'hybrid_mime_type_icon' );
  274. }
  275. function hybrid_attachment_icon() {
  276. hybrid_function_removed( 'hybrid_attachment_icon' );
  277. }
  278. function hybrid_widow() {
  279. hybrid_function_removed( 'hybrid_widow' );
  280. }
  281. function hybrid_dash() {
  282. hybrid_function_removed( 'hybrid_dash' );
  283. }
  284. function hybrid_text_filter() {
  285. hybrid_function_removed( 'hybrid_text_filter' );
  286. }
  287. function hybrid_allowed_tags() {
  288. hybrid_function_removed( 'hybrid_allowed_tags' );
  289. }
  290. function hybrid_typography() {
  291. hybrid_function_removed( 'hybrid_typography' );
  292. }
  293. function hybrid_before_cat_nav() {
  294. hybrid_function_removed( 'hybrid_before_cat_nav' );
  295. }
  296. function hybrid_after_cat_nav() {
  297. hybrid_function_removed( 'hybrid_after_cat_nav' );
  298. }
  299. function hybrid_first_paragraph() {
  300. hybrid_function_removed( 'hybrid_first_paragraph' );
  301. }
  302. function hybrid_category_term_link() {
  303. hybrid_function_removed( 'hybrid_category_term_link' );
  304. }
  305. function hybrid_post_tag_term_link() {
  306. hybrid_function_removed( 'hybrid_post_tag_term_link' );
  307. }
  308. function hybrid_search_highlight() {
  309. hybrid_function_removed( 'hybrid_search_highlight' );
  310. }
  311. function hybrid_primary_inserts() {
  312. hybrid_function_removed( 'hybrid_primary_inserts' );
  313. }
  314. function hybrid_secondary_inserts() {
  315. hybrid_function_removed( 'hybrid_secondary_inserts' );
  316. }
  317. function hybrid_subsidiary_inserts() {
  318. hybrid_function_removed( 'hybrid_subsidiary_inserts' );
  319. }
  320. function hybrid_utility_inserts() {
  321. hybrid_function_removed( 'hybrid_utility_inserts' );
  322. }
  323. function hybrid_widget_init() {
  324. hybrid_function_removed( 'hybrid_widget_init' );
  325. }
  326. function hybrid_primary_var() {
  327. hybrid_function_removed( 'hybrid_primary_var' );
  328. }
  329. function hybrid_secondary_var() {
  330. hybrid_function_removed( 'hybrid_secondary_var' );
  331. }
  332. function hybrid_subsidiary_var() {
  333. hybrid_function_removed( 'hybrid_subsidiary_var' );
  334. }
  335. function hybrid_legacy_comments() {
  336. hybrid_function_removed( 'hybrid_legacy_comments' );
  337. }
  338. function hybrid_head_feeds() {
  339. hybrid_function_removed( 'hybrid_head_feeds' );
  340. }
  341. function hybrid_legacy_functions() {
  342. hybrid_function_removed( 'hybrid_legacy_functions' );
  343. }
  344. function hybrid_capability_check() {
  345. hybrid_function_removed( 'hybrid_capability_check' );
  346. }
  347. function hybrid_template_in_use() {
  348. hybrid_function_removed( 'hybrid_template_in_use' );
  349. }
  350. function hybrid_get_utility_404() {
  351. hybrid_function_removed( 'hybrid_get_utility_404' );
  352. }
  353. function hybrid_before_comments() {
  354. hybrid_function_removed( 'hybrid_before_comments' );
  355. }
  356. function hybrid_meta_abstract() {
  357. hybrid_function_removed( 'hybrid_meta_abstract' );
  358. }
  359. function hybrid_child_settings() {
  360. hybrid_function_removed( 'hybrid_child_settings' );
  361. }
  362. function hybrid_post_meta_boxes() {
  363. hybrid_function_removed( 'hybrid_post_meta_boxes' );
  364. }
  365. function hybrid_page_meta_boxes() {
  366. hybrid_function_removed( 'hybrid_page_meta_boxes' );
  367. }
  368. function post_meta_boxes() {
  369. hybrid_function_removed( 'post_meta_boxes' );
  370. }
  371. function page_meta_boxes() {
  372. hybrid_function_removed( 'page_meta_boxes' );
  373. }
  374. function hybrid_create_meta_box() {
  375. hybrid_function_removed( 'hybrid_create_meta_box' );
  376. }
  377. function hybrid_save_meta_data() {
  378. hybrid_function_removed( 'hybrid_save_meta_data' );
  379. }
  380. function get_meta_text_input() {
  381. hybrid_function_removed( 'get_meta_text_input' );
  382. }
  383. function get_meta_select() {
  384. hybrid_function_removed( 'get_meta_select' );
  385. }
  386. function get_meta_textarea() {
  387. hybrid_function_removed( 'get_meta_textarea' );
  388. }
  389. function hybrid_error() {
  390. hybrid_function_removed( 'hybrid_error' );
  391. }
  392. function hybrid_head_canonical() {
  393. hybrid_function_removed( 'hybrid_head_canonical' );
  394. }
  395. function hybrid_disable_pagenavi_style() {
  396. hybrid_function_removed( 'hybrid_disable_pagenavi_style' );
  397. }
  398. function hybrid_comments_feed() {
  399. hybrid_function_removed( 'hybrid_comments_feed' );
  400. }
  401. function hybrid_before_page_nav() {
  402. hybrid_function_removed( 'hybrid_before_page_nav' );
  403. }
  404. function hybrid_after_page_nav() {
  405. hybrid_function_removed( 'hybrid_after_page_nav' );
  406. }
  407. function hybrid_comment_published_link_shortcode() {
  408. hybrid_function_removed( 'hybrid_comment_published_link_shortcode' );
  409. }
  410. /* Functions removed in the 0.8 branch. */
  411. function hybrid_content_wrapper() {
  412. hybrid_function_removed( 'hybrid_content_wrapper' );
  413. }
  414. function hybrid_handle_attachment() {
  415. hybrid_function_removed( 'hybrid_handle_attachment' );
  416. }
  417. function hybrid_widget_class() {
  418. hybrid_function_removed( 'hybrid_widget_class' );
  419. }
  420. function hybrid_before_ping_list() {
  421. hybrid_function_removed( 'hybrid_before_ping_list' );
  422. }
  423. function hybrid_after_ping_list() {
  424. hybrid_function_removed( 'hybrid_after_ping_list' );
  425. }
  426. function hybrid_pings_callback() {
  427. hybrid_function_removed( 'hybrid_pings_callback' );
  428. }
  429. function hybrid_pings_end_callback() {
  430. hybrid_function_removed( 'hybrid_pings_end_callback' );
  431. }
  432. /**
  433. * Message to display for removed functions.
  434. * @since 0.5
  435. */
  436. function hybrid_function_removed( $func = '' ) {
  437. die( sprintf( __( '<code>%1$s</code> &mdash; This function has been removed or replaced by another function.', hybrid_get_textdomain() ), $func ) );
  438. }
  439. ?>