Skip to content

Commit

Permalink
Don't str_replace( null ) #220 #235
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Dec 2, 2024
1 parent c10f4f4 commit 02f0f1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shortcodes/oik-navi.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function bw_get_shortcode_id( $set=false ) {
* <a href=url?bwscid123=1> page 1 </a>
* <a href=url?bwscid123=2> page 2 </a>
*
* If they've chosen another link the value is not set.
* If they've chosen another link the value is not set.
*
* @param integer - the ID of the bwscidnnn field
* @return integer - the required page ID, defaults to 1 if not set
Expand Down Expand Up @@ -163,7 +163,9 @@ function bw_navi_paginate_links( $id, $page, $pages ) {
* @return array|string|string[]
*/
function bw_navi_add_rel( $links, $rel="noindex" ) {
$links = str_replace( '<a class', '<a rel=' . $rel . ' class', $links );
if ( $links ) {
$links=str_replace( '<a class', '<a rel=' . $rel . ' class', $links );
}
return $links;
}

Expand Down

0 comments on commit 02f0f1e

Please sign in to comment.