Skip to content

Instantly share code, notes, and snippets.

@bewho
Forked from fernandiez/functions.php
Created December 20, 2018 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bewho/6613a887e06c04099d6e57394a4f5a8e to your computer and use it in GitHub Desktop.
Save bewho/6613a887e06c04099d6e57394a4f5a8e 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