Plugin Directory

Changeset 2653674


Ignore:
Timestamp:
01/06/2022 04:32:33 PM (3 years ago)
Author:
ablancodev
Message:

Version 1.0.1

Location:
saas-generator
Files:
11 added
4 edited

Legend:

Unmodified
Added
Removed
  • saas-generator/trunk/readme.txt

    r2650105 r2653674  
    55Requires at least: 5.7
    66Tested up to: 5.8.2
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3939== Changelog ==
    4040
     41= 1.0.1 =
     42* Added Bootstrap css/js
     43
    4144= 1.0.0 =
    4245* Initial version.
  • saas-generator/trunk/saas-generator.php

    r2650105 r2653674  
    44 * Plugin URI: https://eggemplo.com
    55 * Description: Create the Saas that you need.
    6  * Version: 1.0.0
     6 * Version: 1.0.1
    77 * Author: ablancodev
    88 * Author URI: https://www.ablancodev.com
     
    2222
    2323    load_plugin_textdomain ( 'saas-generator', null, 'saas-generator/languages' );
     24
     25    // Scripts
     26    add_action( 'wp_enqueue_scripts', 'saas_shortcode_scripts');
    2427}
     28
     29// Bootstrap
     30function 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
    2540
    2641
  • saas-generator/trunk/view/edit-post.php

    r2650105 r2653674  
    2828<form action="<?php echo get_the_permalink();?>" method="POST" enctype="multipart/form-data">
    2929
     30<div class="form-group">
    3031    <?php
    3132    if ( !$front_attrs['exclude_thumbnail'] ) {
     
    3637        }
    3738        ?>
    38         <input type="file" name="imagen">
    39         <br>
     39        <input type="file" name="imagen" class="form-control">
     40       
    4041    <?php
    4142    }
    4243    ?>
    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>
    4649    <?php
    4750    if ( !$front_attrs['exclude_description'] ) {
    4851    ?>
    49         <span><?php _e('Description:', 'saas-generator');?></span>
     52    <div class="form-group">
     53        <label><?php _e('Description:', 'saas-generator');?></label>
    5054        <?php
    5155        $args = array(
     
    6064        $editor_id = 'description';
    6165        wp_editor( $description, $editor_id, $args );
     66    ?>
     67    </div>
     68    <?php
    6269    }
    6370   
     
    9097                            case 'text':
    9198                                ?>
    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>
    94103                                <?php
    95104                                break;
     
    97106                            case 'select':
    98107                                ?>
    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>
    113124                                <?php
    114125                                break;
    115126                            case 'post_object':
    116127                                ?>
    117                                 <span><?php echo esc_html($field['label']);?></span>
     128                                <div class="form-group">
     129                                    <label><?php echo esc_html($field['label']);?></label>
    118130                                <?php
    119131                                $multiple = '';
     
    129141                                    // El campo no se puede llamar post_type, entra en conflicto
    130142                                    ?>
    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">
    132144                                    <?php
    133145                                    foreach ( $objs as $obj ) {
     
    144156                                    <?php
    145157                                }
     158                                ?>
     159                                </div>
     160                                <?php
    146161                                break;
    147162                            case 'true_false':
     
    151166                                }
    152167                                ?>
    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>
    155172                                <?php
    156173                                break;
     
    172189
    173190    <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"/>
    175192   
    176193</form>
  • saas-generator/trunk/view/shortcodes.php

    r2650105 r2653674  
    147147        ));
    148148       
    149         $output = '<a href="' . get_the_permalink() . '/?action=new" class="button btn">' . __('Add new', 'saas-generator') . '</a>';
     149        $output = '<a href="' . get_the_permalink() . '/?action=new" class="btn btn-primary">' . __('Add new', 'saas-generator') . '</a>';
    150150       
    151151        if ( $cars ) {
Note: See TracChangeset for help on using the changeset viewer.