PluginProbe
Faust.js / 1.0.2
Faust.js v1.0.2
1.8.12 1.8.11 1.4.1 1.8.0 1.8.8 1.8.9 trunk 0.7.0 0.7.1 0.7.10 0.7.11 0.7.3 0.7.4 0.7.5 0.7.6 0.7.7 0.7.8 0.7.9 0.8.0 0.8.1 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 All 40 releases
← All changes | includes/replacement/callbacks.php +15 -3 0.7.91.0.2 View file →
@@ -113,14 +113,22 @@
113 113
114 114 if ( $frontend_uri ) {
115 115 $home_url = trailingslashit( get_home_url() );
116 116 $frontend_uri = trailingslashit( $frontend_uri );
117 +
118 + $link = str_replace( $home_url, $frontend_uri, $link );
119 +
120 + // Replace the schemes, if different.
121 + $frontend_uri_scheme = wp_parse_url( $frontend_uri, PHP_URL_SCHEME );
122 + $link_scheme = wp_parse_url( $link, PHP_URL_SCHEME );
123 + if ( $frontend_uri_scheme !== $link_scheme ) {
124 + $link = str_replace( $link_scheme . '://', $frontend_uri_scheme . '://', $link );
125 + }
126 +
117 127 /**
118 128 * This should already be handled by WPE\FaustWP\Replacement\post_link, but
119 129 * it's here for verbosity's sake and if the other filter changes for any reason.
120 130 */
121 - $link = str_replace( $home_url, $frontend_uri, $link );
122 -
123 131 $parsed_link_query = wp_parse_url( $link, PHP_URL_QUERY );
124 132 $args = wp_parse_args( $parsed_link_query );
125 133 $preview_id = isset( $args['preview_id'] ) ? $args['preview_id'] : $post->ID;
126 134
@@ -129,8 +137,12 @@
129 137 array_keys( $args ),
130 138 $link
131 139 );
132 140
141 + if ( ! isset( $args['previewPathname'] ) ) {
142 + $args['previewPathname'] = rawurlencode( wp_make_link_relative( get_permalink( $post ) ) );
143 + }
144 +
133 145 // Add p=xx if it's missing, which is the case for published posts.
134 146 if ( ! isset( $args['p'] ) ) {
135 147 $args['p'] = $preview_id;
136 148 }
@@ -218,9 +230,9 @@
218 230 *
219 231 * XXX: Please remove this once this issue is resolved: https://github.com/WordPress/gutenberg/issues/13998
220 232 */
221 233 function enqueue_preview_scripts() {
222 - wp_enqueue_script( 'faustwp-gutenberg-filters', plugins_url( '/previewlinks.js', __FILE__ ), array(), '1.0.0', true );
234 + wp_enqueue_script( 'faustwp-gutenberg-filters', plugins_url( '/previewlinks.js', __FILE__ ), array( 'jquery' ), '1.0.0', true );
223 235 wp_localize_script( 'faustwp-gutenberg-filters', '_faustwp_preview_link', array( '_preview_link' => get_preview_post_link() ) );
224 236 }
225 237
226 238 add_filter( 'wp_sitemaps_posts_entry', __NAMESPACE__ . '\\sitemaps_posts_entry' );