Changeset 2086696
- Timestamp:
- 05/13/2019 10:35:24 AM (7 years ago)
- Location:
- postem-ipsum/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (2 diffs)
-
admin/assets/js/postem_ipsum_admin_main.js (modified) (4 diffs)
-
admin/postem-ipsum-admin.php (modified) (2 diffs)
-
admin/views/postem_ipsum_settings.php (modified) (1 diff)
-
postem-ipsum.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
postem-ipsum/trunk/README.txt
r2085211 r2086696 21 21 - Featured images: coloured block images to check your templates. You can select a color or choose randomly. You can set width and height for the posts thumbnail. 22 22 - Terms can be selected by the user, or choosen randomly. 23 - Post Format Selection or Random 23 24 - Woocommerce Products: If you have Woocommerce instaled, you can create random products, select range price, and so on. 24 25 - Terms and categories: You can create terms/categories for the selected taxonomy. … … 43 44 44 45 == Changelog == 46 = 2.0.3 = 47 * Added Post Format selection 45 48 = 2.0.2 = 46 49 * Fix small issues -
postem-ipsum/trunk/admin/assets/js/postem_ipsum_admin_main.js
r2048859 r2086696 10 10 var cat_random = 0; 11 11 var author_random = 0; 12 var format_random = 0; 12 13 var bg_random = 0; 13 14 var price_min = document.getElementById('price_slider-padding-value-min'), … … 224 225 author_random = 0; 225 226 } 227 }); 228 229 // Elegimos format aletatori0? 230 $(document).on("change", "#format_random", function () { 231 232 if ($('input[name="format_random"]').is(':checked')) { 233 234 $("#postem_ipsum_format").prop("disabled", true); 235 236 format_random = 1; 237 } else { 238 239 $("#postem_ipsum_format").prop("disabled", false); 240 241 format_random = 0; 242 } 243 244 226 245 }); 227 246 … … 563 582 cat_random: cat_random, 564 583 author_random: author_random, 584 format_random: format_random, 565 585 postem_ipsum_term: terms, 566 586 }) … … 591 611 .then(function () { 592 612 $('body').loadingModal('destroy'); 593 location.reload();613 //location.reload(); 594 614 }); 595 615 }); -
postem-ipsum/trunk/admin/postem-ipsum-admin.php
r2079734 r2086696 354 354 $author = isset( $variables['postem_ipsum_author'] ) ? sanitize_text_field( $variables['postem_ipsum_author'] ) : ""; 355 355 356 $format_random = isset( $_POST["format_random"] ) ? sanitize_text_field( $_POST["format_random"] ) : "0"; 357 $format = isset( $variables['postem_ipsum_format'] ) ? sanitize_text_field( $variables['postem_ipsum_format'] ) : ""; 358 359 360 356 361 357 362 // Cogemos todas las categorias por si queremos coger una aleatoria … … 448 453 'post_excerpt' => sanitize_textarea_field( $short_description ), 449 454 ) ); 455 456 // Insert post format 457 $all_formats = array( 0 , 'aside', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video', 'audio' ); 458 if($format_random == '1'){ 459 $format = $all_formats[ rand( 0, count($all_formats) - 1 ) ]; 460 set_post_format($post_id, $format ); //sets the given post to the 'gallery' format 461 } 462 else{ 463 set_post_format($post_id, $format ); //sets the given post to the 'gallery' format 464 } 465 450 466 451 467 if ( $cat_random == "1" ) { -
postem-ipsum/trunk/admin/views/postem_ipsum_settings.php
r2048859 r2086696 72 72 73 73 <tr> 74 <th scope="row"><?php _e( 'Select Post Format', POSTEM_IPSUM_TEXT_DOMAIN ); ?></th> 75 <td> 76 <label><?php _e( "Random", POSTEM_IPSUM_TEXT_DOMAIN ); ?>: </label> 77 <input type="checkbox" name="format_random" id="format_random"> 78 <select name="postem_ipsum_format" id="postem_ipsum_format"> 79 <option value="0" selected><?php _e( 'Select a post format', POSTEM_IPSUM_TEXT_DOMAIN ); ?></option> 80 <option value="chat">Chat</option> 81 <option value="gallery">Gallery</option> 82 <option value="image">Image</option> 83 <option value="link">Link</option> 84 <option value="quote">Quote</option> 85 <option value="status">Status</option> 86 <option value="video">Video</option> 87 <option value="audio">Audio</option> 88 </select> 89 </td> 90 </tr> 91 92 <tr> 74 93 <th scope="row"><?php _e( 'How many posts', POSTEM_IPSUM_TEXT_DOMAIN ); ?></th> 75 94 <td> -
postem-ipsum/trunk/postem-ipsum.php
r2048859 r2086696 4 4 * Plugin URI: 5 5 * Description: Plugin to create some random posts from scratch 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Author: Fco Palacios 8 8 * Author URI:
Note: See TracChangeset
for help on using the changeset viewer.