/src/lib/compat/shortcodes.php

https://github.com/mgsisk/webcomic · PHP · 854 lines · 482 code · 104 blank · 268 comment · 12 complexity · 2675959350dab46a16e5bdca4a085704 MD5 · raw file

  1. <?php
  2. /**
  3. * Deprecated shortcodes
  4. *
  5. * @package Webcomic
  6. */
  7. namespace Mgsisk\Webcomic\Compat;
  8. use WebcomicTag;
  9. use function Mgsisk\Webcomic\Collection\has_webcomic_media_shortcode;
  10. /**
  11. * Add deprecated shortcodes.
  12. *
  13. * @return void
  14. */
  15. function shortcodes() {
  16. add_shortcode( 'the_webcomic_collections', __NAMESPACE__ . '\the_webcomic_collections_shortcode' );
  17. add_shortcode( 'the_related_webcomics', __NAMESPACE__ . '\the_related_webcomics_shortcode' );
  18. add_shortcode( 'webcomic_collection_poster', __NAMESPACE__ . '\webcomic_collection_poster_shortcode' );
  19. add_shortcode( 'webcomic_dropdown_collections', __NAMESPACE__ . '\webcomic_dropdown_collections_shortcode' );
  20. add_shortcode( 'webcomic_list_collections', __NAMESPACE__ . '\webcomic_list_collections_shortcode' );
  21. add_shortcode( 'webcomic_collection_cloud', __NAMESPACE__ . '\webcomic_collection_cloud_shortcode' );
  22. add_shortcode( 'the_webcomic', __NAMESPACE__ . '\the_webcomic_shortcode' );
  23. add_shortcode( 'webcomic_count', __NAMESPACE__ . '\webcomic_count_shortcode' );
  24. add_shortcode( 'verify_webcomic_age', __NAMESPACE__ . '\verify_webcomic_age_shortcode' );
  25. add_shortcode( 'verify_webcomic_role', __NAMESPACE__ . '\verify_webcomic_role_shortcode' );
  26. add_shortcode( 'the_webcomic_characters', __NAMESPACE__ . '\the_webcomic_terms_shortcode' );
  27. add_shortcode( 'the_webcomic_storylines', __NAMESPACE__ . '\the_webcomic_terms_shortcode' );
  28. add_shortcode( 'webcomic_character_crossovers', __NAMESPACE__ . '\webcomic_term_crossovers_shortcode' );
  29. add_shortcode( 'webcomic_storyline_crossovers', __NAMESPACE__ . '\webcomic_term_crossovers_shortcode' );
  30. add_shortcode( 'webcomic_character_avatar', __NAMESPACE__ . '\webcomic_term_media_shortcode' );
  31. add_shortcode( 'webcomic_storyline_cover', __NAMESPACE__ . '\webcomic_term_media_shortcode' );
  32. add_shortcode( 'webcomic_character_cloud', __NAMESPACE__ . '\webcomic_term_cloud_shortcode' );
  33. add_shortcode( 'webcomic_storyline_cloud', __NAMESPACE__ . '\webcomic_term_cloud_shortcode' );
  34. add_shortcode( 'webcomic_dropdown_characters', __NAMESPACE__ . '\webcomic_dropdown_terms_shortcode' );
  35. add_shortcode( 'webcomic_dropdown_storylines', __NAMESPACE__ . '\webcomic_dropdown_terms_shortcode' );
  36. add_shortcode( 'webcomic_list_characters', __NAMESPACE__ . '\webcomic_list_terms_shortcode' );
  37. add_shortcode( 'webcomic_list_storylines', __NAMESPACE__ . '\webcomic_list_terms_shortcode' );
  38. add_shortcode( 'webcomic_crossover_description', __NAMESPACE__ . '\webcomic_crossover_description_shortcode' );
  39. add_shortcode( 'webcomic_crossover_poster', __NAMESPACE__ . '\webcomic_crossover_poster_shortcode' );
  40. add_shortcode( 'webcomic_crossover_title', __NAMESPACE__ . '\webcomic_crossover_title_shortcode' );
  41. add_shortcode( 'webcomic_collection_crossovers', __NAMESPACE__ . '\webcomic_collection_crossovers_shortcode' );
  42. add_shortcode( 'purchase_webcomic_link', __NAMESPACE__ . '\purchase_webcomic_link_shortcode' );
  43. add_shortcode( 'webcomic_collection_print_amount', __NAMESPACE__ . '\webcomic_collection_print_amount_shortcode' );
  44. add_shortcode( 'webcomic_donation_amount', __NAMESPACE__ . '\webcomic_donation_amount_shortcode' );
  45. add_shortcode( 'webcomic_donation_form', __NAMESPACE__ . '\webcomic_donation_form_shortcode' );
  46. add_shortcode( 'webcomic_print_amount', __NAMESPACE__ . '\webcomic_print_amount_shortcode' );
  47. add_shortcode( 'webcomic_print_adjustment', __NAMESPACE__ . '\webcomic_print_adjustment_shortcode' );
  48. add_shortcode( 'webcomic_print_form', __NAMESPACE__ . '\webcomic_print_form_shortcode' );
  49. add_shortcode( 'webcomic_transcripts_link', __NAMESPACE__ . '\webcomic_transcripts_link_shortcode' );
  50. }
  51. /**
  52. * Deprecated shortcode.
  53. *
  54. * @param array $atts Optional attributes.
  55. * @param string $content Unused shortcode content.
  56. * @param string $name Shortcode name.
  57. * @return string
  58. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  59. */
  60. function the_webcomic_collections_shortcode( $atts, string $content, string $name ) : string {
  61. webcomic_error( __( '[the_webcomic_collections] is deprecated; use [webcomic_collections_list] instead.', 'webcomic' ) );
  62. $args = shortcode_atts(
  63. [
  64. 'id' => 0,
  65. 'before' => '',
  66. 'sep' => ', ',
  67. 'after' => '',
  68. 'target' => 'self',
  69. 'image' => '',
  70. 'crossover' => true,
  71. ], $atts, $name
  72. );
  73. return WebcomicTag::get_the_webcomic_collection_list_( $args['id'], $args['before'], $args['sep'], $args['after'], $args['target'], $args['image'], $args['crossover'] );
  74. }
  75. /**
  76. * Deprecated shortcode.
  77. *
  78. * @param array $atts Optional attributes.
  79. * @param string $content Unused shortcode content.
  80. * @param string $name Shortcode name.
  81. * @return string
  82. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  83. */
  84. function the_related_webcomics_shortcode( $atts, string $content, string $name ) : string {
  85. webcomic_error( __( '[the_related_webcomics] is deprecated; use [webcomics_list] instead.', 'webcomic' ) );
  86. $args = shortcode_atts(
  87. [
  88. 'before' => '',
  89. 'sep' => ', ',
  90. 'after' => '',
  91. 'image' => '',
  92. 'limit' => 5,
  93. 'storylines' => true,
  94. 'characters' => true,
  95. 'the_post' => false,
  96. ], $atts, $name
  97. );
  98. return WebcomicTag::the_related_webcomics_( $args['before'], $args['sep'], $args['after'], $args['image'], $args['limit'], $args['storylines'], $args['characters'], $args['the_post'] );
  99. }
  100. /**
  101. * Deprecated shortcode.
  102. *
  103. * @param array $atts Optional attributes.
  104. * @param string $content Unused shortcode content.
  105. * @param string $name Shortcode name.
  106. * @return string
  107. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  108. */
  109. function webcomic_collection_poster_shortcode( $atts, string $content, string $name ) : string {
  110. webcomic_error( __( '[webcomic_collection_poster] is deprecated; use [webcomic_collection_media] instead.', 'webcomic' ) );
  111. $args = shortcode_atts(
  112. [
  113. 'size' => 'full',
  114. 'collection' => '',
  115. ], $atts, $name
  116. );
  117. return get_webcomic_collection_media( $args['size'], $args['collection'] );
  118. }
  119. /**
  120. * Deprecated shortcode.
  121. *
  122. * @param array $atts Optional attributes.
  123. * @param string $content Unused shortcode content.
  124. * @param string $name Shortcode name.
  125. * @return string
  126. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  127. */
  128. function webcomic_dropdown_collections_shortcode( $atts, string $content, string $name ) : string {
  129. webcomic_error( __( '[webcomic_dropdown_collections] is deprecated; use [webcomic_collections_list] instead.', 'webcomic' ) );
  130. $args = shortcode_atts(
  131. [
  132. 'select_name' => 'webcomic_collections',
  133. 'id' => '',
  134. 'class' => '',
  135. 'show_option_all' => '',
  136. 'show_option_none' => '',
  137. 'hide_empty' => true,
  138. 'hide_if_empty' => true,
  139. 'collection' => '',
  140. 'orderby' => '',
  141. 'callback' => '',
  142. 'webcomics' => false,
  143. 'show_count' => false,
  144. 'target' => 'self',
  145. 'selected' => '',
  146. ], $atts, $name
  147. );
  148. return WebcomicTag::webcomic_dropdown_collections_( $args );
  149. }
  150. /**
  151. * Deprecated shortcode.
  152. *
  153. * @param array $atts Optional attributes.
  154. * @param string $content Unused shortcode content.
  155. * @param string $name Shortcode name.
  156. * @return string
  157. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  158. */
  159. function webcomic_list_collections_shortcode( $atts, string $content, string $name ) : string {
  160. webcomic_error( __( '[webcomic_list_collections] is deprecated; use [webcomic_collections_list] instead.', 'webcomic' ) );
  161. $args = shortcode_atts(
  162. [
  163. 'id' => '',
  164. 'class' => '',
  165. 'before' => '',
  166. 'after' => '',
  167. 'hide_empty' => true,
  168. 'ordered' => '',
  169. 'collection' => '',
  170. 'order' => 'asc',
  171. 'orderby' => '',
  172. 'callback' => false,
  173. 'feed' => '',
  174. 'feed_type' => 'rss2',
  175. 'webcomics' => false,
  176. 'webcomic_order' => 'asc',
  177. 'webcomic_orderby' => 'date',
  178. 'webcomic_image' => '',
  179. 'show_count' => false,
  180. 'show_description' => false,
  181. 'show_image' => '',
  182. 'target' => 'self',
  183. 'selected' => 0,
  184. ], $atts, $name
  185. );
  186. return WebcomicTag::webcomic_list_collections_( $args );
  187. }
  188. /**
  189. * Deprecated shortcode.
  190. *
  191. * @param array $atts Optional attributes.
  192. * @param string $content Unused shortcode content.
  193. * @param string $name Shortcode name.
  194. * @return string
  195. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  196. */
  197. function webcomic_collection_cloud_shortcode( $atts, string $content, string $name ) : string {
  198. webcomic_error( __( '[webcomic_collection_cloud] is deprecated; use [webcomic_collections_list] instead.', 'webcomic' ) );
  199. $args = shortcode_atts(
  200. [
  201. 'id' => '',
  202. 'class' => '',
  203. 'smallest' => 75,
  204. 'largest' => 150,
  205. 'unit' => '%',
  206. 'image' => '',
  207. 'before' => '',
  208. 'after' => '',
  209. 'sep' => ' ',
  210. 'orderby' => '',
  211. 'order' => 'rand',
  212. 'callback' => '',
  213. 'show_count' => false,
  214. 'target' => 'self',
  215. 'selected' => 0,
  216. ], $atts, $name
  217. );
  218. return WebcomicTag::webcomic_collection_cloud_( $args );
  219. }
  220. /**
  221. * Deprecated shortcode.
  222. *
  223. * @param array $atts Optional attributes.
  224. * @param string $content Unused shortcode content.
  225. * @param string $name Shortcode name.
  226. * @return string
  227. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  228. */
  229. function the_webcomic_shortcode( $atts, string $content, string $name ) : string {
  230. webcomic_error( __( '[the_webcomic] is deprecated; use [webcomic_media] instead.', 'webcomic' ) );
  231. $args = shortcode_atts(
  232. [
  233. 'size' => 'full',
  234. 'relative' => '',
  235. 'in_same_term' => false,
  236. 'excluded_terms' => '',
  237. 'taxonomy' => 'storyline',
  238. 'the_post' => false,
  239. ], $atts, $name
  240. );
  241. return WebcomicTag::the_webcomic_( $args['size'], $args['relative'], $args['in_same_term'], $args['excluded_terms'], $args['taxonomy'], $args['the_post'] );
  242. }
  243. /**
  244. * Deprecated shortcode.
  245. *
  246. * @param array $atts Optional attributes.
  247. * @param string $content Unused shortcode content.
  248. * @param string $name Shortcode name.
  249. * @return string
  250. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  251. */
  252. function webcomic_count_shortcode( $atts, string $content, string $name ) : string {
  253. webcomic_error( __( '[webcomic_count] is deprecated; use [has_webcomic_media] instead.', 'webcomic' ) );
  254. $args = shortcode_atts(
  255. [
  256. 'if' => '',
  257. 'the_post' => null,
  258. ], $atts, $name
  259. );
  260. return has_webcomic_media_shortcode(
  261. [
  262. 'post' => $args['the_post'],
  263. 'count' => $args['if'],
  264. ], $content, $name
  265. );
  266. }
  267. /**
  268. * Deprecated shortcode.
  269. *
  270. * @param array $atts Optional attributes.
  271. * @param string $content Unused shortcode content.
  272. * @param string $name Shortcode name.
  273. * @return string
  274. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  275. */
  276. function verify_webcomic_age_shortcode( $atts, string $content, string $name ) : string {
  277. webcomic_error( __( '[verify_webcomic_age] is deprecated; use [webcomic_age_required] instead.', 'webcomic' ) );
  278. $args = shortcode_atts(
  279. [
  280. 'collection' => '',
  281. 'age' => 0,
  282. ], $atts, $name
  283. );
  284. if ( ! WebcomicTag::verify_webcomic_age_( $args['collection'], null, $args['age'] ) ) {
  285. return '';
  286. }
  287. return do_shortcode( $content );
  288. }
  289. /**
  290. * Deprecated shortcode.
  291. *
  292. * @param array $atts Optional attributes.
  293. * @param string $content Unused shortcode content.
  294. * @param string $name Shortcode name.
  295. * @return string
  296. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  297. */
  298. function verify_webcomic_role_shortcode( $atts, string $content, string $name ) : string {
  299. webcomic_error( __( '[verify_webcomic_role] is deprecated; use [webcomic_roles_required] instead.', 'webcomic' ) );
  300. $args = shortcode_atts(
  301. [
  302. 'collection' => '',
  303. 'roles' => [],
  304. ], $atts, $name
  305. );
  306. if ( ! is_array( $args['roles'] ) ) {
  307. parse_str( htmlspecialchars_decode( $args['roles'] ), $args['roles'] );
  308. }
  309. if ( ! WebcomicTag::verify_webcomic_role_( $args['collection'], null, array_keys( $args['roles'] ) ) ) {
  310. return '';
  311. }
  312. return do_shortcode( $content );
  313. }
  314. /**
  315. * Deprecated shortcode.
  316. *
  317. * @param array $atts Optional attributes.
  318. * @param string $content Unused shortcode content.
  319. * @param string $name Shortcode name.
  320. * @return string
  321. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  322. */
  323. function the_webcomic_terms_shortcode( $atts, string $content, string $name ) : string {
  324. // Translators: The shortcode name.
  325. webcomic_error( sprintf( __( '[%s] is deprecated; use [webcomic_terms_list] instead.', 'webcomic' ), $name ) );
  326. $args = shortcode_atts(
  327. [
  328. 'after' => '',
  329. 'before' => '',
  330. 'id' => 0,
  331. 'image' => '',
  332. 'sep' => ', ',
  333. 'target' => 'archive',
  334. 'taxonomy' => '',
  335. ], $atts, $name
  336. );
  337. preg_match( '/storyline|character/', $name, $match );
  338. if ( $match ) {
  339. $args['taxonomy'] = $match[0];
  340. }
  341. return WebcomicTag::get_the_webcomic_term_list_( $args['id'], $args['taxonomy'], $args['before'], $args['sep'], $args['after'], $args['target'], $args['image'] );
  342. }
  343. /**
  344. * Deprecated shortcode.
  345. *
  346. * @param array $atts Optional attributes.
  347. * @param string $content Unused shortcode content.
  348. * @param string $name Shortcode name.
  349. * @return string
  350. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  351. */
  352. function webcomic_term_crossovers_shortcode( $atts, string $content, string $name ) : string {
  353. // Translators: The shortcode name.
  354. webcomic_error( sprintf( __( '[%s] is deprecated; use [webcomic_terms_list] instead.', 'webcomic' ), $name ) );
  355. $args = shortcode_atts(
  356. [
  357. 'after' => '',
  358. 'before' => '',
  359. 'collection' => get_webcomic_collection(),
  360. 'image' => '',
  361. 'sep' => ', ',
  362. 'target' => 'archive',
  363. 'term' => 0,
  364. ], $atts, $name
  365. );
  366. preg_match( '/storyline|character/', $name, $match );
  367. if ( $match ) {
  368. $args['collection'] = "{$args['collection']}_{$match[0]}";
  369. }
  370. return WebcomicTag::webcomic_term_crossovers_( $args['term'], $args['collection'], $args['before'], $args['sep'], $args['after'], $args['target'], $args['image'] );
  371. }
  372. /**
  373. * Deprecated shortcode.
  374. *
  375. * @param array $atts Optional attributes.
  376. * @param string $content Unused shortcode content.
  377. * @param string $name Shortcode name.
  378. * @return string
  379. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  380. */
  381. function webcomic_term_media_shortcode( $atts, string $content, string $name ) : string {
  382. // Translators: The shortcode name.
  383. webcomic_error( sprintf( __( '[%s] is deprecated; use [webcomic_term_media] instead.', 'webcomic' ), $name ) );
  384. $args = shortcode_atts(
  385. [
  386. 'size' => 'full',
  387. 'term' => 0,
  388. 'collection' => get_webcomic_collection(),
  389. ], $atts, $name
  390. );
  391. preg_match( '/storyline|character/', $name, $match );
  392. if ( $match ) {
  393. $args['collection'] = "{$args['collection']}_{$match[0]}";
  394. }
  395. return WebcomicTag::webcomic_term_media_( $args['size'], $args['term'], $args['collection'] );
  396. }
  397. /**
  398. * Deprecated shortcode.
  399. *
  400. * @param array $atts Optional attributes.
  401. * @param string $content Unused shortcode content.
  402. * @param string $name Shortcode name.
  403. * @return string
  404. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  405. */
  406. function webcomic_term_cloud_shortcode( $atts, string $content, string $name ) : string {
  407. // Translators: The shortcode name.
  408. webcomic_error( sprintf( __( '[%s] is deprecated; use [webcomic_terms_list] instead.', 'webcomic' ), $name ) );
  409. $args = shortcode_atts(
  410. [
  411. 'after' => '',
  412. 'before' => '',
  413. 'callback' => '',
  414. 'class' => '',
  415. 'collection' => get_webcomic_collection(),
  416. 'id' => '',
  417. 'image' => '',
  418. 'largest' => 150,
  419. 'orderby' => 'rand',
  420. 'selected' => 0,
  421. 'sep' => ' ',
  422. 'show_count' => false,
  423. 'smallest' => 75,
  424. 'target' => 'archive',
  425. ], $atts, $name
  426. );
  427. preg_match( '/storyline|character/', $name, $match );
  428. if ( ! $match || ! taxonomy_exists( "{$args['collection']}_{$match[0]}" ) ) {
  429. return '';
  430. }
  431. $args['taxonomy'] = "{$args['collection']}_{$match[0]}";
  432. return WebcomicTag::webcomic_term_cloud_( $args );
  433. }
  434. /**
  435. * Deprecated shortcode.
  436. *
  437. * @param array $atts Optional attributes.
  438. * @param string $content Unused shortcode content.
  439. * @param string $name Shortcode name.
  440. * @return string
  441. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  442. */
  443. function webcomic_dropdown_terms_shortcode( $atts, string $content, string $name ) : string {
  444. // Translators: The shortcode name.
  445. webcomic_error( sprintf( __( '[%s] is deprecated; use [webcomic_terms_list] instead.', 'webcomic' ), $name ) );
  446. $args = shortcode_atts(
  447. [
  448. 'class' => '',
  449. 'collection' => get_webcomic_collection(),
  450. 'depth' => 0,
  451. 'hide_if_empty' => true,
  452. 'hierarchical' => true,
  453. 'id' => '',
  454. 'order_by' => 'term_group',
  455. 'select_name' => 'webcomic_terms',
  456. 'selected' => 0,
  457. 'show_count' => false,
  458. 'show_option_all' => '',
  459. 'show_option_none' => '',
  460. 'target' => 'archive',
  461. 'walker' => false,
  462. 'webcomics' => false,
  463. ], $atts, $name
  464. );
  465. preg_match( '/storyline|character/', $name, $match );
  466. if ( ! $match || ! taxonomy_exists( "{$args['collection']}_{$match[0]}" ) ) {
  467. return '';
  468. }
  469. $args['taxonomy'] = "{$args['collection']}_{$match[0]}";
  470. return WebcomicTag::webcomic_dropdown_terms_( $args );
  471. }
  472. /**
  473. * Deprecated shortcode.
  474. *
  475. * @param array $atts Optional attributes.
  476. * @param string $content Unused shortcode content.
  477. * @param string $name Shortcode name.
  478. * @return string
  479. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  480. */
  481. function webcomic_list_terms_shortcode( $atts, string $content, string $name ) : string {
  482. // Translators: The shortcode name.
  483. webcomic_error( sprintf( __( '[%s] is deprecated; use [webcomic_terms_list] instead.', 'webcomic' ), $name ) );
  484. $args = shortcode_atts(
  485. [
  486. 'after' => '',
  487. 'before' => '',
  488. 'class' => '',
  489. 'collection' => get_webcomic_collection(),
  490. 'depth' => 0,
  491. 'feed_type' => 'rss2',
  492. 'feed' => '',
  493. 'hierarchical' => true,
  494. 'id' => '',
  495. 'orderby' => '',
  496. 'ordered' => '',
  497. 'selected' => 0,
  498. 'sep' => '',
  499. 'show_count' => false,
  500. 'show_description' => false,
  501. 'show_image' => '',
  502. 'target' => 'archive',
  503. 'walker' => false,
  504. 'webcomic_image' => '',
  505. 'webcomics' => false,
  506. ], $atts, $name
  507. );
  508. preg_match( '/storyline|character/', $name, $match );
  509. if ( ! $match || ! taxonomy_exists( "{$args['collection']}_{$match[0]}" ) ) {
  510. return '';
  511. }
  512. $args['taxonomy'] = "{$args['collection']}_{$match[0]}";
  513. return WebcomicTag::webcomic_list_terms_( $args );
  514. }
  515. /**
  516. * Deprecated shortcode.
  517. *
  518. * @param array $atts Optional attributes.
  519. * @param string $content Unused shortcode content.
  520. * @param string $name Shortcode name.
  521. * @return string
  522. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  523. */
  524. function webcomic_crossover_description_shortcode( $atts, string $content, string $name ) : string {
  525. webcomic_error( __( '[webcomic_crossover_description] is deprecated; use [webcomic_collection_description] instead.', 'webcomic' ) );
  526. return WebcomicTag::webcomic_crossover_description_();
  527. }
  528. /**
  529. * Deprecated shortcode.
  530. *
  531. * @param array $atts Optional attributes.
  532. * @param string $content Unused shortcode content.
  533. * @param string $name Shortcode name.
  534. * @return string
  535. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  536. */
  537. function webcomic_crossover_poster_shortcode( $atts, string $content, string $name ) : string {
  538. webcomic_error( __( '[webcomic_crossover_poster] is deprecated; use [webcomic_collection_media] instead.', 'webcomic' ) );
  539. $args = shortcode_atts(
  540. [
  541. 'size' => 'full',
  542. ], $atts, $name
  543. );
  544. return WebcomicTag::webcomic_crossover_media_( $args['size'] );
  545. }
  546. /**
  547. * Deprecated shortcode.
  548. *
  549. * @param array $atts Optional attributes.
  550. * @param string $content Unused shortcode content.
  551. * @param string $name Shortcode name.
  552. * @return string
  553. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  554. */
  555. function webcomic_crossover_title_shortcode( $atts, string $content, string $name ) : string {
  556. webcomic_error( __( '[webcomic_crossover_title] is deprecated; use [webcomic_collection_title] instead.', 'webcomic' ) );
  557. $args = shortcode_atts(
  558. [
  559. 'prefix' => '',
  560. ], $atts, $name
  561. );
  562. return WebcomicTag::webcomic_crossover_title_( $args['prefix'] );
  563. }
  564. /**
  565. * Deprecated shortcode.
  566. *
  567. * @param array $atts Optional attributes.
  568. * @param string $content Unused shortcode content.
  569. * @param string $name Shortcode name.
  570. * @return string
  571. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  572. */
  573. function webcomic_collection_crossovers_shortcode( $atts, string $content, string $name ) {
  574. webcomic_error( __( '[webcomic_collection_crossovers] is deprecated; use [webcomic_collections_list] instead.', 'webcomic' ) );
  575. $args = shortcode_atts(
  576. [
  577. 'before' => '',
  578. 'sep' => ', ',
  579. 'after' => '',
  580. 'target' => 'archive',
  581. 'image' => '',
  582. 'collection' => '',
  583. ], $atts, $name
  584. );
  585. return WebcomicTag::webcomic_collection_crossovers_( $args['before'], $args['join'], $args['after'], $args['target'], $args['image'], $args['collection'] );
  586. }
  587. /**
  588. * Deprecated shortcode.
  589. *
  590. * @param array $atts Optional attributes.
  591. * @param string $content Unused shortcode content.
  592. * @param string $name Shortcode name.
  593. * @return string
  594. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  595. */
  596. function purchase_webcomic_link_shortcode( $atts, string $content, string $name ) {
  597. webcomic_error( __( '[purchase_webcomic_link] is deprecated; use [webcomic_link] instead.', 'webcomic' ) );
  598. $args = shortcode_atts(
  599. [
  600. 'format' => '%link',
  601. 'link' => '&curren;',
  602. 'the_post' => null,
  603. ], $atts, $name
  604. );
  605. return WebcomicTag::purchase_webcomic_link_( $args['format'], $args['link'], $args['the_post'] );
  606. }
  607. /**
  608. * Deprecated shortcode.
  609. *
  610. * @param array $atts Optional attributes.
  611. * @param string $content Unused shortcode content.
  612. * @param string $name Shortcode name.
  613. * @return string
  614. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  615. */
  616. function webcomic_collection_print_amount_shortcode( $atts, string $content, string $name ) {
  617. webcomic_error( __( '[webcomic_collection_print_amount] is deprecated; use [webcomic_collection_print_price] instead.', 'webcomic' ) );
  618. $args = shortcode_atts(
  619. [
  620. 'type' => '',
  621. 'dec' => '.',
  622. 'sep' => ',',
  623. 'collection' => '',
  624. ], $atts, $name
  625. );
  626. return WebcomicTag::webcomic_collection_print_amount_( $args['type'], $args['dec'], $args['sep'], $args['collection'] );
  627. }
  628. /**
  629. * Deprecated shortcode.
  630. *
  631. * @param array $atts Optional attributes.
  632. * @param string $content Unused shortcode content.
  633. * @param string $name Shortcode name.
  634. * @return string
  635. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  636. */
  637. function webcomic_donation_amount_shortcode( $atts, string $content, string $name ) {
  638. webcomic_error( __( '[webcomic_donation_amount] is deprecated; use [webcomic_collection_donation] instead.', 'webcomic' ) );
  639. $args = shortcode_atts(
  640. [
  641. 'dec' => '.',
  642. 'sep' => ',',
  643. 'collection' => '',
  644. ], $atts, $name
  645. );
  646. return WebcomicTag::webcomic_donation_amount_( $args['dec'], $args['sep'], $args['collection'] );
  647. }
  648. /**
  649. * Deprecated shortcode.
  650. *
  651. * @param array $atts Optional attributes.
  652. * @param string $content Unused shortcode content.
  653. * @param string $name Shortcode name.
  654. * @return string
  655. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  656. */
  657. function webcomic_donation_form_shortcode( $atts, string $content, string $name ) {
  658. webcomic_error( __( '[webcomic_donation_form] is deprecated; use [webcomic_link] instead.', 'webcomic' ) );
  659. $args = shortcode_atts(
  660. [
  661. 'dec' => '.',
  662. 'sep' => ',',
  663. 'collection' => '',
  664. ], $atts, $name
  665. );
  666. return WebcomicTag::webcomic_donation_amount_( $args['dec'], $args['sep'], $args['collection'] );
  667. }
  668. /**
  669. * Deprecated shortcode.
  670. *
  671. * @param array $atts Optional attributes.
  672. * @param string $content Unused shortcode content.
  673. * @param string $name Shortcode name.
  674. * @return string
  675. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  676. */
  677. function webcomic_print_amount_shortcode( $atts, string $content, string $name ) {
  678. webcomic_error( __( '[webcomic_print_amount] is deprecated; use [webcomic_print_price] instead.', 'webcomic' ) );
  679. $args = shortcode_atts(
  680. [
  681. 'type' => '',
  682. 'dec' => '.',
  683. 'sep' => ',',
  684. 'the_post' => null,
  685. ], $atts, $name
  686. );
  687. return WebcomicTag::webcomic_print_amount_( $args['type'], $args['dec'], $args['sep'], $args['the_post'] );
  688. }
  689. /**
  690. * Deprecated shortcode.
  691. *
  692. * @param array $atts Optional attributes.
  693. * @param string $content Unused shortcode content.
  694. * @param string $name Shortcode name.
  695. * @return string
  696. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  697. */
  698. function webcomic_print_adjustment_shortcode( $atts, string $content, string $name ) {
  699. webcomic_error( __( '[webcomic_print_adjustment] is deprecated; use [webcomic_print_adjust] instead.', 'webcomic' ) );
  700. $args = shortcode_atts(
  701. [
  702. 'type' => '',
  703. 'the_post' => null,
  704. ], $atts, $name
  705. );
  706. return WebcomicTag::webcomic_print_adjustment_( $args['type'], $args['the_post'] );
  707. }
  708. /**
  709. * Deprecated shortcode.
  710. *
  711. * @param array $atts Optional attributes.
  712. * @param string $content Unused shortcode content.
  713. * @param string $name Shortcode name.
  714. * @return string
  715. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  716. */
  717. function webcomic_print_form_shortcode( $atts, string $content, string $name ) {
  718. webcomic_error( __( '[webcomic_print_form] is deprecated; use [webcomic_link] instead.', 'webcomic' ) );
  719. $args = shortcode_atts(
  720. [
  721. 'type' => '',
  722. 'label' => '',
  723. 'the_post' => null,
  724. ], $atts, $name
  725. );
  726. return WebcomicTag::webcomic_print_form_( $args['type'], $args['label'], $args['the_post'] );
  727. }
  728. /**
  729. * Deprecated shortcode.
  730. *
  731. * @param array $atts Optional attributes.
  732. * @param string $content Unused shortcode content.
  733. * @param string $name Shortcode name.
  734. * @return string
  735. * @SuppressWarnings(PHPMD.StaticAccess) - Required for compatibility.
  736. */
  737. function webcomic_transcripts_link_shortcode( $atts, string $content, string $name ) {
  738. webcomic_error( __( '[webcomic_transcripts_link] is deprecated; use [webcomic_link] instead.', 'webcomic' ) );
  739. $args = shortcode_atts(
  740. [
  741. 'format' => '%link',
  742. 'none' => '',
  743. 'some' => '',
  744. 'off' => '',
  745. 'language' => false,
  746. 'the_post' => false,
  747. ], $atts, $name
  748. );
  749. return WebcomicTag::webcomic_transcripts_link_( $args['format'], $args['none'], $args['some'], $args['off'], $args['language'], $args['the_post'] );
  750. }