_report_server/commit/30f7226d9aa1b14561d48e5309f57e811e38322f">30f7226d9a first commit %!s(int64=2) %!d(string=před) roky sortablejs 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky source-map 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky source-map-js 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky string-width 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky strip-ansi 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky sucrase 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky supports-preserve-symlinks-flag 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky tailwind-color-palette 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky tailwindcss 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky thenify 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky thenify-all 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky to-regex-range 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky tr46 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky ts-interface-checker 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky uglify-js 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky underscore 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky upper-case 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky util-deprecate 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky valid-data-url 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky web-resource-inliner 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky webidl-conversions 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky whatwg-url 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky wrap-ansi 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky wrappy 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky y18n 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky yallist 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky yaml 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky yargs 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky yargs-parser 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky .yarn-integrity 30f7226d9a first commit %!s(int64=2) %!d(string=před) roky tum/whitesports - Gogs: Simplico Git Service

Bez popisu

pinterest.php 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * Pinterest embeds
  4. *
  5. * Based on "Board Widget" example here: http://business.pinterest.com/widget-builder/#code
  6. *
  7. * Example URL: https://pinterest.com/pin/129056345550241149/
  8. * Second Example URL: https://uk.pinterest.com/annsawesomepins/travel/
  9. *
  10. * @package automattic/jetpack
  11. */
  12. wp_embed_register_handler(
  13. 'pinterest',
  14. '#'
  15. . 'https?://'
  16. . '(?:www\.)?'
  17. . '(?:[a-z]{2}\.)?'
  18. . 'pinterest\.[a-z.]+/'
  19. . '([^/]+)'
  20. . '(/[^/]+)?'
  21. . '#',
  22. 'pinterest_embed_handler'
  23. );
  24. /**
  25. * Callback to modify output of embedded Pinterest posts.
  26. *
  27. * @param array $matches Regex partial matches against the URL passed.
  28. * @param array $attr Attributes received in embed response.
  29. * @param array $url Requested URL to be embedded.
  30. */
  31. function pinterest_embed_handler( $matches, $attr, $url ) {
  32. // Pinterest's JS handles making the embed.
  33. $script_src = '//assets.pinterest.com/js/pinit.js';
  34. wp_enqueue_script( 'pinterest-embed', $script_src, array(), JETPACK__VERSION, true );
  35. $path = wp_parse_url( $url, PHP_URL_PATH );
  36. if ( 0 === strpos( $path, '/pin/' ) ) {
  37. $embed_type = 'embedPin';
  38. } elseif ( preg_match( '#^/([^/]+)/?$#', $path ) ) {
  39. $embed_type = 'embedUser';
  40. } elseif ( preg_match( '#^/([^/]+)/([^/]+)/?$#', $path ) ) {
  41. $embed_type = 'embedBoard';
  42. } else {
  43. if ( current_user_can( 'edit_posts' ) ) {
  44. return __( 'Sorry, that Pinterest URL was not recognized.', 'jetpack' );
  45. }
  46. return;
  47. }
  48. $return = sprintf( '<a data-pin-do="%s" href="%s"></a>', esc_attr( $embed_type ), esc_url( $url ) );
  49. // If we're generating an embed view for the WordPress Admin via ajax.
  50. if ( doing_action( 'wp_ajax_parse-embed' ) ) {
  51. $return .= sprintf(
  52. '<script src="%s"></script>', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
  53. esc_url( $script_src )
  54. );
  55. }
  56. return $return;
  57. }