custom metabox nonce verification fails

Ok, I found the answer. It’s a quite stupid copy/paste mistake. The name of my nonce_field was not unique. I had already created another nonce from the same plugin but another file. Therefore the basename(__FILE__) value was different leading to a different nonce. All I had to do was change the the name of the … Read more

jQuery UI Sortable not Working With Metabox

So, after an annoyingly long struggle, I discovered that I needed to have the script enqueued/registered with no dependencies. So in the end, to make it work, I needed this: function add_admin_scripts( $hook ) { global $post; wp_register_script( ‘sectioned_page_script’, get_stylesheet_directory_uri() . ‘/js/sectioned_page.js’ ); if ( $hook == ‘post-new.php’ || $hook == ‘post.php’ ) { if … Read more

Custom metabox fields not saving when limited to a certain CPT

SOLVED!! There was a separate check for CPT needed for the saving to work. So the conditional code now stands at: function set_options() { parent::set_options(); global $pagenow; if ( isset( $_GET[‘post_type’] ) && $_GET[‘post_type’] == ‘session’ && ‘post-new.php’ == $pagenow || isset( $_GET[‘post’] ) && ‘session’ == get_post_type( $_GET[‘post’] ) && ‘post.php’ == $pagenow || … Read more

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