Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/** * Build image element from given setting * * @param array $attr Image options. * @param string $image_size Image size. * @param string $additional_id ID. * @param string $additional_class Class. * @param string $additional_alt Alt. * * @return string */ protected function render_image_element( $attr, $image_size = 'thumbnail', $additional_id = null, $additional_class = null, $additional_alt = null ) { $id = ! empty( $additional_id ) ? ' id="' . $additional_id . '"' : ''; $class = ! empty( $additional_class ) ? ' class="' . $additional_class . '"' : ''; $alt = ! empty( $additional_alt ) ? ' alt="' . $additional_alt . '"' : ( isset( $attr['alt'] ) && ! empty( $attr['alt'] ) ? ' alt="' . $attr['alt'] . '"' : '' ); $width = ! empty( $attr['width'] ) ? ' width="' . $attr['width'] . '"' : ''; $height = ! empty( $attr['height'] ) ? ' height="' . $attr['height'] . '"' : ''; $attachment = ! empty( $attr['id'] ) ? wp_get_attachment_image_src( $attr['id'], $image_size ) : ''; $image = ! empty( $attachment[0] ) ? '
' : ''; $image = ! empty( $attr['url'] ) && empty( $image ) ? '
' : $image; return $image; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)