@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function render() { |
53 | 53 | |
54 | 54 | $metabox = $this; |
55 | - include dirname( __DIR__ ) . '/templates/custom-sidebar-details.php'; |
|
55 | + include dirname( __DIR__ ).'/templates/custom-sidebar-details.php'; |
|
56 | 56 | |
57 | 57 | } |
58 | 58 | |
@@ -61,20 +61,20 @@ discard block |
||
61 | 61 | global $wp_registered_sidebars; |
62 | 62 | |
63 | 63 | foreach ( $wp_registered_sidebars as $key => $sidebar ) { |
64 | - printf( '<option value="%1$s"%3$s>%2$s</option>', $key, $sidebar['name'], selected( Custom_Sidebars::get_sidebar(), $key ) ); |
|
64 | + printf( '<option value="%1$s"%3$s>%2$s</option>', $key, $sidebar[ 'name' ], selected( Custom_Sidebars::get_sidebar(), $key ) ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | } |
68 | 68 | |
69 | 69 | public function save_post( $post_id ) { |
70 | 70 | |
71 | - $sidebar_id = $_POST['custom-sidebar-select']; |
|
71 | + $sidebar_id = $_POST[ 'custom-sidebar-select' ]; |
|
72 | 72 | |
73 | - if ( isset( $_POST['custom-sidebar'] ) ) { |
|
73 | + if ( isset( $_POST[ 'custom-sidebar' ] ) ) { |
|
74 | 74 | $sidebar_id = Custom_Sidebars::get_sidebar_id( $post_id ); |
75 | 75 | } |
76 | 76 | |
77 | - update_post_meta( $post_id, '_custom_sidebar', ( bool )$_POST['custom-sidebar'] ); |
|
77 | + update_post_meta( $post_id, '_custom_sidebar', ( bool ) $_POST[ 'custom-sidebar' ] ); |
|
78 | 78 | update_post_meta( $post_id, '_custom_sidebar_id', sanitize_text_field( $sidebar_id ) ); |
79 | 79 | |
80 | 80 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | <label for="custom-sidebar-select"><?php _e( 'Use the following sidebar for this page:', 'custom-sidebars' ); ?></label> |
27 | 27 | <select name="custom-sidebar-select"> |
28 | 28 | <option value=""><?php _e( 'Default Sidebar', 'custom-sidebars' ); ?></option> |
29 | - <option value="none" <?php selected( Custom_Sidebars::get_sidebar(), 'none'); ?>><?php /* translators: as in 'No sidebar' */ _e( 'None', 'custom-sidebars' ); ?></option> |
|
29 | + <option value="none" <?php selected( Custom_Sidebars::get_sidebar(), 'none' ); ?>><?php /* translators: as in 'No sidebar' */ _e( 'None', 'custom-sidebars' ); ?></option> |
|
30 | 30 | <?php $metabox->sidebar_select_options(); ?> |
31 | 31 | </select> |
32 | 32 |