Skip to content

Instantly share code, notes, and snippets.

@fernandiez
Last active December 20, 2018 09:58
Show Gist options
  • Save fernandiez/8fff94b21ebaf72f4fdd82463541829d to your computer and use it in GitHub Desktop.
Save fernandiez/8fff94b21ebaf72f4fdd82463541829d to your computer and use it in GitHub Desktop.
Shortcode Placeholder Image dummyimage_shortcode_function
// Añadir Shortcode
function dummyimage_shortcode_function( $atts ) {
// Atributos
$atts = shortcode_atts(
array(
'width' => '600',
'height' => '300',
'background' => 'eeeeee',
'text' => 'ffffff',
),
$atts
);
return '<img src="https://dummyimage.com/'. $value['width'] . '/'. $value['height'] . '/'. $value['backgound'] . '/'. $value['text'] . '.jpg">';
}
add_shortcode( 'dummyimage', 'dummyimage_shortcode_function' );
add_shortcode( 'dummyimage', 'dummyimage_shortcode_function' );
// Añadir Shortcode
function dummyimage_shortcode_function( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'width' => '600',
'height' => '300',
'background' => 'eeeeee',
'text' => 'ffffff',
),
$atts
);
return '<img src="https://dummyimage.com/'. $value['width'] . '/'. $value['height'] . '/'. $value['backgound'] . '/'. $value['text'] . '.jpg">';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment