Skip to content

Commit

Permalink
fix issue with notice on custom post types
Browse files Browse the repository at this point in the history
  • Loading branch information
annlickander committed Mar 24, 2023
1 parent 8fe6ed3 commit cae62fb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. This projec

## [Unreleased]

## [1.1.1] - 2023-03-24

### Fixed
- Fixed issue where a red notices was displayed on custom post types that this plugin was not working properly.

## [1.1.0] - 2022-10-02

### Changed
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Adds a Gutenberg panel where you can add specific page-specific CSS.
This is then saved into files, minified and included only only on the very specific page it is created for.

## Custom Post Types
In order to use this plugin on custom post type, the post type must have the 'custom-fields' support.

## Coding Style
We exclusively try and use the WordPress coding practices for all languages,
which includes PHP, HTML, CSS and JavaScript.
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/dist/editor.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/scripts/src/components/css-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function CSSPanel() {
function getCSSValue() {
const meta = wp.data.select( "core/editor" ).getEditedPostAttribute( "meta" );

if ( meta.page_specific_styles ) {
if ( meta && meta.page_specific_styles ) {
return meta.page_specific_styles;
}
return "";
Expand Down
2 changes: 1 addition & 1 deletion bm-page-specific-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: BM Page Specific CSS
* Plugin URI: https://bernskioldmedia.com
* Description: Allows editors to add styles specific for pages and post.
* Version: 1.1.0
* Version: 1.1.1
* Author: Bernskiold Media
* Author URI: https://bernskioldmedia.com
* Text Domain: bm-page-specific-css
Expand Down
6 changes: 3 additions & 3 deletions languages/bm-page-specific-css.pot
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (C) 2022 Bernskiold Media
# Copyright (C) 2023 Bernskiold Media
# This file is distributed under the same license as the BM Page Specific CSS package.
msgid ""
msgstr ""
"Project-Id-Version: BM Page Specific CSS 1.1.0\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/bm-page-specific-css\n"
"POT-Creation-Date: 2022-10-02 09:45:00+00:00\n"
"POT-Creation-Date: 2023-03-24 13:28:05+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"X-Generator: node-wp-i18n 1.2.6\n"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bm-page-specific-css",
"version": "1.0.1",
"version": "1.1.1",
"description": "Allows editors to add styles specific for pages and post.",
"main": "assets/scripts/src/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Plugin {
*
* @var string
*/
protected const VERSION = '1.1.0';
protected const VERSION = '1.1.1';

/**
* Plugin Textdomain
Expand Down Expand Up @@ -60,7 +60,7 @@ public static function instance() {
public function __construct() {

add_action( 'init', [ self::class, 'load_languages' ] );
add_action( 'init', [ self::class, 'register_meta' ] );
add_action( 'init', [ self::class, 'register_meta' ], 20 );

Assets::hooks();
Generate_Files::hooks();
Expand Down

0 comments on commit cae62fb

Please sign in to comment.