Changeset 2653674
- Timestamp:
- 01/06/2022 04:32:33 PM (3 years ago)
- Location:
- saas-generator
- Files:
-
- 11 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
saas-generator/trunk/readme.txt
r2650105 r2653674 5 5 Requires at least: 5.7 6 6 Tested up to: 5.8.2 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 == Changelog == 40 40 41 = 1.0.1 = 42 * Added Bootstrap css/js 43 41 44 = 1.0.0 = 42 45 * Initial version. -
saas-generator/trunk/saas-generator.php
r2650105 r2653674 4 4 * Plugin URI: https://eggemplo.com 5 5 * Description: Create the Saas that you need. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: ablancodev 8 8 * Author URI: https://www.ablancodev.com … … 22 22 23 23 load_plugin_textdomain ( 'saas-generator', null, 'saas-generator/languages' ); 24 25 // Scripts 26 add_action( 'wp_enqueue_scripts', 'saas_shortcode_scripts'); 24 27 } 28 29 // Bootstrap 30 function saas_shortcode_scripts() { 31 global $post; 32 if( apply_filters('saas-add-bootstrap', true) && has_shortcode( $post->post_content, 'saas') ) { 33 wp_register_script('saas-bootstrap', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js', array('jquery'), '5.1.3', true); 34 wp_enqueue_script( 'saas-bootstrap'); 35 36 wp_enqueue_style( 'saas-bootstrap', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css',false,'5.1.3','all'); 37 } 38 } 39 25 40 26 41 -
saas-generator/trunk/view/edit-post.php
r2650105 r2653674 28 28 <form action="<?php echo get_the_permalink();?>" method="POST" enctype="multipart/form-data"> 29 29 30 <div class="form-group"> 30 31 <?php 31 32 if ( !$front_attrs['exclude_thumbnail'] ) { … … 36 37 } 37 38 ?> 38 <input type="file" name="imagen" >39 <br>39 <input type="file" name="imagen" class="form-control"> 40 40 41 <?php 41 42 } 42 43 ?> 43 <span><?php _e('Title:', 'saas-generator');?></span> 44 <input type="text" name="title" placeholder="<?php _e('Post title', 'saas-generator');?>" value="<?php echo esc_attr($titulo);?>"/> 45 44 </div> 45 <div class="form-group"> 46 <label><?php _e('Title:', 'saas-generator');?></label> 47 <input type="text" name="title" placeholder="<?php _e('Post title', 'saas-generator');?>" value="<?php echo esc_attr($titulo);?>" class="form-control"/> 48 </div> 46 49 <?php 47 50 if ( !$front_attrs['exclude_description'] ) { 48 51 ?> 49 <span><?php _e('Description:', 'saas-generator');?></span> 52 <div class="form-group"> 53 <label><?php _e('Description:', 'saas-generator');?></label> 50 54 <?php 51 55 $args = array( … … 60 64 $editor_id = 'description'; 61 65 wp_editor( $description, $editor_id, $args ); 66 ?> 67 </div> 68 <?php 62 69 } 63 70 … … 90 97 case 'text': 91 98 ?> 92 <span><?php echo esc_html($field['label']);?></span> 93 <input type="text" name="<?php echo esc_attr($field['name']);?>" value="<?php echo esc_attr(get_field($field['name'], $lugar));?>" placeholder="<?php echo esc_attr($field['placeholder']);?>" /> 99 <div class="form-group"> 100 <label><?php echo esc_html($field['label']);?></label> 101 <input type="text" name="<?php echo esc_attr($field['name']);?>" value="<?php echo esc_attr(get_field($field['name'], $lugar));?>" placeholder="<?php echo esc_attr($field['placeholder']);?>" class="form-control"/> 102 </div> 94 103 <?php 95 104 break; … … 97 106 case 'select': 98 107 ?> 99 <span><?php echo esc_attr($field['label']);?></span> 100 <select name="<?php echo esc_attr($field['name']);?>"> 101 <?php 102 foreach ( $field['choices'] as $key=>$choice ) { 103 $selected = ''; 104 if ( $key == get_field($field['name'], $lugar) ) { 105 $selected = 'selected'; 106 } 107 ?> 108 <option value="<?php echo esc_attr($key);?>" <?php echo $selected;?> ><?php echo esc_html($choice);?></option> 109 <?php 110 } 111 ?> 112 </select> 108 <div class="form-group"> 109 <label><?php echo esc_attr($field['label']);?></label> 110 <select name="<?php echo esc_attr($field['name']);?>" class="form-control"> 111 <?php 112 foreach ( $field['choices'] as $key=>$choice ) { 113 $selected = ''; 114 if ( $key == get_field($field['name'], $lugar) ) { 115 $selected = 'selected'; 116 } 117 ?> 118 <option value="<?php echo esc_attr($key);?>" <?php echo $selected;?> ><?php echo esc_html($choice);?></option> 119 <?php 120 } 121 ?> 122 </select> 123 </div> 113 124 <?php 114 125 break; 115 126 case 'post_object': 116 127 ?> 117 <span><?php echo esc_html($field['label']);?></span> 128 <div class="form-group"> 129 <label><?php echo esc_html($field['label']);?></label> 118 130 <?php 119 131 $multiple = ''; … … 129 141 // El campo no se puede llamar post_type, entra en conflicto 130 142 ?> 131 <select name="front_<?php echo esc_attr($field['name']);?>" <?php echo esc_attr($multiple);?> >143 <select name="front_<?php echo esc_attr($field['name']);?>" <?php echo esc_attr($multiple);?> class="form-control"> 132 144 <?php 133 145 foreach ( $objs as $obj ) { … … 144 156 <?php 145 157 } 158 ?> 159 </div> 160 <?php 146 161 break; 147 162 case 'true_false': … … 151 166 } 152 167 ?> 153 <input type="checkbox" name="<?php echo esc_attr($field['name']);?>" <?php echo $selected;?> > 154 <span><?php echo esc_html($field['label']);?></span> 168 <div class="form-group"> 169 <input type="checkbox" name="<?php echo esc_attr($field['name']);?>" <?php echo $selected;?> class="form-control"> 170 <label><?php echo esc_html($field['label']);?></label> 171 </div> 155 172 <?php 156 173 break; … … 172 189 173 190 <input type="hidden" name="action" value="save" /> 174 <input type="submit" name="save" value="<?php _e('Save', 'saas-generator');?>" />191 <input type="submit" name="save" value="<?php _e('Save', 'saas-generator');?>" class="btn btn-primary"/> 175 192 176 193 </form> -
saas-generator/trunk/view/shortcodes.php
r2650105 r2653674 147 147 )); 148 148 149 $output = '<a href="' . get_the_permalink() . '/?action=new" class="b utton btn">' . __('Add new', 'saas-generator') . '</a>';149 $output = '<a href="' . get_the_permalink() . '/?action=new" class="btn btn-primary">' . __('Add new', 'saas-generator') . '</a>'; 150 150 151 151 if ( $cars ) {
Note: See TracChangeset
for help on using the changeset viewer.