-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from uriweb/release-1.5.1
Release 1.5.1
- Loading branch information
Showing
12 changed files
with
292 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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's to Master's">Bachelor's to Master'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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.