Skip to content

Commit

Permalink
cleaned code
Browse files Browse the repository at this point in the history
  • Loading branch information
benjick committed Mar 18, 2013
1 parent c1b48ba commit 9b57e80
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions includes/meta/sidebar_metabox.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

// Hook into WordPress
add_action( 'admin_init', 'add_custom_metabox' );
add_action( 'admin_init', 'sidebar_metabox' );
add_action( 'save_post', 'save_custom_url' );

/**
* Add meta box
*/
function add_custom_metabox() {
function sidebar_metabox() {
$types = array( 'post', 'page' ); // you can add more post_types here
foreach( $types as $type ) {
add_meta_box( 'custom-metabox', __( 'Sidebar' ), 'url_custom_metabox', $type, 'side', 'high' );
Expand Down Expand Up @@ -43,14 +43,4 @@ function save_custom_url( $post_id ) {
update_post_meta( $post->ID, 'disableSidebar', $_POST['sidebar'] );
}
}

/**
* Get and return the values for the URL and description
*/
function get_url_desc_box() {
global $post;
$sidebar = get_post_meta( $post->ID, 'disableSidebar', true );

return array( $urllink, $urldesc );
}
?>

0 comments on commit 9b57e80

Please sign in to comment.