Skip to content

Commit

Permalink
Merge pull request #20 from uriweb/release-1.5.1
Browse files Browse the repository at this point in the history
Release 1.5.1
  • Loading branch information
bjcfuller authored Dec 1, 2020
2 parents d04300c + 06142eb commit 5ea36bf
Show file tree
Hide file tree
Showing 12 changed files with 292 additions and 132 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@

Add `[programs-categories]` to a page and a form magically appears.

## What's new in 1.5.0
## What's new in 1.5.1

Program Finder 1.5.0 is a minor release.
Program Finder 1.5.1 is a supplemental release.

* Adds a badge for undergraduate certificate programs
* Adds a badge icon and associated detail page display for accelerated programs, with the ability to customize detail page descriptor
* Adds a badge icon and associated detail page display for online programs
* Adds compatibility for [URI Component Library v5.0](https://github.com/uriweb/uri-component-library/releases/tag/v5.0.0)
* Updates development tools, including migrating to Autoprefixer v10 (plus required peer dependencies)
* Other bug fixes
* Extends the [Display Posts](https://github.com/billerickson/display-posts-shortcode) shortcode to optionally display program details
* Updates development tools

For complete details, see the [commit history](https://github.com/uriweb/uri-program-finder/pull/18/commits) and the [issue tracker](https://github.com/uriweb/uri-program-finder/issues).
For complete details, see the [commit history](https://github.com/uriweb/uri-program-finder/pull/20/commits) and the [issue tracker](https://github.com/uriweb/uri-program-finder/issues).

## Plugin Details

Expand All @@ -31,6 +27,6 @@ __Contributors:__ [johnpennypacker](https://github.com/johnpennypacker), [bjcful
__Tags:__ plugins, shortcodes
__Requires at least:__ 4.0
__Tested up to:__ 5.5
__Stable tag:__ 1.5.0
__Stable tag:__ 1.5.1
__License:__ GPL-3.0
__Licence URI:__ https://www.gnu.org/licenses/gpl-3.0.html
2 changes: 1 addition & 1 deletion css/map/programs.built.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/programs.built.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added i/accelerated_dark.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 i/online_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions inc/uri-program-finder-display-posts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Extend the Display Posts plugin.
*
* @package uri-program-finder
* @see https://displayposts.com/docs/the-output-filter/
*/

// Block direct requests
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}


/**
* Extend shortcode to display program details in output
*
* @param str $output Current output of post.
* @param arr $original_atts Original attributes passed to shortcode.
* @param str $image The image markup.
* @param str $title The title markup.
* @param str $date The date markup.
* @param str $excerpt The exerpt markup.
* @param str $inner_wrapper The inner wrapper tag name.
* @param str $content The content.
* @param arr $class The class list.
* @param str $author The author markup.
* @param arr $category_display_text Taxonomic elements.
* @return str $output
*/
function uri_program_finder_display_posts_output_details( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class, $author, $category_display_text ) {

if ( empty( $original_atts['program_finder_details'] ) ) {
return $output;
}

if ( has_category( 'accelerated' ) || has_category( 'online' ) ) {

$details = '<div class="program-details">';

if ( has_category( 'accelerated' ) ) {
$details .= '<div class="icon accelerated" title="Bachelor&#39;s to Master&#39;s">Bachelor&#39;s to Master&#39;s</div>';
}

if ( has_category( 'online' ) ) {
$details .= '<div class="icon online" title="Online Program">Online Program</div>';
}

$details .= '</div>';

$title = '<a class="title" href="' . get_the_permalink() . '"><span>' . get_the_title() . '</span>' . $details . '</a>';

}

array_push( $class, 'programs-list-has-details' );

$output = '<' . $inner_wrapper . ' class="' . implode( ' ', $class ) . '">' . $image . $title . $date . $author . $category_display_text . $excerpt . $content . '</' . $inner_wrapper . '>';
return $output;

}
add_action( 'display_posts_shortcode_output', 'uri_program_finder_display_posts_output_details', 10, 11 );
10 changes: 10 additions & 0 deletions inc/uri-program-finder-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,13 @@ function uri_program_finder_get_children( $id, $exclude = array() ) {
return $cats;

}

/**
* Helper function to excape square brackets in text that would otherwise appear in shortcodes
*
* @param str $input is the input string.
* @return str
*/
function uri_program_finder_escape_brackets( $input ) {
return str_replace( array( '[', ']' ), array( '&#91;', '&#93;' ), $input );
}
Loading

0 comments on commit 5ea36bf

Please sign in to comment.