golden hour
/home/doctorbruno/public_html/pgmed.org/wp-content/plugins/jetpack/modules
⬆️ Go Up
Upload
File/Folder
Size
Actions
account-protection.php
369 B
Del
OK
ai.php
1.08 KB
Del
OK
blaze.php
1.03 KB
Del
OK
blocks.php
1.82 KB
Del
OK
canonical-urls
-
Del
OK
canonical-urls.php
2.46 KB
Del
OK
carousel
-
Del
OK
carousel.php
612 B
Del
OK
comment-likes
-
Del
OK
comment-likes.php
8.42 KB
Del
OK
comments
-
Del
OK
comments.php
1.32 KB
Del
OK
contact-form.php
798 B
Del
OK
copy-post.php
15.45 KB
Del
OK
custom-content-types.php
4 KB
Del
OK
custom-post-types
-
Del
OK
external-media
-
Del
OK
google-fonts
-
Del
OK
google-fonts.php
643 B
Del
OK
gravatar
-
Del
OK
gravatar-hovercards.php
11.91 KB
Del
OK
infinite-scroll
-
Del
OK
infinite-scroll.php
8.25 KB
Del
OK
json-api.php
503 B
Del
OK
latex.php
4.63 KB
Del
OK
likes
-
Del
OK
likes.php
21.3 KB
Del
OK
markdown
-
Del
OK
markdown.php
1.04 KB
Del
OK
memberships
-
Del
OK
module-extras.php
2.83 KB
Del
OK
module-headings.php
46.5 KB
Del
OK
module-info.php
27.27 KB
Del
OK
monitor.php
3.7 KB
Del
OK
notes.php
7.47 KB
Del
OK
photon-cdn
-
Del
OK
photon-cdn.php
12.69 KB
Del
OK
photon.php
698 B
Del
OK
plugin-search
-
Del
OK
plugin-search.php
22.77 KB
Del
OK
podcast.php
866 B
Del
OK
post-by-email
-
Del
OK
post-by-email.php
676 B
Del
OK
post-list.php
570 B
Del
OK
protect.php
609 B
Del
OK
publicize.php
3.76 KB
Del
OK
related-posts
-
Del
OK
related-posts.php
2.42 KB
Del
OK
reprint-export.php
528 B
Del
OK
scan
-
Del
OK
search.php
1.18 KB
Del
OK
seo-tools
-
Del
OK
seo-tools.php
1.76 KB
Del
OK
sharedaddy
-
Del
OK
sharedaddy.php
1.06 KB
Del
OK
shortcodes
-
Del
OK
shortcodes.php
6.45 KB
Del
OK
shortlinks
-
Del
OK
shortlinks.php
4.58 KB
Del
OK
simple-payments
-
Del
OK
simple-payments.php
421 B
Del
OK
site-icon
-
Del
OK
sitemaps
-
Del
OK
sitemaps.php
1.3 KB
Del
OK
sso.php
681 B
Del
OK
stats
-
Del
OK
stats.php
43.68 KB
Del
OK
subscriptions
-
Del
OK
subscriptions.php
35.2 KB
Del
OK
theme-tools
-
Del
OK
theme-tools.php
2.47 KB
Del
OK
tiled-gallery
-
Del
OK
tiled-gallery.php
1.12 KB
Del
OK
vaultpress.php
1.8 KB
Del
OK
verification-tools
-
Del
OK
verification-tools.php
899 B
Del
OK
videopress
-
Del
OK
videopress.php
989 B
Del
OK
waf.php
309 B
Del
OK
widget-visibility
-
Del
OK
widget-visibility.php
558 B
Del
OK
widgets
-
Del
OK
widgets.php
2.8 KB
Del
OK
woocommerce-analytics
-
Del
OK
woocommerce-analytics.php
928 B
Del
OK
wordads
-
Del
OK
wordads.php
632 B
Del
OK
wpcom-reader.php
461 B
Del
OK
wpcom-tos
-
Del
OK
wpgroho.js
1.93 KB
Del
OK
Edit: shortlinks.php
<?php /** * Module Name: WP.me Shortlinks * Module Description: Share short, easy-to-remember links to your posts and pages. * Sort Order: 8 * First Introduced: 1.1 * Requires Connection: Yes * Auto Activate: No * Module Tags: Social * Feature: Writing * Additional Search Queries: shortlinks, wp.me * * @package automattic/jetpack */ if ( ! defined( 'ABSPATH' ) ) { exit( 0 ); } add_filter( 'pre_get_shortlink', 'wpme_get_shortlink_handler', 1, 4 ); if ( ! function_exists( 'wpme_dec2sixtwo' ) ) { /** * Converts number to base 62. * * @param int $num Number. * * @return string Value in base 62. */ function wpme_dec2sixtwo( $num ) { $index = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $out = ''; if ( $num < 0 ) { $out = '-'; $num = abs( $num ); } for ( $t = floor( log10( $num ) / log10( 62 ) ); $t >= 0; $t-- ) { $a = (int) floor( $num / pow( 62, $t ) ); $out .= substr( $index, $a, 1 ); $num -= $a * pow( 62, $t ); } return $out; } } /** * Returns the WP.me shortlink. * * @param int $id Post ID, or 0 for the current post. * @param string $context The context for the link. One of 'post' or 'query'. * @param bool $allow_slugs Whether to allow post slugs in the shortlink. * * @return string */ function wpme_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) { global $wp_query; $blog_id = Jetpack_Options::get_option( 'id' ); if ( 'query' === $context ) { if ( is_singular() ) { $id = $wp_query->get_queried_object_id(); $context = 'post'; } elseif ( is_front_page() ) { $context = 'blog'; } else { return ''; } } if ( 'blog' === $context ) { if ( empty( $id ) ) { $id = $blog_id; } return 'https://wp.me/' . wpme_dec2sixtwo( $id ); } $post = get_post( $id ); if ( empty( $post ) ) { return ''; } $post_id = $post->ID; $type = ''; if ( $allow_slugs && 'publish' === $post->post_status && 'post' === $post->post_type && strlen( $post->post_name ) <= 8 && ! str_contains( $post->post_name, '%' ) && ! str_contains( $post->post_name, '-' ) ) { $id = $post->post_name; $type = 's'; } else { $id = wpme_dec2sixtwo( $post_id ); if ( 'page' === $post->post_type ) { $type = 'P'; } elseif ( 'post' === $post->post_type || post_type_supports( $post->post_type, 'shortlinks' ) ) { $type = 'p'; } elseif ( 'attachment' === $post->post_type ) { $type = 'a'; } } if ( empty( $type ) ) { return ''; } return 'https://wp.me/' . $type . wpme_dec2sixtwo( $blog_id ) . '-' . $id; } /** * Get the shortlink handler. * * Used with the Core pre_get_shortlink hook. * * @param string $shortlink Shortlink value from the action. Ignored. * @param int $id Post ID (0 for the current post). * @param string $context The context for the link. One of 'post' or 'query'. * @param bool $allow_slugs Whether to allow post slugs in the shortlink. * * @return string */ function wpme_get_shortlink_handler( $shortlink, $id, $context, $allow_slugs ) { return wpme_get_shortlink( $id, $context, $allow_slugs ); } /** * Add Shortlinks to the REST API responses. * * @since 6.9.0 * * @action rest_api_init * @uses register_rest_field, wpme_rest_get_shortlink */ function wpme_rest_register_shortlinks() { // Post types that support shortlinks by default. $supported_post_types = array( 'attachment', 'page', 'post', ); // Add any CPT that may have declared support for shortlinks. foreach ( get_post_types() as $post_type ) { if ( post_type_supports( $post_type, 'shortlinks' ) && post_type_supports( $post_type, 'editor' ) ) { $supported_post_types[] = $post_type; } } register_rest_field( $supported_post_types, 'jetpack_shortlink', array( 'get_callback' => 'wpme_rest_get_shortlink', 'update_callback' => null, 'schema' => null, ) ); } /** * Get the shortlink of a post. * * @since 6.9.0 * * @param array $object Details of current post. * * @uses wpme_get_shortlink * * @return string */ function wpme_rest_get_shortlink( $object ) { $object_id = $object['id'] ?? 0; return wpme_get_shortlink( $object_id, array() ); } // Add shortlinks to the REST API Post response. add_action( 'rest_api_init', 'wpme_rest_register_shortlinks' ); /** * Set the Shortlink Gutenberg extension as available. */ function wpme_set_extension_available() { Jetpack_Gutenberg::set_extension_available( 'shortlinks' ); } add_action( 'init', 'wpme_set_extension_available' ); require_once __DIR__ . '/shortlinks/abilities/class-shortlinks-abilities.php'; \Automattic\Jetpack\Plugin\Abilities\Shortlinks_Abilities::init();
Save