Skip to content

Commit

Permalink
chore: added screenshots
Browse files Browse the repository at this point in the history
chore: updated readme
fix: fixed undefined show_hide_title within templates
  • Loading branch information
aaronware committed Oct 3, 2020
1 parent d704757 commit c214831
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 17 deletions.
Binary file added .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Added - New Feature. You can now choose to display the title of your Courier Notice for all Styles of notices.
* Added - Added some FAQs to the readme.txt
* Added - FAQ.md that is updated and generated from the readme.txt
* Added - Some new screenshots were added so users can get a sense of what Courier Notices look like by default.
* Fixed - Minor display issue for "Sub Tabs" within the Settings area of the WordPress admin
* Fixed - Cleaned up spacing of Headers and Sub Titles within Settings to make things easier to read.
* Fixed - Numerous nitpicky CSS things that you may or may not notice
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ e.g.

## Screenshots ##

1. List of "Types" of Informational Courier Notices within the WordPress admin
2. Editing colors and icons of a Courier Notice
3. Frontend display of a few Courier Notices, including dismissible notices.
4. Frontend display of a modal Courier Notice.


## Shortcodes ##

Expand Down
4 changes: 4 additions & 0 deletions assets/scss/frontend/_notices.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
@include courier-note-layout;
}

.courier-notice-title {
margin:0;
}

$courier_list: (
('primary', $notice-default-primary, $black, $icon-primary, '', ''),
('success', $notice-default-success, $black, $icon-success, '', ''),
Expand Down
3 changes: 3 additions & 0 deletions css/courier-notices.css
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ body.wp-admin table.courier_notice_page_courier [class*="icon-"] {
font-weight: normal;
color: inherit; }

.courier-notices .courier-notice-title {
margin: 0; }

.courier-notices .courier_type-primary {
background: #039AD6;
color: #222; }
Expand Down
6 changes: 6 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ The great thing is that Courier Notices is highly extendable and our team is add

== Screenshots ==

1. List of "Types" of Informational Courier Notices within the WordPress admin
2. Editing colors and icons of a Courier Notice
3. Frontend display of a few Courier Notices, including dismissible notices.
4. Frontend display of a modal Courier Notice.

== Changelog ==

= 1.3.0 =
Expand All @@ -50,6 +55,7 @@ The great thing is that Courier Notices is highly extendable and our team is add
* Added - New Feature. You can now choose to display the title of your Courier Notice for all Styles of notices.
* Added - Added some FAQs to the readme.txt
* Added - FAQ.md that is updated and generated from the readme.txt
* Added - Some new screenshots were added so users can get a sense of what Courier Notices look like by default.
* Fixed - Minor display issue for "Sub Tabs" within the Settings area of the WordPress admin
* Fixed - Cleaned up spacing of Headers and Sub Titles within Settings to make things easier to read.
* Fixed - Numerous nitpicky CSS things that you may or may not notice
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Courier_REST_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function display_notices( WP_REST_Request $request ) {
$notice->assign( 'notice_id', $courier_notice->ID );
$notice->assign( 'show_hide_title', $notice_data['show_hide_title'] );

$notice_title = courier_notices_the_notice_title( $courier_notice->post_title, '<h6>', '</h6>', false );
$notice_title = courier_notices_the_notice_title( $courier_notice->post_title, '<h6 class="courier-notice-title">', '</h6>', false );

$notice->assign( 'notice_title', $notice_title );
$notice->assign( 'notice_class', implode( ' ', get_post_class( $post_classes, $courier_notice->ID ) ) );
Expand Down
16 changes: 8 additions & 8 deletions src/Controller/Settings_REST_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ public function register_routes() {
$namespace,
'/settings',
array(
'methods' => 'POST',
'callback' => array( $this, 'update_settings' ),
'args' => array(),
'permissions_callback' => array( $this, 'permissions' ),
'methods' => 'POST',
'callback' => array( $this, 'update_settings' ),
'args' => array(),
'permission_callback' => array( $this, 'permissions' ),
)
);

register_rest_route(
$namespace,
'/settings',
array(
'methods' => 'GET',
'callback' => array( $this, 'get_settings' ),
'args' => array(),
'permissions_callback' => array( $this, 'permissions' ),
'methods' => 'GET',
'callback' => array( $this, 'get_settings' ),
'args' => array(),
'permission_callback' => array( $this, 'permissions' ),
)
);
}
Expand Down
22 changes: 14 additions & 8 deletions src/Model/Courier_Notice/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,22 +463,24 @@ public function get_notice_meta( int $courier_notice_id ) {
$courier_style = get_the_terms( $courier_notice_id, 'courier_style' ); // Get the style associated with the notice
$courier_type = get_the_terms( $courier_notice_id, 'courier_type' ); // Get the type associated with the notice (typically for informational notices)
$courier_icon = get_term_meta( $courier_type[0]->term_id, '_courier_type_icon', true );

// Get all the options for showing the title by default
$courier_design_options = get_option( 'courier_design', array() );
$global_show_title_rules = $courier_design_options['enable_title'];
$notice_style_global_show_title = ! empty( in_array( $courier_style[0]->slug, $global_show_title_rules, true ) );

// If the notice style is set to show the title by default
if ( ! is_wp_error( $courier_style ) && $notice_style_global_show_title ) {
// Override the show global toggle and force this notice to hide.
if ( ! empty( $hide_title ) ) {
$show_hide_title = 'hide';
} else {
$show_hide_title = 'show';
if ( ! is_wp_error( $courier_style ) ) {

if ( $notice_style_global_show_title ) {
// Override the show global toggle and force this notice to hide.
if ( ! empty( $hide_title ) ) {
$show_hide_title = 'hide';
} else {
$show_hide_title = 'show';
}
}
} else {
if ( $show_title ) {
if ( ! empty( $show_title ) ) {
$show_hide_title = 'show';
}

Expand All @@ -488,6 +490,10 @@ public function get_notice_meta( int $courier_notice_id ) {
}
}

if ( ! isset( $show_hide_title ) ) {
$show_hide_title = 'hide';
}

$notices_meta = array(
'is_dismissible' => ( $is_dismissible ) ? $is_dismissible : false,
'show_hide_title' => ( $show_hide_title ) ? $show_hide_title : 'hide',
Expand Down

0 comments on commit c214831

Please # to comment.