X7ROOT File Manager
Current Path:
/home/notabjze/digitalcontentmentors.com/wp-content/plugins/jetpack/modules
home
/
notabjze
/
digitalcontentmentors.com
/
wp-content
/
plugins
/
jetpack
/
modules
/
ðŸ“
..
📄
account-protection.php
(413 B)
📄
blaze.php
(986 B)
📄
blocks.php
(1.75 KB)
ðŸ“
carousel
📄
carousel.php
(573 B)
ðŸ“
comment-likes
📄
comment-likes.php
(7.89 KB)
ðŸ“
comments
📄
comments.php
(1.06 KB)
📄
contact-form.php
(794 B)
📄
copy-post.php
(13.09 KB)
📄
custom-content-types.php
(3.96 KB)
ðŸ“
custom-post-types
ðŸ“
external-media
ðŸ“
google-fonts
📄
google-fonts.php
(533 B)
ðŸ“
gravatar
📄
gravatar-hovercards.php
(11.84 KB)
ðŸ“
infinite-scroll
📄
infinite-scroll.php
(8.19 KB)
📄
json-api.php
(484 B)
📄
latex.php
(4.61 KB)
ðŸ“
likes
📄
likes.php
(19.89 KB)
ðŸ“
markdown
📄
markdown.php
(1007 B)
ðŸ“
memberships
📄
module-extras.php
(2.66 KB)
📄
module-headings.php
(43.24 KB)
📄
module-info.php
(26.71 KB)
📄
monitor.php
(3.51 KB)
📄
notes.php
(7.67 KB)
ðŸ“
photon-cdn
📄
photon-cdn.php
(12.25 KB)
📄
photon.php
(711 B)
ðŸ“
plugin-search
📄
plugin-search.php
(21.61 KB)
ðŸ“
post-by-email
📄
post-by-email.php
(596 B)
📄
post-list.php
(533 B)
📄
protect.php
(657 B)
📄
publicize.php
(3.73 KB)
ðŸ“
related-posts
📄
related-posts.php
(2.14 KB)
ðŸ“
scan
📄
search.php
(1.17 KB)
ðŸ“
seo-tools
📄
seo-tools.php
(1.52 KB)
ðŸ“
sharedaddy
📄
sharedaddy.php
(1.59 KB)
ðŸ“
shortcodes
📄
shortcodes.php
(6.36 KB)
📄
shortlinks.php
(4.39 KB)
ðŸ“
simple-payments
ðŸ“
site-icon
ðŸ“
sitemaps
📄
sitemaps.php
(1.28 KB)
📄
sso.php
(684 B)
ðŸ“
stats
📄
stats.php
(43.07 KB)
ðŸ“
subscriptions
📄
subscriptions.php
(32.94 KB)
ðŸ“
theme-tools
📄
theme-tools.php
(2.42 KB)
ðŸ“
tiled-gallery
📄
tiled-gallery.php
(1.05 KB)
📄
vaultpress.php
(1.77 KB)
ðŸ“
verification-tools
📄
verification-tools.php
(830 B)
ðŸ“
videopress
📄
videopress.php
(1007 B)
📄
waf.php
(298 B)
ðŸ“
widget-visibility
📄
widget-visibility.php
(475 B)
ðŸ“
widgets
📄
widgets.php
(2.72 KB)
ðŸ“
woocommerce-analytics
📄
woocommerce-analytics.php
(861 B)
ðŸ“
wordads
📄
wordads.php
(586 B)
ðŸ“
wpcom-tos
📄
wpgroho.js
(1.93 KB)
Editing: shortlinks.php
<?php /** * Module Name: WP.me Shortlinks * Module Description: Generates shorter links using the wp.me domain. * 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 */ 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 = floor( $num / pow( 62, $t ) ); $out = $out . substr( $index, $a, 1 ); $num = $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' );
Upload File
Create Folder