Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Plugin Name: WordPress ShortCode
- * Description: Fules Plugin.
- * Version: 1.0
- */
- // Example 1 : WP Shortcode to display form on any page or post.
- function form_creation(){
- global $wpdb;
- ?>
- <form>
- Liters:<select>
- <?php
- $sql = 'SELECT liters FROM wp_tfp';
- $liters = $wpdb->get_col($sql);
- if( $liters ) {
- foreach( $liters as $liter ) {
- echo '<option value="' . $liter . '">' . $liter . '</option>';
- }
- }
- ?>
- </select>
- Price: <input type="text" name="price"><br>
- </form>
- <?php
- }
- add_shortcode('test', 'form_creation');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement