diff --git a/CHANGELOG.md b/CHANGELOG.md index 31bfb567..273b7e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] - TBD +## [2.8.1] - 2022-12-13 + +### Fixed +- Fixes fatal error when Brightcove submenu item is null. Props [@phpbits](https://github.com/phpbits) and [@oscarssanchez](https://github.com/oscarssanchez) via [#300](https://github.com/10up/brightcove-video-connect/pull/300) + ## [2.8.0] - 2022-10-17 ### Deprecated @@ -399,6 +404,7 @@ All notable changes to this project will be documented in this file, per [the Ke - First release [Unreleased]: https://github.com/10up/brightcove-video-connect/compare/master...develop +[2.8.1]: https://github.com/10up/brightcove-video-connect/compare/2.8.0...2.8.1 [2.8.0]: https://github.com/10up/brightcove-video-connect/compare/2.7.0...2.8.0 [2.7.0]: https://github.com/10up/brightcove-video-connect/compare/2.6.1...2.7.0 [2.6.1]: https://github.com/10up/brightcove-video-connect/compare/2.6.0...2.6.1 diff --git a/brightcove-video-connect.php b/brightcove-video-connect.php index 3da931f4..a305d362 100644 --- a/brightcove-video-connect.php +++ b/brightcove-video-connect.php @@ -3,7 +3,7 @@ * Plugin Name: Brightcove Video Connect * Plugin URI: https://wordpress.org/plugins/brightcove-video-connect/ * Description: A Brightcoveâ„¢ Connector for WordPress that leverages enhanced APIs and Brightcoveâ„¢ Capabilities - * Version: 2.8.0 + * Version: 2.8.1 * Author: 10up * Author URI: http://10up.com * License: GPLv2+ @@ -31,7 +31,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 021.0.2301 USA */ -define( 'BRIGHTCOVE_VERSION', '2.8.0' ); +define( 'BRIGHTCOVE_VERSION', '2.8.1' ); define( 'BRIGHTCOVE_URL', plugin_dir_url( __FILE__ ) ); define( 'BRIGHTCOVE_PATH', dirname( __FILE__ ) . '/' ); define( 'BRIGHTCOVE_BASENAME', plugin_basename( __FILE__ ) ); diff --git a/includes/admin/class-bc-admin-menu.php b/includes/admin/class-bc-admin-menu.php index 766cf3fd..bff41251 100644 --- a/includes/admin/class-bc-admin-menu.php +++ b/includes/admin/class-bc-admin-menu.php @@ -22,8 +22,6 @@ public function __construct() { * Generates the Brightcove Menus and non-menu admin pages */ public function register_admin_menu() { - global $submenu; - if ( BC_Utility::current_user_can_brightcove() ) { add_menu_page( esc_html__( 'Brightcove', 'brightcove' ), esc_html__( 'Brightcove', 'brightcove' ), 'edit_posts', 'brightcove', array( $this, 'render_settings_page' ), plugins_url( 'images/sidebar-icon.svg', dirname( __DIR__ ) ), 50 ); @@ -36,9 +34,7 @@ public function register_admin_menu() { add_submenu_page( null, esc_html__( 'Add Source', 'brightcove' ), esc_html__( 'Add Source', 'brightcove' ), 'manage_options', 'page-brightcove-edit-source', array( $this, 'render_edit_source_page' ) ); add_submenu_page( null, esc_html__( 'Edit Label', 'brightcove' ), esc_html__( 'Edit Label', 'brightcove' ), 'manage_options', 'page-brightcove-edit-label', array( $this, 'render_edit_label_page' ) ); - // Removes the Brightcove Submenu from the menu that WP automatically provides when registering a top level page - array_shift( $submenu['brightcove'] ); - + remove_submenu_page( 'brightcove', 'brightcove' ); } } diff --git a/languages/brightcove.pot b/languages/brightcove.pot index 68e67ad3..4c0f53cb 100644 --- a/languages/brightcove.pot +++ b/languages/brightcove.pot @@ -2,10 +2,10 @@ # This file is distributed under the GPLv2+. msgid "" msgstr "" -"Project-Id-Version: Brightcove Video Connect 2.8.0\n" +"Project-Id-Version: Brightcove Video Connect 2.8.1\n" "Report-Msgid-Bugs-To: " "https://wordpress.org/support/plugin/brightcove-video-connect\n" -"POT-Creation-Date: 2022-10-07 19:13:07+00:00\n" +"POT-Creation-Date: 2022-12-08 17:32:37+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -73,7 +73,7 @@ msgid "Invalid Search Type" msgstr "" #: includes/admin/class-bc-admin-labels-page.php:43 -#: includes/admin/class-bc-admin-menu.php:37 +#: includes/admin/class-bc-admin-menu.php:35 msgid "Edit Label" msgstr "" @@ -82,7 +82,7 @@ msgid "Enter the new label name." msgstr "" #: includes/admin/class-bc-admin-labels-page.php:79 -#: includes/admin/class-bc-admin-menu.php:33 +#: includes/admin/class-bc-admin-menu.php:31 msgid "Brightcove Labels" msgstr "" @@ -143,48 +143,48 @@ msgstr "" msgid "Edit" msgstr "" -#: includes/admin/class-bc-admin-menu.php:29 +#: includes/admin/class-bc-admin-menu.php:27 #: includes/admin/class-bc-templates.php:481 msgid "Brightcove" msgstr "" -#: includes/admin/class-bc-admin-menu.php:30 +#: includes/admin/class-bc-admin-menu.php:28 #: includes/admin/class-bc-admin-videos-page.php:35 msgid "Brightcove Videos" msgstr "" -#: includes/admin/class-bc-admin-menu.php:30 +#: includes/admin/class-bc-admin-menu.php:28 #: includes/admin/class-bc-templates.php:487 #: includes/admin/class-bc-templates.php:673 #: includes/admin/class-bc-templates.php:1041 msgid "Videos" msgstr "" -#: includes/admin/class-bc-admin-menu.php:31 +#: includes/admin/class-bc-admin-menu.php:29 #: includes/admin/class-bc-admin-playlists-page.php:34 msgid "Brightcove Playlists" msgstr "" -#: includes/admin/class-bc-admin-menu.php:31 +#: includes/admin/class-bc-admin-menu.php:29 #: includes/admin/class-bc-templates.php:488 msgid "Playlists" msgstr "" -#: includes/admin/class-bc-admin-menu.php:32 +#: includes/admin/class-bc-admin-menu.php:30 #: includes/admin/class-bc-admin-settings-page.php:81 msgid "Brightcove Settings" msgstr "" -#: includes/admin/class-bc-admin-menu.php:32 includes/class-bc-utility.php:533 +#: includes/admin/class-bc-admin-menu.php:30 includes/class-bc-utility.php:533 msgid "Settings" msgstr "" -#: includes/admin/class-bc-admin-menu.php:33 +#: includes/admin/class-bc-admin-menu.php:31 #: includes/admin/class-bc-templates.php:247 msgid "Labels" msgstr "" -#: includes/admin/class-bc-admin-menu.php:36 +#: includes/admin/class-bc-admin-menu.php:34 msgid "Add Source" msgstr "" diff --git a/package.json b/package.json index c918063a..6008ce26 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "title": "brightcove-video-connect", "description": "A Brightcove plugin for WordPress.", - "version": "2.8.0", + "version": "2.8.1", "homepage": "https://wordpress.org/plugins/brightcove-video-connect/", "author": { "name": "10up", diff --git a/readme.txt b/readme.txt index e4534baa..02ef94e2 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Donate link: https://supporters.eff.org/donate Tags: brightcove, 10up, videos, video Requires at least: 4.2 Tested up to: 6.0 -Stable tag: 2.8.0 +Stable tag: 2.8.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -39,6 +39,10 @@ For installation, usage, and Frequently Asked Question please see the [Brightcov == Changelog == += 2.8.1 = + +* Fixed fatal error when Brightcove menu is null. + = 2.8.0 = Deprecated