Created
October 14, 2017 16:04
-
-
Save Galibri/33ef5e8dee4ecd1f0e17104e62576b75 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
/* | |
Plugin Name:Stock Toolkit | |
*/ | |
function stock_alert_shortcode($atts, $content=null){ | |
extract(shortcode_atts( | |
array( | |
'city' => '', | |
), $atts )); | |
if( $city == 'Dhaka' ){ | |
$message = '' . esc_html( $city ) . ' is the most wonderfull city'; | |
}elseif( $city == 'sylhet' ){ | |
$message = '' . esc_html( $city ) . ' is the most wonderfull city'; | |
}elseif( $city == 'mymensingh' ){ | |
$message = '' . esc_html( $city ) . ' is the most wonderfull city'; | |
}else{ | |
$message= '' . esc_html( $city ) . ' we do not know'; | |
} | |
return $message; | |
} | |
add_shortcode( 'alert','stock_alert_shortcode' ); | |
function stock_shortcode($atts, $content=null){ | |
extract(shortcode_atts( | |
array( | |
'id' => '', | |
), $atts)); | |
$imag_array = wp_get_attachment_image_src( $id,'large' ); | |
return $imag_array; | |
} | |
add_shortcode( 'image','stock_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment