Dashboard like meta boxes in my plugin – how to save their position and open/closed state?

When ordering or closing metaboxes, those actions require nonces, add the following to your code and see if that resolves the problem. <?php wp_nonce_field(‘closedpostboxes’, ‘closedpostboxesnonce’, false ); ?> <?php wp_nonce_field(‘meta-box-order’, ‘meta-box-order-nonce’, false ); ?> Additional: You should add metaboxes to your page using add_meta_box and output them using do_meta_boxes passing in the hook for your … Read more

Hook the Keydown Event in the TinyMCE Post Editor

the TinyMCE Editor has its own keydown event handler and its hooked to a function on initiation so to do that you can create a tinymce plugin or use the wordpress initiation of it with tiny_mce_before_init hook like this: add_filter( ‘tiny_mce_before_init’, ‘wpse24113_tiny_mce_before_init’ ); function wpse24113_tiny_mce_before_init( $initArray ) { $initArray[‘setup’] = <<<JS [function(ed) { ed.onKeyDown.add(function(ed, e) … Read more

How do I print a notice only on certain admin pages?

There is a global variable called $pagenow for the use within WP Admin: global $pagenow; if ( $pagenow == ‘upload.php’ ) : function custom_admin_notice() { echo ‘<div class=”updated”><p>Updated!</p></div>’; } add_action( ‘admin_notices’, ‘custom_admin_notice’ ); endif; UPDATE: Simply include the snippet in your themes or plugins functions.php

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