Skip to content

Commit

Permalink
Merge pull request #42 from pattyok/modal
Browse files Browse the repository at this point in the history
updating for empty permalink
  • Loading branch information
pattyok authored Aug 4, 2024
2 parents 27f26a4 + f09a2d0 commit 85cb786
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion carkeek-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Primary Branch: main
* Description: Series of blocks designed to work with this site's custom Theme
* Author: Patty O'Hara
* Version: 3.2.30
* Version: 3.2.31
* Author URI https://carkeekstudios.com/
* Text Domain: carkeek-blocks
*/
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove
2. This is the second screen shot

== Changelog ==
= 3.2.31 =
* Release 3.2.31 = 08/04/24
* Made an update to the template that it wont link the title and image if the permalink is empty. (Used on PIP where we are using a custom external link for news.)
= 3.2.26 =
* Release 3.2.26 = 06/18/24
* Updated the Modal Block/Carkeek Archive Modal to use Codyhouse components
Expand Down
9 changes: 5 additions & 4 deletions templates/custom-archive/default_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@
}
$link_start = '';
$link_end = '';
if ( isset( $data->noLink ) && true == $data->noLink ) {
$permalink = apply_filters( 'ck_custom_archive_' . $data->postTypeSelected . '__link', get_permalink(), $post->ID, $data );
if ( isset( $data->noLink ) && true == $data->noLink || empty( $permalink ) ) {
$link_title = get_the_title();
} else {
$permalink = apply_filters( 'ck_custom_archive_' . $data->postTypeSelected . '__link', get_permalink(), $post->ID, $data );

$permalink_target = isset( $data->newWindow ) && true == $data->newWindow ? '_blank' : '_self';
$permalink_target = apply_filters( 'ck_custom_archive_' . $data->postTypeSelected . '__link_target', $permalink_target, $data );
if ( !isset( $data->wholeLink ) || false == $data->wholeLink ) {
Expand Down Expand Up @@ -97,15 +98,15 @@
$image_style = isset( $data->imageOrientation ) ? 'layout-' . $data->imageOrientation : 'layout-landscape';

?>
<?php if ( false == $data->noLink && false == $data->wholeLink ) { ?>
<?php if ( false == $data->noLink && false == $data->wholeLink && !empty($permalink)) { ?>
<a class="ck-custom-archive-image-link <?php echo esc_attr( $image_style ); ?>" aria-hidden="true" tabindex="-1" href="<?php echo esc_url( $permalink ); ?>" target="<?php echo esc_attr( $permalink_target ); ?>">
<?php } else { ?>
<div class="ck-custom-archive-image-link <?php echo esc_attr( $image_style ); ?>">
<?php } ?>

<?php echo wp_kses_post( $featured_image ); ?>

<?php if ( false == $data->noLink && false == $data->wholeLink) { ?>
<?php if ( false == $data->noLink && false == $data->wholeLink && !empty($permalink)) { ?>
</a>
<?php } else { ?>
</div>
Expand Down

0 comments on commit 85cb786

Please sign in to comment.