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: latex.php
<?php /** * Module Name: Beautiful Math * Module Description: Add beautifully formatted math equations to your posts and pages using LaTeX. * Sort Order: 12 * First Introduced: 1.1 * Requires Connection: No * Auto Activate: No * Module Tags: Writing * Feature: Writing * Additional Search Queries: latex, math, equation, equations, formula, code * * @package automattic/jetpack */ if ( ! defined( 'ABSPATH' ) ) { exit( 0 ); } /** * LaTeX support. * * Backward compatibility requires support for both "[latex][/latex]", and * "$latex $" shortcodes. * * $latex e^{\i \pi} + 1 = 0$ -> [latex]e^{\i \pi} + 1 = 0[/latex] * $latex [a, b]$ -> [latex][a, b][/latex] */ /** * Markup LaTeX content. * * @param string $content Post or comment contents to markup. */ function latex_markup( $content ) { $textarr = wp_html_split( $content ); $regex = '% \$latex(?:=\s*|\s+) ((?: [^$]+ # Not a dollar | (?<=(?<!\\\\)\\\\)\$ # Dollar preceded by exactly one slash )+) (?<!\\\\)\$ # Dollar preceded by zero slashes %ix'; foreach ( $textarr as &$element ) { if ( '' === $element || '<' === $element[0] ) { continue; } if ( false === stripos( $element, '$latex' ) ) { continue; } $element = preg_replace_callback( $regex, 'latex_src', $element ); } return implode( '', $textarr ); } /** * Process LaTeX string to rendered image. * * @param array $matches Matched regex results. */ function latex_src( $matches ) { $latex = $matches[1]; $bg = latex_get_default_color( 'bg' ); $fg = latex_get_default_color( 'text', '000' ); $s = 0; $latex = latex_entity_decode( $latex ); if ( preg_match( '/.+(&fg=[0-9a-f]{6}).*/i', $latex, $fg_matches ) ) { $fg = substr( $fg_matches[1], 4 ); $latex = str_replace( $fg_matches[1], '', $latex ); } if ( preg_match( '/.+(&bg=[0-9a-f]{6}).*/i', $latex, $bg_matches ) ) { $bg = substr( $bg_matches[1], 4 ); $latex = str_replace( $bg_matches[1], '', $latex ); } if ( preg_match( '/.+(&s=[0-9-]{1,2}).*/i', $latex, $s_matches ) ) { $s = (int) substr( $s_matches[1], 3 ); $latex = str_replace( $s_matches[1], '', $latex ); } return latex_render( $latex, $fg, $bg, $s ); } /** * Get the default color for an attribute. * * @param string $color Attribute to color (e.g. bg). * @param string $default_color Default fallback color to use. */ function latex_get_default_color( $color, $default_color = 'ffffff' ) { global $themecolors; return $themecolors[ $color ] ?? $default_color; } /** * Decode special characters in a LaTeX string. * * @param string $latex Character encoded content. */ function latex_entity_decode( $latex ) { return str_replace( array( '<', '>', '"', ''', '&', '&', "\n", "\r" ), array( '<', '>', '"', "'", '&', '&', ' ', ' ' ), $latex ); } /** * Returns the URL for the server-side rendered image of LaTeX. * * @param string $latex LaTeX string. * @param string $fg Foreground color. * @param string $bg Background color. * @param int $s Matches. * * @return string Image URL for the rendered LaTeX. */ function latex_render( $latex, $fg, $bg, $s = 0 ) { $url = add_query_arg( urlencode_deep( array( 'latex' => $latex, 'bg' => $bg, 'fg' => $fg, 's' => $s, 'c' => '20201002', // cache buster. Added 2020-10-02 after server migration caused faulty rendering. ) ), ( is_ssl() ? 'https://' : 'http://' ) . 's0.wp.com/latex.php' ); $alt = str_replace( '\\', '\', esc_attr( $latex ) ); return sprintf( '<img src="%1$s" alt="%2$s" class="latex" />', esc_url( $url ), $alt ); } /** * The shortcode way. The attributes are the same as the old ones - 'fg' and 'bg', instead of foreground * and background, and 's' is for the font size. * * Example: [latex s=4 bg=00f fg=ff0]\LaTeX[/latex] * * @param array $atts Shortcode attributes. * @param string $content Content to format. */ function latex_shortcode( $atts, $content = '' ) { $attr = shortcode_atts( array( 's' => 0, 'bg' => latex_get_default_color( 'bg' ), 'fg' => latex_get_default_color( 'text', '000' ), ), $atts, 'latex' ); return latex_render( latex_entity_decode( $content ), $attr['fg'], $attr['bg'], $attr['s'] ); } /** * LaTeX needs to be untexturized. * * @param array $shortcodes Array of shortcodes not to texturize. */ function latex_no_texturize( $shortcodes ) { $shortcodes[] = 'latex'; return $shortcodes; } add_filter( 'no_texturize_shortcodes', 'latex_no_texturize' ); add_filter( 'the_content', 'latex_markup', 9 ); // Before wptexturize. add_filter( 'comment_text', 'latex_markup', 9 ); // Before wptexturize. add_shortcode( 'latex', 'latex_shortcode' );
Save