Removing tags around tags

Greedy and Ungreedy modifier: preg_replace( ‘/<p>(.+)<\/p>/Uuis’, ‘$1’, $content ); Tested with this script: <?php $c = array(); $c[] = ‘<p>text</p>’; $c[] = ‘<p><div>text</div></p>’; $c[] = ‘<p><div><div>text</div></div></p>’; foreach ( $c as $content ) { $e = preg_replace( ‘/<p>(.+)<\/p>/Uuis’, ‘$1’, $content ); var_dump( $e ); } Also try remove_filter( ‘the_content’, ‘wpautop’ );

Save WYSIWYG editor plugin settings, only works after second save

I wish I was able to explain exactly WHY this works, but from the help of another wordpress.stackexcchange question I was able to find the solution. Adding tinyMCE.triggerSave(); directly after the .submit function forces the content to update. This was taken directly from another thread’s answer: “tinyMCE textarea is initially unseen by the used serialize … Read more

Can I disable `wp-tinymce.php` load as script?

Seems that the problem is with the virtual site config – the docroot in the fastcgi config. In my example I’m using nginx webserver and PHP7. It has to look like this: location / { try_files $uri $uri/ /index.php?q=$request_uri; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME … Read more

tiny_mce_before_init is not trigger

Looking at the contents of class-wp-editor.php, it looks like tiny_mce_before only triggers if you are not using the Teeny version of the editor: /* * For people who really REALLY know what they’re doing with TinyMCE * You can modify $mceInit to add, remove, change elements of the config * before tinyMCE.init. Setting “valid_elements”, “invalid_elements” … Read more

Tiny MCE doesn’t look anything like my blog

You can add an editor-style.css stylesheet in your theme which mimics the look-and-feel of your blog. Here are some tips on how to do that (you’ll need to touch functions.php too): http://www.deluxeblogtips.com/2010/05/editor-style-wordpress-30.html The first two styles in that example are the important ones; usually what I do is just copy over and rename my style.css … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)