Last active
December 20, 2018 09:58
-
-
Save fernandiez/8fff94b21ebaf72f4fdd82463541829d to your computer and use it in GitHub Desktop.
Shortcode Placeholder Image dummyimage_shortcode_function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'dummyimage', 'dummyimage_shortcode_function' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Añadir Shortcode | |
function dummyimage_shortcode_function( $atts ) { | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'width' => '600', | |
'height' => '300', | |
'background' => 'eeeeee', | |
'text' => 'ffffff', | |
), | |
$atts | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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