Custom Metabox additional item

Your above code should be working as is. There is however one logical error at the end of your saving function – you make the saving of both fields dependent on whether $_POST[‘_url’] is set. I suppose that is not intentional. You likely want something along the lines of: if ( isset( $_POST[‘_url’] ) ) … Read more

How do you List all Sidebars in a Metabox

You can also use a function like this: <?php /* Other stuff */ function sidebarOptions(){ $sidebars = $GLOBALS[‘wp_registered_sidebars’]; $sidebar_options = array(); foreach ( $sidebars as $sidebar ){ $sidebar_options[] = array( ‘name’ => $sidebar[‘name’], ‘value’ => $sidebar[‘id’] ); } return $sidebar_options; } /* Other stuff */ /* * Trying to print the result to check if … Read more