diff --git a/book-review-library.php b/book-review-library.php index 253bb19..612cf34 100644 --- a/book-review-library.php +++ b/book-review-library.php @@ -10,7 +10,7 @@ * Plugin Name: Book Review Library * Plugin URI: http://museumthemes.com/book-review-library/ * Description: A book cataloguing and review system designed with bookophiles and librarians in mind. - * Version: 1.4.18 + * Version: 1.4.19 * Author: Chris Reynolds * Author URI: http://chrisreynolds.io * License: GPL3 diff --git a/class-book-reviews.php b/class-book-reviews.php index 86625bb..b79762c 100644 --- a/class-book-reviews.php +++ b/class-book-reviews.php @@ -99,7 +99,7 @@ public function setup_i18n() { * * @since 1.0.0 * - * @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog. + * @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog. */ public static function activate( $network_wide ) { $result = add_role( 'librarian', __( 'Librarian', 'book-review-library' ), array( @@ -123,7 +123,7 @@ public static function activate( $network_wide ) { 'delete_published_book-reviews' => true, 'read_book-reviews' => true, 'edit_others_book-reviews' => true, - 'delete_others_book-reviews' => true + 'delete_others_book-reviews' => true, ) ); $result = add_role( 'book-reviewer', __( 'Book Reviewer', 'book-review-library' ), array( @@ -143,46 +143,46 @@ public static function activate( $network_wide ) { 'edit_published_book-reviews' => true, 'delete_book-reviews' => true, 'delete_published_book-reviews' => true, - 'read_book-reviews' => true + 'read_book-reviews' => true, ) ); // add book-reviews caps to authors - if ( get_role('author') ) { + if ( get_role( 'author' ) ) { $role = get_role( 'author' ); - $role->add_cap('add_book-reviews'); - $role->add_cap('publish_book-reviews'); - $role->add_cap('edit_book-reviews'); - $role->add_cap('read_book-reviews'); - $role->add_cap('edit_published_book-reviews'); - $role->add_cap('delete_published_book-reviews'); - $role->add_cap('delete_book-reviews'); + $role->add_cap( 'add_book-reviews' ); + $role->add_cap( 'publish_book-reviews' ); + $role->add_cap( 'edit_book-reviews' ); + $role->add_cap( 'read_book-reviews' ); + $role->add_cap( 'edit_published_book-reviews' ); + $role->add_cap( 'delete_published_book-reviews' ); + $role->add_cap( 'delete_book-reviews' ); } // add book-reviews caps to editors - if ( get_role('editor') ) { + if ( get_role( 'editor' ) ) { $role = get_role( 'editor' ); - $role->add_cap('add_book-reviews'); - $role->add_cap('publish_book-reviews'); - $role->add_cap('edit_book-reviews'); - $role->add_cap('edit_others_book-reviews'); - $role->add_cap('read_book-reviews'); - $role->add_cap('edit_published_book-reviews'); - $role->add_cap('delete_published_book-reviews'); - $role->add_cap('delete_book-reviews'); + $role->add_cap( 'add_book-reviews' ); + $role->add_cap( 'publish_book-reviews' ); + $role->add_cap( 'edit_book-reviews' ); + $role->add_cap( 'edit_others_book-reviews' ); + $role->add_cap( 'read_book-reviews' ); + $role->add_cap( 'edit_published_book-reviews' ); + $role->add_cap( 'delete_published_book-reviews' ); + $role->add_cap( 'delete_book-reviews' ); } // add book-reviews caps to admins - if ( get_role('administrator') ) { + if ( get_role( 'administrator' ) ) { $role = get_role( 'administrator' ); - $role->add_cap('add_book-reviews'); - $role->add_cap('publish_book-reviews'); - $role->add_cap('edit_book-reviews'); - $role->add_cap('edit_others_book-reviews'); - $role->add_cap('read_book-reviews'); - $role->add_cap('edit_published_book-reviews'); - $role->add_cap('delete_published_book-reviews'); - $role->add_cap('delete_book-reviews'); - $role->add_cap('manage_book_review_options'); + $role->add_cap( 'add_book-reviews' ); + $role->add_cap( 'publish_book-reviews' ); + $role->add_cap( 'edit_book-reviews' ); + $role->add_cap( 'edit_others_book-reviews' ); + $role->add_cap( 'read_book-reviews' ); + $role->add_cap( 'edit_published_book-reviews' ); + $role->add_cap( 'delete_published_book-reviews' ); + $role->add_cap( 'delete_book-reviews' ); + $role->add_cap( 'manage_book_review_options' ); } } @@ -192,7 +192,7 @@ public static function activate( $network_wide ) { * * @since 1.0.0 * - * @param boolean $network_wide True if WPMU superadmin uses "Network Deactivate" action, false if WPMU is disabled or plugin is deactivated on an individual blog. + * @param boolean $network_wide True if WPMU superadmin uses "Network Deactivate" action, false if WPMU is disabled or plugin is deactivated on an individual blog. */ public static function deactivate( $network_wide ) { if ( get_role( 'librarian' ) ) { @@ -224,40 +224,40 @@ public static function deactivate( $network_wide ) { if ( get_role( 'author' ) ) { $role = get_role( 'author' ); - $role->remove_cap('add_agenda'); - $role->remove_cap('publish_book-reviews'); - $role->remove_cap('edit_book-reviews'); - $role->remove_cap('read_book-reviews'); - $role->remove_cap('edit_published_book-reviews'); - $role->remove_cap('delete_published_book-reviews'); - $role->remove_cap('delete_book-reviews'); + $role->remove_cap( 'add_agenda' ); + $role->remove_cap( 'publish_book-reviews' ); + $role->remove_cap( 'edit_book-reviews' ); + $role->remove_cap( 'read_book-reviews' ); + $role->remove_cap( 'edit_published_book-reviews' ); + $role->remove_cap( 'delete_published_book-reviews' ); + $role->remove_cap( 'delete_book-reviews' ); } if ( get_role( 'editor' ) ) { $role = get_role( 'editor' ); - $role->remove_cap('add_agenda'); - $role->remove_cap('add_book-reviews'); - $role->remove_cap('publish_book-reviews'); - $role->remove_cap('edit_book-reviews'); - $role->remove_cap('edit_others_book-reviews'); - $role->remove_cap('read_book-reviews'); - $role->remove_cap('edit_published_book-reviews'); - $role->remove_cap('delete_published_book-reviews'); - $role->remove_cap('delete_book-reviews'); + $role->remove_cap( 'add_agenda' ); + $role->remove_cap( 'add_book-reviews' ); + $role->remove_cap( 'publish_book-reviews' ); + $role->remove_cap( 'edit_book-reviews' ); + $role->remove_cap( 'edit_others_book-reviews' ); + $role->remove_cap( 'read_book-reviews' ); + $role->remove_cap( 'edit_published_book-reviews' ); + $role->remove_cap( 'delete_published_book-reviews' ); + $role->remove_cap( 'delete_book-reviews' ); } if ( get_role( 'administrator' ) ) { $role = get_role( 'administrator' ); - $role->remove_cap('add_agenda'); - $role->remove_cap('add_book-reviews'); - $role->remove_cap('publish_book-reviews'); - $role->remove_cap('edit_book-reviews'); - $role->remove_cap('edit_others_book-reviews'); - $role->remove_cap('read_book-reviews'); - $role->remove_cap('edit_published_book-reviews'); - $role->remove_cap('delete_published_book-reviews'); - $role->remove_cap('delete_book-reviews'); - $role->remove_cap('manage_book_review_options'); + $role->remove_cap( 'add_agenda' ); + $role->remove_cap( 'add_book-reviews' ); + $role->remove_cap( 'publish_book-reviews' ); + $role->remove_cap( 'edit_book-reviews' ); + $role->remove_cap( 'edit_others_book-reviews' ); + $role->remove_cap( 'read_book-reviews' ); + $role->remove_cap( 'edit_published_book-reviews' ); + $role->remove_cap( 'delete_published_book-reviews' ); + $role->remove_cap( 'delete_book-reviews' ); + $role->remove_cap( 'manage_book_review_options' ); } wp_delete_term( '0', 'rating' ); @@ -320,7 +320,7 @@ public function enqueue_admin_scripts() { */ public function enqueue_styles() { global $post; - if ( !is_admin() && ( 'book-review' == get_post_type() || ( is_page() && has_shortcode( $post->post_content, 'book-reviews' ) ) ) ) { + if ( ! is_admin() && ( 'book-review' == get_post_type() || ( is_page() && has_shortcode( $post->post_content, 'book-reviews' ) ) ) ) { wp_enqueue_style( $this->plugin_slug . '-genericons', plugins_url( 'genericons/genericons.css', __FILE__ ), array(), $this->version ); wp_enqueue_style( $this->plugin_slug . '-public', plugins_url( 'css/public.css', __FILE__ ), array(), $this->version ); } @@ -367,10 +367,10 @@ public function flush_rewrites() { * @since 1.0.0 */ public function register_post_type_book_review() { - include_once(BOOK_REVIEWS_FUNC); + include_once( BOOK_REVIEWS_FUNC ); $defaults = book_reviews_option_defaults(); $options = get_option( 'book_reviews_settings', $defaults ); - if ( isset($options['comments']) && $options['comments'] ) { + if ( isset( $options['comments'] ) && $options['comments'] ) { $supports = array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'comments' ); } else { $supports = array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions' ); @@ -383,21 +383,23 @@ public function register_post_type_book_review() { 'delete_posts' => 'delete_book-reviews', 'edit_post' => 'edit_book-review', 'delete_post' => 'delete_book-review', - 'read_post' => 'read_book-review' + 'read_post' => 'read_book-review', ); $labels = array( - 'name' => __( 'Book Reviews', 'book-review-library' ), - 'singular_name' => __( 'Book Review', 'book-review-library' ), - 'add_new' => __( 'Add New', 'book-review-library' ), - 'add_new_item' => __( 'Add New Book Review', 'book-review-library' ), - 'edit_item' => __( 'Edit Review', 'book-review-library' ), - 'new_item' => __( 'New Book Review', 'book-review-library' ), - 'view_item' => __( 'View Book Review', 'book-review-library' ), - 'search_items' => __( 'Search Book Reviews', 'book-review-library' ), - 'not_found' => __( 'No book reviews found', 'book-review-library' ), - 'not_found_in_trash' => __( 'No book reviews found in Trash', 'book-review-library' ), - 'menu_name' => __( 'Book Reviews', 'book-review-library' ),); - $args = array('labels' => $labels, + 'name' => __( 'Book Reviews', 'book-review-library' ), + 'singular_name' => __( 'Book Review', 'book-review-library' ), + 'add_new' => __( 'Add New', 'book-review-library' ), + 'add_new_item' => __( 'Add New Book Review', 'book-review-library' ), + 'edit_item' => __( 'Edit Review', 'book-review-library' ), + 'new_item' => __( 'New Book Review', 'book-review-library' ), + 'view_item' => __( 'View Book Review', 'book-review-library' ), + 'search_items' => __( 'Search Book Reviews', 'book-review-library' ), + 'not_found' => __( 'No book reviews found', 'book-review-library' ), + 'not_found_in_trash' => __( 'No book reviews found in Trash', 'book-review-library' ), + 'menu_name' => __( 'Book Reviews', 'book-review-library' ), + ); + $args = array( + 'labels' => $labels, 'hierarchical' => false, 'description' => 'Book Review', 'supports' => $supports, @@ -415,7 +417,7 @@ public function register_post_type_book_review() { 'rewrite' => true, 'capability_type' => 'book-review', 'capabilities' => $capabilities, - 'map_meta_cap' => true + 'map_meta_cap' => true, ); register_post_type( 'book-review', $args ); @@ -427,12 +429,12 @@ public function register_post_type_book_review() { * @since 1.0.0 */ public function register_taxonomy_genre() { - register_taxonomy('genre', array('book-review'), array( - 'label' => __('Genres', 'book-review-library'), + register_taxonomy('genre', array( 'book-review' ), array( + 'label' => __( 'Genres', 'book-review-library' ), 'labels' => array( 'name' => __( 'Genres', 'book-review-library' ), 'singular_name' => __( 'Genre', 'book-review-library' ), - 'search_items' => __( 'Search Genres', 'book-review-library' ), + 'search_items' => __( 'Search Genres', 'book-review-library' ), 'popular_items' => __( 'Popular Genres', 'book-review-library' ), 'all_items' => __( 'All Genres', 'book-review-library' ), 'parent_item' => null, @@ -464,7 +466,7 @@ public function register_taxonomy_genre() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -476,12 +478,12 @@ public function register_taxonomy_genre() { * @since 1.0.0 */ public function register_taxonomy_review_author() { - register_taxonomy('review-author', array('book-review'), array( - 'label' => __('Review Author', 'book-review-library'), + register_taxonomy('review-author', array( 'book-review' ), array( + 'label' => __( 'Review Author', 'book-review-library' ), 'labels' => array( 'name' => __( 'Review Author', 'book-review-library' ), 'singular_name' => __( 'Review Author', 'book-review-library' ), - 'search_items' => __( 'Search Review Authors', 'book-review-library' ), + 'search_items' => __( 'Search Review Authors', 'book-review-library' ), 'popular_items' => __( 'Popular Review Authors', 'book-review-library' ), 'all_items' => __( 'All Review Authors', 'book-review-library' ), 'parent_item' => null, @@ -512,7 +514,7 @@ public function register_taxonomy_review_author() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -524,12 +526,12 @@ public function register_taxonomy_review_author() { * @since 1.0.0 */ public function register_taxonomy_book_author() { - register_taxonomy('book-author', array('book-review'), array( - 'label' => __('Book Authors', 'book-review-library'), + register_taxonomy('book-author', array( 'book-review' ), array( + 'label' => __( 'Book Authors', 'book-review-library' ), 'labels' => array( 'name' => __( 'Book Authors', 'book-review-library' ), 'singular_name' => __( 'Author', 'book-review-library' ), - 'search_items' => __( 'Search Book Authors', 'book-review-library' ), + 'search_items' => __( 'Search Book Authors', 'book-review-library' ), 'popular_items' => __( 'Popular Book Authors', 'book-review-library' ), 'all_items' => __( 'All Book Authors', 'book-review-library' ), 'parent_item' => null, @@ -560,7 +562,7 @@ public function register_taxonomy_book_author() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -571,12 +573,12 @@ public function register_taxonomy_book_author() { * @since 1.0.0 */ public function register_taxonomy_reading_level() { - register_taxonomy('reading-level', array('book-review'), array( - 'label' => __('Reading Level', 'book-review-library'), + register_taxonomy('reading-level', array( 'book-review' ), array( + 'label' => __( 'Reading Level', 'book-review-library' ), 'labels' => array( 'name' => __( 'Reading Level', 'book-review-library' ), 'singular_name' => __( 'Reading Level', 'book-review-library' ), - 'search_items' => __( 'Search Reading Levels', 'book-review-library' ), + 'search_items' => __( 'Search Reading Levels', 'book-review-library' ), 'popular_items' => __( 'Popular Reading Levels', 'book-review-library' ), 'all_items' => __( 'All Reading Levels', 'book-review-library' ), 'parent_item' => null, @@ -607,7 +609,7 @@ public function register_taxonomy_reading_level() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -618,12 +620,12 @@ public function register_taxonomy_reading_level() { * @since 1.0.0 */ public function register_taxonomy_subject() { - register_taxonomy('subject', array('book-review'), array( - 'label' => __('Subjects', 'book-review-library'), + register_taxonomy('subject', array( 'book-review' ), array( + 'label' => __( 'Subjects', 'book-review-library' ), 'labels' => array( 'name' => __( 'Subjects', 'book-review-library' ), 'singular_name' => __( 'Subject', 'book-review-library' ), - 'search_items' => __( 'Search Subjects', 'book-review-library' ), + 'search_items' => __( 'Search Subjects', 'book-review-library' ), 'popular_items' => __( 'Popular Subjects', 'book-review-library' ), 'all_items' => __( 'All Subjects', 'book-review-library' ), 'parent_item' => null, @@ -654,7 +656,7 @@ public function register_taxonomy_subject() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -665,12 +667,12 @@ public function register_taxonomy_subject() { * @since 1.0.0 */ public function register_taxonomy_illustrator() { - register_taxonomy('illustrator', array('book-review'), array( - 'label' => __('Illustrators', 'book-review-library'), + register_taxonomy('illustrator', array( 'book-review' ), array( + 'label' => __( 'Illustrators', 'book-review-library' ), 'labels' => array( 'name' => __( 'Illustrators', 'book-review-library' ), 'singular_name' => __( 'Illustrator', 'book-review-library' ), - 'search_items' => __( 'Search Illustrators', 'book-review-library' ), + 'search_items' => __( 'Search Illustrators', 'book-review-library' ), 'popular_items' => __( 'Popular Illustrators', 'book-review-library' ), 'all_items' => __( 'All Illustrators', 'book-review-library' ), 'parent_item' => null, @@ -701,7 +703,7 @@ public function register_taxonomy_illustrator() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -712,12 +714,12 @@ public function register_taxonomy_illustrator() { * @since 1.0.0 */ public function register_taxonomy_awards() { - register_taxonomy('awards', array('book-review'), array( - 'label' => __('Awards', 'book-review-library'), + register_taxonomy('awards', array( 'book-review' ), array( + 'label' => __( 'Awards', 'book-review-library' ), 'labels' => array( 'name' => __( 'Awards', 'book-review-library' ), 'singular_name' => __( 'Award', 'book-review-library' ), - 'search_items' => __( 'Search Awards', 'book-review-library' ), + 'search_items' => __( 'Search Awards', 'book-review-library' ), 'popular_items' => __( 'Popular Awards', 'book-review-library' ), 'all_items' => __( 'All Awards', 'book-review-library' ), 'parent_item' => null, @@ -748,7 +750,7 @@ public function register_taxonomy_awards() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -759,12 +761,12 @@ public function register_taxonomy_awards() { * @since 1.0.0 */ public function register_taxonomy_series() { - register_taxonomy('series', array('book-review'), array( - 'label' => __('Series', 'book-review-library'), + register_taxonomy('series', array( 'book-review' ), array( + 'label' => __( 'Series', 'book-review-library' ), 'labels' => array( 'name' => __( 'Series', 'book-review-library' ), 'singular_name' => __( 'Series', 'book-review-library' ), - 'search_items' => __( 'Search Series', 'book-review-library' ), + 'search_items' => __( 'Search Series', 'book-review-library' ), 'popular_items' => __( 'Popular Series', 'book-review-library' ), 'all_items' => __( 'All Series', 'book-review-library' ), 'parent_item' => null, @@ -795,7 +797,7 @@ public function register_taxonomy_series() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -806,12 +808,12 @@ public function register_taxonomy_series() { * @since 1.0.0 */ public function register_taxonomy_rating() { - register_taxonomy('rating', array('book-review'), array( - 'label' => __('Star Ratings', 'book-review-library'), + register_taxonomy('rating', array( 'book-review' ), array( + 'label' => __( 'Star Ratings', 'book-review-library' ), 'labels' => array( 'name' => __( 'Star Ratings', 'book-review-library' ), 'singular_name' => __( 'Star', 'book-review-library' ), - 'search_items' => __( 'Search Ratings', 'book-review-library' ), + 'search_items' => __( 'Search Ratings', 'book-review-library' ), 'popular_items' => __( 'Popular Ratings', 'book-review-library' ), 'all_items' => __( 'Stars', 'book-review-library' ), 'parent_item' => null, @@ -842,7 +844,7 @@ public function register_taxonomy_rating() { 'edit_terms' => 'edit_book-reviews', 'delete_terms' => 'edit_others_book-reviews', 'manage_categories' => 'edit_book-reviews', - 'assign_terms' => 'edit_book-reviews' + 'assign_terms' => 'edit_book-reviews', ), )); } @@ -855,27 +857,27 @@ public function register_taxonomy_rating() { public function insert_star_ratings() { wp_insert_term( '0', 'rating', array( 'description' => __( 'Zero stars', 'book-review-library' ), - 'slug' => 'zero-stars' + 'slug' => 'zero-stars', ) ); wp_insert_term( '1', 'rating', array( 'description' => __( 'One star', 'book-review-library' ), - 'slug' => 'one-star' + 'slug' => 'one-star', ) ); wp_insert_term( '2', 'rating', array( 'description' => __( 'Two stars', 'book-review-library' ), - 'slug' => 'two-stars' + 'slug' => 'two-stars', ) ); wp_insert_term( '3', 'rating', array( 'description' => __( 'Three stars', 'book-review-library' ), - 'slug' => 'three-stars' + 'slug' => 'three-stars', ) ); wp_insert_term( '4', 'rating', array( 'description' => __( 'Four stars', 'book-review-library' ), - 'slug' => 'four-stars' + 'slug' => 'four-stars', ) ); wp_insert_term( '5', 'rating', array( 'description' => __( 'Five stars', 'book-review-library' ), - 'slug' => 'five-stars' + 'slug' => 'five-stars', ) ); } @@ -885,7 +887,7 @@ public function insert_star_ratings() { * @since 1.0.0 */ public function remove_rating_submenu() { - remove_submenu_page('edit.php?post_type=book-review','edit-tags.php?taxonomy=rating&post_type=book-review'); + remove_submenu_page( 'edit.php?post_type=book-review','edit-tags.php?taxonomy=rating&post_type=book-review' ); } /** @@ -901,7 +903,7 @@ public function move_meta_boxes() { return; } else { - include_once(BOOK_REVIEWS_FUNC); + include_once( BOOK_REVIEWS_FUNC ); $options = get_option( 'book_reviews_settings', book_reviews_option_defaults() ); @@ -910,28 +912,28 @@ public function move_meta_boxes() { unset( $wp_meta_boxes['book-review']['side']['core']['book-authordiv'] ); add_meta_box( 'book-authordiv', __( 'Book Author', 'book-review-library' ), 'post_categories_meta_box', 'book-review', 'normal', 'core', array( 'taxonomy' => 'book-author' ) ); - if ( isset($options['illustrator']) && ($options['illustrator'] == true) ) { + if ( isset( $options['illustrator'] ) && ($options['illustrator'] == true) ) { unset( $wp_meta_boxes['book-review']['side']['core']['illustratordiv'] ); add_meta_box( 'illustratordiv', __( 'Illustrator', 'book-review-library' ), 'post_categories_meta_box', 'book-review', 'normal', 'core', array( 'taxonomy' => 'illustrator' ) ); } - if ( isset($options['series']) && ($options['series'] == true) ) { + if ( isset( $options['series'] ) && ($options['series'] == true) ) { unset( $wp_meta_boxes['book-review']['side']['core']['seriesdiv'] ); add_meta_box( 'seriesdiv', __( 'Series', 'book-review-library' ), 'post_categories_meta_box', 'book-review', 'normal', 'core', array( 'taxonomy' => 'series' ) ); } - if ( isset($options['reading-level']) && ($options['reading-level'] == true) ) { + if ( isset( $options['reading-level'] ) && ($options['reading-level'] == true) ) { unset( $wp_meta_boxes['book-review']['side']['core']['tagsdiv-reading-level'] ); add_meta_box( 'tagsdiv-reading-level', __( 'Reading Level', 'book-review-library' ), 'post_tags_meta_box', 'book-review', 'normal', 'core', array( 'taxonomy' => 'reading-level' ) ); } - if ( isset($options['rating']) && ($options['rating'] == true) ) { + if ( isset( $options['rating'] ) && ($options['rating'] == true) ) { unset( $wp_meta_boxes['book-review']['side']['core']['ratingdiv'] ); add_meta_box( 'ratingdiv', __( 'Star Rating', 'book-review-library' ), 'post_categories_meta_box', 'book-review', 'normal', 'core', array( 'taxonomy' => 'rating' ) ); } remove_meta_box( 'postimagediv', 'book-review', 'side' ); - add_meta_box('postimagediv', __('Book Cover', 'book-review-library'), 'post_thumbnail_meta_box', 'book-review', 'side', 'default'); + add_meta_box( 'postimagediv', __( 'Book Cover', 'book-review-library' ), 'post_thumbnail_meta_box', 'book-review', 'side', 'default' ); } } @@ -941,7 +943,7 @@ public function move_meta_boxes() { * @since 1.0.0 */ public function book_reviews_meta_box() { - add_meta_box( 'book-reviews-meta', __('Additional Information', 'book-review-library'), array($this,'book_reviews_box'), 'book-review', 'normal', 'default' ); + add_meta_box( 'book-reviews-meta', __( 'Additional Information', 'book-review-library' ), array( $this, 'book_reviews_box' ), 'book-review', 'normal', 'default' ); } /** @@ -952,19 +954,19 @@ public function book_reviews_meta_box() { public function book_reviews_box() { global $post; - include_once(BOOK_REVIEWS_FUNC); + include_once( BOOK_REVIEWS_FUNC ); $options = get_option( 'book_reviews_settings', book_reviews_option_defaults() ); echo ''; + wp_create_nonce( plugin_basename( __FILE__ ) ) . '" />'; echo '
'; - if ( isset($options['stock']) && ($options['stock'] == true) ) { + if ( isset( $options['stock'] ) && ($options['stock'] == true) ) { echo '