Why WordPress not using WP_Filesystem

The real need for the WP_Filesystem is to be able to set the correct file owner/group permissions when writing new files. Reading or overwriting existing files does not change these permissions so the WP_Filesystem is not technically needed for that (though you can use it for that too.) The reason is it is a potential … Read more

Make a script work within a page

I think both external CSS & JavaScript files should be added to your active theme functions.php file into function which implements action wp_enqueue_scripts. It should looks like example code below: <?php // … function themename_enqueue_scripts() { // … wp_enqueue_style(‘themename-slider-style’, ‘//scd01.bcnshop.com/ca/widgets/generate-css/1815/4150.css’, false ); wp_enqueue_script(‘themename-slider-js’, ‘//scd01.bcnshop.com/ca/widgets/generate-js/1815/4150.js’, array(‘jquery’) ); // … } add_action( ‘wp_enqueue_scripts’, ‘themename_enqueue_scripts’ );

WordPress wraps span tags into p tags

I have investigated this problem and recognized that it is not the TinyMCE fault, but the issue is caused by the the hook function wpautop instead. And tags are wrapped just before post is being displayed. So in order to fix this issue just remove the hook function like that. remove_filter( ‘the_content’, ‘wpautop’ ); This … Read more

Prevent editor from adding script or form

By default, editors and admins in a single site installation have the unfiltered_html capability, which means they can insert any JavaScript and forms. If you want to disallow that, you can remove that capability from the editor role as described in Why is javascript allowed in my post content? or using a plugin like Members. … Read more

Add editor toolbar to Metabox

I need to add a custom toolbar (cf. image below) to this Metaboxes Do you want to add a custom TinyMCE toolbar to the TinyMCE/visual editor, or do you want to turn a textarea into a TinyMCE editor? If it is the latter one, here’s a sample code for turning the champ_home textarea into a … Read more

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