PluginProbe ʕ •ᴥ•ʔ
Page Builder by SiteOrigin / 2.26.0
Page Builder by SiteOrigin v2.26.0
2.34.3 2.34.2 2.29.5 2.29.6 2.29.7 2.29.8 2.29.9 2.3 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.31.2 2.31.3 2.31.4 2.31.5 2.31.6 2.31.7 2.31.8 2.32.0 2.32.1 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.34.0 2.34.1 2.4 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 2.4.22 2.4.23 2.4.24 2.4.25 2.4.3 2.4.4 2.4.5 2.4.6 2.4.8 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0 2.8.1 2.8.2 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 trunk 2.10.0 2.10.1 2.10.10 2.10.11 2.10.12 2.10.13 2.10.14 2.10.15 2.10.16 2.10.17 2.10.2 2.10.3 2.10.4 2.10.5 2.10.6 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.12.0 2.12.1 2.12.2 2.12.3 2.12.4 2.12.5 2.12.6 2.13.0 2.13.1 2.13.2 2.14.0 2.14.1 2.14.2 2.14.3 2.15.0 2.15.1 2.15.2 2.15.3 2.16.0 2.16.1 2.16.10 2.16.11 2.16.12 2.16.13 2.16.14 2.16.15 2.16.16 2.16.17 2.16.18 2.16.19 2.16.2 2.16.3 2.16.4 2.16.5 2.16.6 2.16.7 2.16.8 2.16.9 2.17.0 2.18.0 2.18.1 2.18.2 2.18.3 2.18.4 2.19.0 2.20.0 2.20.1 2.20.2 2.20.3 2.20.4 2.20.5 2.20.6 2.21.0 2.21.1 2.22.0 2.22.1 2.23.0 2.24.0 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.26.1 2.26.2 2.27.0 2.27.1 2.28.0 2.29.0 2.29.1 2.29.10 2.29.11 2.29.12 2.29.13 2.29.14 2.29.15 2.29.16 2.29.17 2.29.18 2.29.19 2.29.2 2.29.20 2.29.21 2.29.22 2.29.3 2.29.4
siteorigin-panels / compat / yoast.php
siteorigin-panels / compat Last commit date
js 3 years ago acf-widgets.php 2 years ago amp.php 5 years ago gravity-forms.php 3 years ago jetpack.php 3 years ago layout-block.php 2 years ago lazy-load-backgrounds.php 3 years ago polylang.php 3 years ago rank-math.php 3 years ago widget-options.php 3 years ago yoast.php 3 years ago
yoast.php
90 lines
1 <?php
2
3 if (
4 class_exists( 'WPSEO_Options' ) &&
5 method_exists( 'WPSEO_Options', 'get' ) &&
6 WPSEO_Options::get( 'opengraph' )
7 ) {
8 /**
9 * If Yoast OpenGraph is enabled, we'll need disable PB when it gets the excerpt
10 * to avoid conflicts with other plugins.
11 */
12 function siteorigin_yoast_opengraph_panels_disable( $content ) {
13 global $wp_current_filter;
14
15 if ( count( $wp_current_filter ) > 2 && $wp_current_filter[1] == 'wpseo_head' ) {
16 // Temporarily disable Page Builder for this instance of the_content.
17 add_filter( 'siteorigin_panels_filter_content_enabled', '__return_false' );
18 } else {
19 add_filter( 'siteorigin_panels_filter_content_enabled', '__return_true' );
20 }
21
22 return $content;
23 }
24
25 // If Yoast OpenGraph is enabled, disable Page Builder as needed.
26 add_filter( 'the_content', 'siteorigin_yoast_opengraph_panels_disable', 1 );
27 }
28
29 if ( defined( 'WPSEO_FILE' ) ) {
30 /**
31 * Returns a list of all images added using Page Builder to allow for their inclusion in the Yoast Sitemap.
32 *
33 * @param $images an array of all detected images used in the current post.
34 * @param $post_id the current post id.
35 *
36 * @return array
37 */
38 function siteorigin_yoast_sitemap_images_compat( $images, $post_id ) {
39 if (
40 get_post_meta( $post_id, 'panels_data', true ) &&
41 extension_loaded( 'xml' ) &&
42 class_exists( 'DOMDocument' )
43 ) {
44 $content = SiteOrigin_Panels::renderer()->render(
45 $post_id,
46 false
47 );
48
49 libxml_use_internal_errors( true );
50 $dom = new DOMDocument();
51 $dom->loadHTML( '<?xml encoding="UTF-8">' . $content );
52 libxml_clear_errors();
53
54 foreach ( $dom->getElementsByTagName( 'img' ) as $img ) {
55 $src = $img->getAttribute( 'src' );
56
57 if ( ! empty( $src ) && $src == esc_url( $src ) ) {
58 $images[] = array(
59 'src' => $src,
60 );
61 }
62 }
63 }
64
65 return $images;
66 }
67
68 add_filter( 'wpseo_sitemap_urlimages', 'siteorigin_yoast_sitemap_images_compat', 10, 2 );
69 }
70
71 if ( function_exists( 'yoast_wpseo_video_seo_init' ) ) {
72 /**
73 * If the Yoast SEO: Video plugin is trying to index a post, and the post has a page builder layout, render it using Page Builder.
74 *
75 * @param $content The content to analyze.
76 * @param $vid Array with video info, usually empty.
77 * @param $post Post object.
78 *
79 * @return string
80 */
81 function siteorigin_yoast_video_render_page_builder( $content, $vid, $post ) {
82 if ( ! empty( $_POST['panels_data'] ) ) {
83 $content = SiteOrigin_Panels::renderer()->render( $post->ID );
84 }
85
86 return $content;
87 }
88 add_filter( 'wpseo_video_index_content', 'siteorigin_yoast_video_render_page_builder', 10, 3 );
89 }
90