equal
deleted
inserted
replaced
1 <?php |
1 <?php |
2 /** |
2 /** |
3 * Bookmark Template Functions for usage in Themes |
3 * Bookmark Template Functions for usage in Themes. |
4 * |
4 * |
5 * @package WordPress |
5 * @package WordPress |
6 * @subpackage Template |
6 * @subpackage Template |
7 */ |
7 */ |
8 |
8 |
81 $desc = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) ); |
81 $desc = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) ); |
82 $name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) ); |
82 $name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) ); |
83 $title = $desc; |
83 $title = $desc; |
84 |
84 |
85 if ( $parsed_args['show_updated'] ) { |
85 if ( $parsed_args['show_updated'] ) { |
86 if ( '00' !== substr( $bookmark->link_updated_f, 0, 2 ) ) { |
86 if ( ! str_starts_with( $bookmark->link_updated_f, '00' ) ) { |
87 $title .= ' ('; |
87 $title .= ' ('; |
88 $title .= sprintf( |
88 $title .= sprintf( |
89 /* translators: %s: Date and time of last update. */ |
89 /* translators: %s: Date and time of last update. */ |
90 __( 'Last updated: %s' ), |
90 __( 'Last updated: %s' ), |
91 gmdate( |
91 gmdate( |
122 |
122 |
123 $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>'; |
123 $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>'; |
124 |
124 |
125 $output .= $parsed_args['link_before']; |
125 $output .= $parsed_args['link_before']; |
126 |
126 |
127 if ( null != $bookmark->link_image && $parsed_args['show_images'] ) { |
127 if ( '' !== $bookmark->link_image && $parsed_args['show_images'] ) { |
128 if ( strpos( $bookmark->link_image, 'http' ) === 0 ) { |
128 if ( str_starts_with( $bookmark->link_image, 'http' ) ) { |
129 $output .= "<img src=\"$bookmark->link_image\" $alt $title />"; |
129 $output .= '<img src="' . $bookmark->link_image . '"' . $alt . $title . ' />'; |
130 } else { // If it's a relative path. |
130 } else { // If it's a relative path. |
131 $output .= '<img src="' . get_option( 'siteurl' ) . "$bookmark->link_image\" $alt $title />"; |
131 $output .= '<img src="' . get_option( 'siteurl' ) . $bookmark->link_image . '"' . $alt . $title . ' />'; |
132 } |
132 } |
133 if ( $parsed_args['show_name'] ) { |
133 if ( $parsed_args['show_name'] ) { |
134 $output .= " $name"; |
134 $output .= " $name"; |
135 } |
135 } |
136 } else { |
136 } else { |
162 |
162 |
163 return $output; |
163 return $output; |
164 } |
164 } |
165 |
165 |
166 /** |
166 /** |
167 * Retrieve or echo all of the bookmarks. |
167 * Retrieves or echoes all of the bookmarks. |
168 * |
168 * |
169 * List of default arguments are as follows: |
169 * List of default arguments are as follows: |
170 * |
170 * |
171 * These options define how the Category name will appear before the category |
171 * These options define how the Category name will appear before the category |
172 * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will |
172 * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will |