Welcome to the MMOLEARN.COM

Build your first Dropshipping, Online Course, Affiliate, Blog, Business, Optin, etc, WEBSITE and make money with us. We offer over 10.000+ Wordpress Plugins & Themes which will let you build ANYTHING. Plus we have nice community which likes to gossip about building websites and making some money online! Its really easy to do when we have everything you need to BUILD anything you WANT. Hope you enjoy your stay and have a beautiful day with us!

or Register

Web-D There is an urgent problem with WordPress that needs immediate attention!

Stringer

Well-known member

Reputation: 30%
Joined
May 11, 2020
Messages
200
Reaction score
39
Points
56
URGENT ISSUE!!!

I have removed the Jetpack WordPress plugin from my website and as a result, every Pinterest embed on my site is now broken and only displaying the plain URL. Is there a solution available to automatically convert these URLs into the WordPress Gutenberg Pinterest block? This issue is causing a lot of trouble and frustration for me. Can anyone please assist me with this as soon as possible?

Thank you in advance for your help!
 

Chonessah

Well-known member

Reputation: 30%
Joined
May 5, 2019
Messages
215
Reaction score
31
Points
56
Apologies for stating the obvious, but have you considered reactivating Jetpack? It is possible that the issue lies in Jetpack's embedding of its own code around the URL, which might not be compatible with other plugins and Gutenberg. Creating a simple custom plugin could potentially serve as a solution to address this problem.
 

ClownFly

Member

Reputation: 8%
Joined
Dec 25, 2022
Messages
67
Reaction score
9
Points
8
Apologies for stating the obvious, but have you considered reactivating Jetpack? It is possible that the issue lies in Jetpack's embedding of its own code around the URL, which might not be compatible with other plugins and Gutenberg. Creating a simple custom plugin could potentially serve as a solution to address this problem.
Understood. If activating Jetpack is not an ideal solution due to the negative impact it has on your website's performance, it's understandable that you would prefer to avoid it. In that case, you're looking for a way to make mass changes to the code instead of manually modifying each instance personly.
 

CooledCrayon

Well-known member

Reputation: 31%
Joined
Jun 17, 2019
Messages
222
Reaction score
26
Points
61
Before proceeding, it is highly recommended to create a backup of your website to ensure its safety. The proposed solution involves using a plugin. You can create a PHP file and place it in your plugin folder for implementation.

Code:
<?php
/**
 * Plugin Name: Pinterest Block Conversion for Jetpack
 * Description: Converts Jetpack Pinterest blocks to Gutenberg blocks.
 * Version: 1.0
 * Author: tearzkiller
 * Author URI: https://doesntexist.com
 */

function pinterest_block_conversion_jetpack_register_block() {
  if ( function_exists( 'register_block_type' ) ) {
    // Register the block type
    register_block_type( 'pinterest-block-conversion-jetpack/converted-block', array(
      'render_callback' => 'pinterest_block_conversion_jetpack_render_block',
    ) );
  }
}
add_action( 'init', 'pinterest_block_conversion_jetpack_register_block' );

function pinterest_block_conversion_jetpack_render_block( $attributes ) {
  $output = '';

  // Get the Pinterest URL and board ID from the block attributes
  $pinterest_url = isset( $attributes['pinterestUrl'] ) ? $attributes['pinterestUrl'] : '';
  $board_id = isset( $attributes['boardId'] ) ? $attributes['boardId'] : '';

  // Use the Pinterest URL and board ID to generate the Pinterest block HTML
  $output .= '<a data-pin-do="embedBoard" data-pin-board-width="400" data-pin-scale-height="240" data-pin-scale-width="80" href="' . esc_url( $pinterest_url ) . '"></a>';

  return $output;
}
 

Discoverol

Well-known member

Reputation: 39%
Joined
Dec 29, 2020
Messages
275
Reaction score
44
Points
69
Before proceeding, it is highly recommended to create a backup of your website to ensure its safety. The proposed solution involves using a plugin. You can create a PHP file and place it in your plugin folder for implementation.

Code:
<?php
/**
 * Plugin Name: Pinterest Block Conversion for Jetpack
 * Description: Converts Jetpack Pinterest blocks to Gutenberg blocks.
 * Version: 1.0
 * Author: tearzkiller
 * Author URI: https://doesntexist.com
 */

function pinterest_block_conversion_jetpack_register_block() {
  if ( function_exists( 'register_block_type' ) ) {
    // Register the block type
    register_block_type( 'pinterest-block-conversion-jetpack/converted-block', array(
      'render_callback' => 'pinterest_block_conversion_jetpack_render_block',
    ) );
  }
}
add_action( 'init', 'pinterest_block_conversion_jetpack_register_block' );

function pinterest_block_conversion_jetpack_render_block( $attributes ) {
  $output = '';

  // Get the Pinterest URL and board ID from the block attributes
  $pinterest_url = isset( $attributes['pinterestUrl'] ) ? $attributes['pinterestUrl'] : '';
  $board_id = isset( $attributes['boardId'] ) ? $attributes['boardId'] : '';

  // Use the Pinterest URL and board ID to generate the Pinterest block HTML
  $output .= '<a data-pin-do="embedBoard" data-pin-board-width="400" data-pin-scale-height="240" data-pin-scale-width="80" href="' . esc_url( $pinterest_url ) . '"></a>';

  return $output;
}

I understand that technical expertise might not be your strong suit. Regarding your question, the solution being discussed aims to automate the conversion process of Pinterest embeds from the Jetpack code format to the Gutenberg Pinterest embed block format. By implementing the suggested approach, you can expect the conversion to occur automatically. I'm here to assist you, and I appreciate your appreciation!
 

Editorksta

Well-known member

Reputation: 29%
Joined
Jul 6, 2019
Messages
205
Reaction score
32
Points
56
I understand that technical expertise might not be your strong suit. Regarding your question, the solution being discussed aims to automate the conversion process of Pinterest embeds from the Jetpack code format to the Gutenberg Pinterest embed block format. By implementing the suggested approach, you can expect the conversion to occur automatically. I'm here to assist you, and I appreciate your appreciation!
I completely understand your concern, and you're right that running code from an unfamiliar source can pose risks. It's always advisable to prioritize safety, and manually making the changes would be the safest approach.

Regarding caching plugins, they can indeed be helpful in improving website performance. If you're currently using a caching plugin, it may be worth considering keeping Jetpack activated alongside it. This combination could potentially mitigate the performance issues associated with Jetpack and allow you to leverage its features while still benefiting from the caching plugin's optimizations.
 

Excunian

Well-known member

Reputation: 30%
Joined
May 13, 2017
Messages
200
Reaction score
53
Points
46
It's possible that certain plugins may be conflicting with each other, which could be causing the issue. In such cases, you can attempt to resolve the problem by reactivating Jetpack. This may help to resolve any conflicts and restore normal functionality.
 
Top Bottom