Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp_editor() conflict when meta description field is set to default #277

Open
maurisrx opened this issue May 3, 2024 · 0 comments
Open

Comments

@maurisrx
Copy link

maurisrx commented May 3, 2024

Describe the bug
Having wp_editor() editor form on the front end when using default description meta causes admin bar icon not loading. It also cause conflict with some plugins.

To Reproduce
Steps to reproduce the behavior:

  1. Log in as an administrator.
  2. Activate only Rank Math plugin and deactivate other plugins.
  3. Activate storefront theme.
  4. To add wp_editor() instance on front end, add the following snippet to add tinymce editor to a frontend content. It can be added via code snippets plugin or active theme’s functions.php:
add_filter( 'the_content', function( $content ) {
  ob_start();
  
  $content   = '';
  $editor_id = 'test';
  $settings  = array(
    'media_buttons' => false,
    'textarea_rows' => 10,
     'required'      => 'required',
    'quicktags'     => false,
  );
  
  wp_editor( $content, $editor_id, $settings );
  
  return $content . ob_get_clean();
} );
  1. Visit any WP post on frontend.
  2. Check the icons on the WP admin toolbar and they will not load properly.
Screenshot 2024-05-03 at 10 56 14
  1. This also cause conflicts with other plugins that add wp_editor() instance on the frontend.
  2. Oddly if I set custom meta description field such as Test via menu Rank Math SEO > Titles & Meta > Post Types > Post instead of the default %excerpt%, it fixes the issue.

Expected behavior
The icons load normally.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome
  • Version 124.0.6367.93
@maurisrx maurisrx changed the title wp_editor() conflict wp_editor() conflict when meta description field is set to default May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant