PageRenderTime 26ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/library/legacy/deprecated.php

https://gitlab.com/Datse-Multimedia-Productions/datse-multimedia-base
PHP | 444 lines | 176 code | 80 blank | 188 comment | 20 complexity | 9b01fed483aac5b6c66271b9db04a331 MD5 | raw file
  1. <?php
  2. /**
  3. * Deprecated Functions
  4. *
  5. * @package ThematicLegacy
  6. */
  7. /**
  8. * Function for handling the bloginfo / get_bloginfo data using our own 'cache'.
  9. *
  10. * We removed the functionality because it will not run on all systems. The system used
  11. * a fallback, but we could not guarantee that the fallback would meet every possible
  12. * error condition.
  13. *
  14. * @since 0.9.6
  15. * @deprecated 0.9.6.1
  16. */
  17. function thm_bloginfo($command = '', $echo = FALSE) {
  18. _deprecated_function( __FUNCTION__, '0.9.6.1', 'bloginfo() or get_bloginfo()' );
  19. if ($echo) {
  20. bloginfo($command);
  21. } else {
  22. return get_bloginfo($command);
  23. }
  24. }
  25. /**
  26. * Function for testing, if a sidebar has registered widgets.
  27. *
  28. * We removed the functionality because WordPress own function is_active_sidebar() is
  29. * stable.
  30. *
  31. * @since 0.9.6
  32. * @deprecated 0.9.7.3
  33. */
  34. function is_sidebar_active( $index ){
  35. _deprecated_function( __FUNCTION__, '0.9.7.3', 'is_active_sidebar()' );
  36. return is_active_sidebar( $index );
  37. }
  38. /**
  39. * Switch adding the comment-reply script
  40. *
  41. * Removed in favor of hooking into wp_enqueue_scripts over calling directly in header.php
  42. * Note that in 1.0 the comment reply script is still enqueued by default.
  43. * Use wp_dequeue_script('comment-reply') to remove the script instead of using the filter: thematic_show_commentreply.
  44. *
  45. * @deprecated 1.0
  46. */
  47. function thematic_show_commentreply() {
  48. _deprecated_function( __FUNCTION__, '1.0' );
  49. $display = TRUE;
  50. $display = apply_filters('thematic_show_commentreply', $display);
  51. if ($display)
  52. if ( is_singular() )
  53. wp_enqueue_script('comment-reply');
  54. }
  55. /**
  56. * thematic_canonical_url is no longer necessary because the functionality has been included in WordPress core since 2.9.0
  57. *
  58. * @deprecated 1.0
  59. */
  60. function thematic_canonical_url() {
  61. _deprecated_function( __FUNCTION__, '1.0' );
  62. }
  63. /**
  64. * Get the page number for title tag
  65. *
  66. * This has been integrated into thematic_doctitle()
  67. *
  68. * @deprecated 1.0
  69. */
  70. function pageGetPageNo() {
  71. _deprecated_function( __FUNCTION__, '1.0' );
  72. if ( get_query_var('paged') )
  73. print ' | Page ' . get_query_var('paged');
  74. }
  75. if ( function_exists( 'childtheme_override_comment_class' ) ) {
  76. _deprecated_function('childtheme_override_comment_class', '1.0', 'comment_class()' );
  77. /**
  78. * @ignore
  79. */
  80. function thematic_comment_class() {
  81. childtheme_override_comment_class();
  82. }
  83. } else {
  84. /**
  85. * Generates semantic classes for each comment LI element
  86. *
  87. * Removed due to duplication of the core WordPress comment_class()
  88. *
  89. * @deprecated 1.0
  90. */
  91. function thematic_comment_class( $print = true ) {
  92. _deprecated_function( __FUNCTION__, '1.0', 'comment_class()' );
  93. global $comment, $post, $thematic_comment_alt, $comment_depth, $comment_thread_alt;
  94. // Collects the comment type (comment, trackback),
  95. $c = array( $comment->comment_type );
  96. // Counts trackbacks (t[n]) or comments (c[n])
  97. if ( $comment->comment_type == 'comment' ) {
  98. $c[] = "c$thematic_comment_alt";
  99. } else {
  100. $c[] = "t$thematic_comment_alt";
  101. }
  102. // If the comment author has an id (registered), then print the log in name
  103. if ( $comment->user_id > 0 ) {
  104. $user = get_userdata($comment->user_id);
  105. // For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]'
  106. $c[] = 'byuser comment-author-' . sanitize_title_with_dashes(strtolower( $user->user_login ));
  107. // For comment authors who are the author of the post
  108. if ( $comment->user_id === $post->post_author )
  109. $c[] = 'bypostauthor';
  110. }
  111. // If it's the other to the every, then add 'alt' class; collects time- and date-based classes
  112. thematic_date_classes( mysql2date( 'U', $comment->comment_date ), $c, 'c-' );
  113. if ( ++$thematic_comment_alt % 2 )
  114. $c[] = 'alt';
  115. // Comment depth
  116. $c[] = "depth-$comment_depth";
  117. // Separates classes with a single space, collates classes for comment LI
  118. $c = join( ' ', apply_filters( 'comment_class', $c ) ); // Available filter: comment_class
  119. // Tada again!
  120. return $print ? print($c) : $c;
  121. }
  122. }
  123. /**
  124. * Generates the Thematic "Read more" text for excerpts
  125. *
  126. * Removed for namespacing
  127. *
  128. * @deprecated 1.0
  129. */
  130. function more_text() {
  131. _deprecated_function( __FUNCTION__, '1.0', 'thematic_more_text()');
  132. thematic_more_text();
  133. }
  134. /**
  135. * Filter: list_comments_arg
  136. *
  137. * Removed for namespacing
  138. *
  139. * @deprecated 1.0
  140. */
  141. function list_comments_arg() {
  142. _deprecated_function( __FUNCTION__, '1.0', 'thematic_list_comments_arg()');
  143. thematic_list_comments_arg();
  144. }
  145. /**
  146. * Create the arguments for wp_list_bookmarks in links.php
  147. *
  148. * Removed for namespacing
  149. *
  150. * @deprecated 1.0
  151. */
  152. function list_bookmarks_args() {
  153. _deprecated_function( __FUNCTION__, '1.0', 'thematic_list_bookmarks_args()' );
  154. thematic_list_bookmarks_args();
  155. }
  156. /**
  157. * Register action hook: widget_area_primary_aside
  158. *
  159. * Removed for namespacing
  160. *
  161. * @deprecated 1.0
  162. */
  163. function widget_area_primary_aside() {
  164. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_primary_aside()' );
  165. thematic_widget_area_primary_aside();
  166. }
  167. /**
  168. * Register action hook: widget_area_secondary_aside
  169. *
  170. * Removed for namespacing
  171. *
  172. * @deprecated 1.0
  173. */
  174. function widget_area_secondary_aside() {
  175. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_secondary_aside()' );
  176. thematic_widget_area_secondary_aside();
  177. }
  178. /**
  179. * Register action hook: widget_area_index_top
  180. *
  181. * Removed for namespacing
  182. *
  183. * @deprecated 1.0
  184. */
  185. function widget_area_index_top() {
  186. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_index_top()' );
  187. thematic_widget_area_index_top();
  188. }
  189. /**
  190. * Register action hook: widget_area_index_insert
  191. *
  192. * Removed for namespacing
  193. *
  194. * @deprecated 1.0
  195. */
  196. function widget_area_index_insert() {
  197. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_index_insert()' );
  198. thematic_widget_area_index_insert();
  199. }
  200. /**
  201. * Register action hook: widget_area_index_bottom
  202. *
  203. * Removed for namespacing
  204. *
  205. * @deprecated 1.0
  206. */
  207. function widget_area_index_bottom() {
  208. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_index_bottom()' );
  209. thematic_widget_area_index_bottom();
  210. }
  211. /**
  212. * Register action hook: widget_area_single_top
  213. *
  214. * Removed for namespacing
  215. *
  216. * @deprecated 1.0
  217. */
  218. function widget_area_single_top() {
  219. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_single_top()' );
  220. thematic_widget_area_single_top();
  221. }
  222. /**
  223. * Register action hook: widget_area_single_insert
  224. *
  225. * Removed for namespacing
  226. *
  227. * @deprecated 1.0
  228. */
  229. function widget_area_single_insert() {
  230. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_single_insert()' );
  231. thematic_widget_area_single_insert();
  232. }
  233. /**
  234. * Register action hook: widget_area_single_bottom
  235. *
  236. * Removed for namespacing
  237. *
  238. * @deprecated 1.0
  239. */
  240. function widget_area_single_bottom() {
  241. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_single_bottom()' );
  242. thematic_widget_area_single_bottom();
  243. }
  244. /**
  245. * Register action hook: widget_area_page_top
  246. *
  247. * Removed for namespacing
  248. *
  249. * @deprecated 1.0
  250. */
  251. function widget_area_page_top() {
  252. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_page_top()' );
  253. thematic_widget_area_page_top();
  254. }
  255. /**
  256. * Register action hook: widget_area_page_bottom
  257. *
  258. * Removed for namespacing
  259. *
  260. * @deprecated 1.0
  261. */
  262. function widget_area_page_bottom() {
  263. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_page_bottom()' );
  264. thematic_widget_page_bottom();
  265. }
  266. /**
  267. * Register action hook: widget_area_subsidiaries
  268. *
  269. * Removed for namespacing
  270. *
  271. * @deprecated 1.0
  272. */
  273. function widget_area_subsidiaries() {
  274. _deprecated_function( __FUNCTION__, '1.0', 'thematic_widget_area_subsidiaries()' );
  275. thematic_widget_area_subsidiaries();
  276. }
  277. /**
  278. * Generates the legacy comment form
  279. *
  280. * We removed the functionality because WordPress supplies its own function comment_form()
  281. *
  282. * @deprecated 1.0.2.3
  283. */
  284. function thematic_legacy_comment_form(){
  285. _deprecated_function( __FUNCTION__, '1.0.2.3', 'comment_form( thematic_comment_form_args() )' );
  286. $user = wp_get_current_user();
  287. $user_ID = ! ( is_wp_error( $user ) ) ? $user->ID : FALSE; ?>
  288. <div id="respond">
  289. <h3><?php comment_form_title( thematic_postcomment_text(), thematic_postreply_text() ); ?></h3>
  290. <div id="cancel-comment-reply"><?php cancel_comment_reply_link() ?></div>
  291. <?php if ( get_option( 'comment_registration' ) && !$user_ID ) : ?>
  292. <p id="login-req"><?php printf( __('You must be %1$slogged in%2$s to post a comment.', 'thematic'), sprintf('<a href="%s" title ="%s">', wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ), esc_attr__( 'Log in', 'thematic' ) ), '</a>' ) ?></p>
  293. <?php else : ?>
  294. <div class="formcontainer">
  295. <?php
  296. // action hook for inserting content above #commentform
  297. thematic_abovecommentsform()
  298. ?>
  299. <form id="commentform" action="<?php echo site_url( '/wp-comments-post.php' ) ?>" method="post">
  300. <?php if ( $user_ID ) : ?>
  301. <p id="login"><span class="loggedin"><?php _e('Logged in as', 'thematic' ) . printf( ' <a href="%1$s" title="%2$s">%3$s</a>', admin_url( 'profile.php' ), sprintf( esc_attr__('Logged in as %s', 'thematic'), $user_identity ) , $user_identity ) ;?></span> <span class="logout"><?php printf('<a href="%s" title="%s">%s</a>' , esc_attr( wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ), esc_attr__('Log out of this account', 'thematic' ) , __('Log out?', 'thematic' ) ); ?></span>
  302. </p>
  303. <?php else : ?>
  304. <p id="comment-notes"><?php printf( _x( 'Your email is %1$snever%2$s published nor shared.' , '%$1s and %$2s are <em> tags for emphasis on never', 'thematic' ), '<em>' , '</em>' ) ?></p>
  305. <div id="form-section-author" class="form-section">
  306. <div class="form-label"><label for="author"><?php _e( 'Name', 'thematic' ) ?></label> <?php if ( $req ) _e( '<span class="required">*</span>', 'thematic' ) ?></div>
  307. <div class="form-input"><input id="author" name="author" type="text" value="<?php echo $comment_author ?>" size="30" maxlength="20" tabindex="3" /></div>
  308. </div><!-- #form-section-author .form-section -->
  309. <div id="form-section-email" class="form-section">
  310. <div class="form-label"><label for="email"><?php _e( 'Email', 'thematic' ) ?></label> <?php if ( $req ) _e( '<span class="required">*</span>', 'thematic' ) ?></div>
  311. <div class="form-input"><input id="email" name="email" type="text" value="<?php echo $comment_author_email ?>" size="30" maxlength="50" tabindex="4" /></div>
  312. </div><!-- #form-section-email .form-section -->
  313. <div id="form-section-url" class="form-section">
  314. <div class="form-label"><label for="url"><?php _e( 'Website', 'thematic' ) ?></label></div>
  315. <div class="form-input"><input id="url" name="url" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" /></div>
  316. </div><!-- #form-section-url .form-section -->
  317. <?php endif /* if ( $user_ID ) */ ?>
  318. <div id="form-section-comment" class="form-section">
  319. <div class="form-label"><label for="comment"><?php _e( thematic_commentbox_text(), 'thematic' ) ?></label></div>
  320. <div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="6"></textarea></div>
  321. </div><!-- #form-section-comment .form-section -->
  322. <div id="form-allowed-tags" class="form-section">
  323. <p><span><?php printf( _x('You may use these %1$sHTML%2$s tags and attributes', '%$1s and %$2s are <abbr> tags', 'thematic'), '<abbr title="HyperText Markup Language">', '</abbr>' ) ?></span> <code><?php echo allowed_tags(); ?></code></p>
  324. </div>
  325. <?php do_action( 'comment_form', $post->ID ); ?>
  326. <div class="form-submit"><input id="submit" name="submit" type="submit" value="<?php echo thematic_commentbutton_text(); ?>" tabindex="7" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></div>
  327. <?php comment_id_fields(); ?>
  328. </form><!-- #commentform -->
  329. <?php
  330. // action hook for inserting content below #commentform
  331. thematic_belowcommentsform()
  332. ?>
  333. </div><!-- .formcontainer -->
  334. <?php endif /* if ( get_option('comment_registration') && !$user_ID ) */ ?>
  335. </div><!-- #respond -->
  336. <?php
  337. }
  338. /**
  339. * Redundant function for opening body tag
  340. *
  341. * the contents of this function were moved to thematic_body()
  342. *
  343. * @deprecated 1.0.3.3
  344. */
  345. function thematic_bodyopen() {
  346. _deprecated_function( __FUNCTION__, '1.0.3.3', 'thematic_body()' );
  347. }
  348. /**
  349. * Added a settings section to display legacy help text and theme links WP 3.2 compatible
  350. *
  351. * @removed in favor of adding contextual help via get_current_screen()
  352. */
  353. function thematic_legacy_help() {
  354. _deprecated_function( __FUNCTION__, '1.0.4', 'thematic_opt_page_help' );
  355. }
  356. /**
  357. * Rendered the legacy help text and theme links WP 3.2 compatible
  358. *
  359. * @removed in favor of adding contextual help via get_current_screen()
  360. */
  361. function thematic_do_legacy_help_section() {
  362. _deprecated_function( __FUNCTION__, '1.0.4', 'thematic_opt_page_help' );
  363. }
  364. ?>