Changeset 1184774
- Timestamp:
- 06/20/2015 03:01:19 PM (11 years ago)
- Location:
- yonox-add-multiple-posts/trunk
- Files:
-
- 8 edited
-
Readme.txt (modified) (2 diffs)
-
js/ynxadmp-ajax-admin.js (modified) (3 diffs)
-
lang/ynxadmp-es_ES.mo (modified) (previous)
-
lang/ynxadmp-es_ES.po (modified) (2 diffs)
-
lang/ynxadmp-ro_RO.mo (modified) (previous)
-
lang/ynxadmp-ro_RO.po (modified) (4 diffs)
-
ynxadmp-functions.php (modified) (3 diffs)
-
yonox-add-multiple-posts.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
yonox-add-multiple-posts/trunk/Readme.txt
r1184242 r1184774 4 4 Requires at least: 4.0 5 5 Tested up to: 4.0 6 Stable tag: stable6 Stable tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 A WordPress plugin to add multiple posts by a simple ajax method.10 Yonox Add Multiple Posts enables a WordPress user to quickly add multiple posts or pages at once. 11 11 12 12 == Description == 13 13 14 Add your entries by a few clicks without programming 14 * Specify Post Type content to be added is a post or a page. 15 * If Pages are added, user can specify Parent Pages (to add children). 16 * User can specify the Author of new posts/pages. 17 * User can specify post status (Published / Draft / Pending Review). 18 * User can now choose a category from a drop-down to assign to new posts. 19 * Support translation for Spanish and Romanian languages. 20 21 This plugin is designed to: 22 23 * Quickly inserting multiple posts or pages at once to be edited later (with Post or Page Status option). 24 * Perform a new site with the desired pages and sub-pages. 15 25 16 26 == Installation == 17 27 18 Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page. 19 Go to the new admin menu created. 20 Enjoy. 28 1. Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation. 29 2. Activate the Plugin from Plugins page. 30 3. Go to the new admin menu created. 31 4. That's all folks. Enjoy. 21 32 22 33 == Screenshots == … … 26 37 3. Process finished. 27 38 4. How it looks on the admin posts page. 39 40 == Changelog == 41 42 = 1.3 = 43 * Added Post Type selector. 44 * Added Status selector for Posts or Pages. 45 * Added Category selector for Posts. 46 * Added Parent selector for Pages. 47 * Added translation support for Spanish and Romanian languages. 48 49 = 1.2 = 50 * Version 1.2 Released. -
yonox-add-multiple-posts/trunk/js/ynxadmp-ajax-admin.js
r1184180 r1184774 46 46 action : 'addposts_ajaxfunc', 47 47 sendlocNonce : YnxadmpAdminAjax.ynxadmpNonce, 48 typeEntry : $('#ynxadmp_post_type').val(), 48 49 ynxadmpTitle : this, 50 ynxadmpCategory : $('#cat[name=cat]').val(), 51 ynxadmpParent : $('#page_id[name=page_id]').val(), 52 statusEntry : $('#ynxadmp_post_status').val(), 49 53 ynxadmpAuthor : $('select[name=author_id] option:selected').val() 50 54 }; … … 64 68 }); 65 69 70 ynxadmp_pageopts = $('.ynxadmp_page-options').remove(); 71 ynxadmp_postopts = $('.ynxadmp_post-options').remove(); 72 if ($('#ynxadmp_post_type').val() == 'ynxadmp_type_post') { 73 $('#ynxadmp_titles_section').after(ynxadmp_postopts); 74 } else if ($('#ynxadmp_post_type').val() == 'ynxadmp_type_page') { 75 $('#ynxadmp_titles_section').after(ynxadmp_pageopts); 76 } 77 78 $('#ynxadmp_post_type').change( function() { 79 if ($(this).val() == 'ynxadmp_type_post') { 80 $('.ynxadmp_page-options').remove(); 81 $('#ynxadmp_titles_section').after(ynxadmp_postopts); 82 } else if ($(this).val() == 'ynxadmp_type_page') { 83 $('.ynxadmp_post-options').remove(); 84 $('#ynxadmp_titles_section').after(ynxadmp_pageopts); 85 } 86 }); 87 66 88 $('#ynxadmp_progressbar').on('progressbarcomplete', function() { 67 89 $('#btn_ynxadmp_create_posts').fadeOut(1000); … … 75 97 $('#btn_ynxadmp_reset_form').click(function(event){ 76 98 event.preventDefault(); 77 $('#ynxadmp_titles_texarea').val(''); 78 $('#ynxadmp_progressbar').progressbar({ value: 0 }); 79 $("#ynxadmp_progressbar > span").html(''); 80 $('#btn_ynxadmp_create_posts').fadeIn(1000); 81 99 window.location.reload(true); 82 100 }); 83 101 -
yonox-add-multiple-posts/trunk/lang/ynxadmp-es_ES.po
r1184180 r1184774 2 2 msgstr "" 3 3 "Project-Id-Version: Yonox Add Multiple Posts\n" 4 "POT-Creation-Date: 2015-06- 17 23:23+0100\n"5 "PO-Revision-Date: 2015-06- 17 23:29+0100\n"4 "POT-Creation-Date: 2015-06-20 15:59+0100\n" 5 "PO-Revision-Date: 2015-06-20 16:03+0100\n" 6 6 "Last-Translator: \n" 7 "Language-Team: \n"7 "Language-Team: Yonox <yonox2008@gmail.com>\n" 8 8 "Language: es_ES\n" 9 9 "MIME-Version: 1.0\n" … … 36 36 msgstr "Configuración" 37 37 38 #: ynxadmp-functions.php:26 38 #: ynxadmp-functions.php:25 39 msgid "Post Type:" 40 msgstr "Tipo de entrada:" 41 42 #: ynxadmp-functions.php:28 43 msgid "Post" 44 msgstr "Entrada" 45 46 #: ynxadmp-functions.php:29 47 msgid "Page" 48 msgstr "Página" 49 50 #: ynxadmp-functions.php:34 51 msgid "Status:" 52 msgstr "Estado:" 53 54 #: ynxadmp-functions.php:37 55 msgid "Published" 56 msgstr "Publicado" 57 58 #: ynxadmp-functions.php:38 59 msgid "Pending Review" 60 msgstr "Pendiente de revisión" 61 62 #: ynxadmp-functions.php:39 63 msgid "Draft" 64 msgstr "Borrador" 65 66 #: ynxadmp-functions.php:44 39 67 msgid "Posts Titles:" 40 msgstr "Títulos de las entradas:"68 msgstr "Títulos de Entradas:" 41 69 42 #: ynxadmp-functions.php: 2770 #: ynxadmp-functions.php:45 43 71 msgid "One post on each line" 44 72 msgstr "Una entrada por cada línea" 45 73 46 #: ynxadmp-functions.php:33 74 #: ynxadmp-functions.php:51 75 msgid "Category:" 76 msgstr "Categoría:" 77 78 #: ynxadmp-functions.php:63 79 msgid "Parent:" 80 msgstr "Nivel superior:" 81 82 #: ynxadmp-functions.php:68 83 msgid "none" 84 msgstr "ninguno" 85 86 #: ynxadmp-functions.php:76 47 87 msgid "Author of Posts:" 48 88 msgstr "Autor de las entradas:" 49 89 50 #: ynxadmp-functions.php: 4790 #: ynxadmp-functions.php:90 51 91 msgid "Progress Bar:" 52 92 msgstr "Barra de progreso:" 53 93 54 #: ynxadmp-functions.php: 5694 #: ynxadmp-functions.php:99 55 95 msgid "Create Multiple Posts" 56 msgstr "Crear múltiples entradas"96 msgstr "Crear Múltiples Entradas" 57 97 58 #: ynxadmp-functions.php: 5798 #: ynxadmp-functions.php:100 59 99 msgid "Reset Form" 60 100 msgstr "Reiniciar Formulario" -
yonox-add-multiple-posts/trunk/lang/ynxadmp-ro_RO.po
r1184180 r1184774 2 2 msgstr "" 3 3 "Project-Id-Version: Yonox Add Multiple Posts\n" 4 "POT-Creation-Date: 2015-06- 18 00:49+0100\n"5 "PO-Revision-Date: 2015-06- 18 00:54+0100\n"4 "POT-Creation-Date: 2015-06-20 16:07+0100\n" 5 "PO-Revision-Date: 2015-06-20 16:14+0100\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 23 23 #: ynxadmp-functions.php:13 24 24 msgid "Process finished OK." 25 msgstr "Proces terminat OK."25 msgstr "Proces încheiat cu succes." 26 26 27 27 #: ynxadmp-functions.php:14 28 28 msgid "No titles found." 29 msgstr " Uns-au găsit titluri."29 msgstr "Nu s-au găsit titluri." 30 30 31 31 #: ynxadmp-functions.php:19 … … 37 37 msgstr "Setare" 38 38 39 #: ynxadmp-functions.php:26 39 #: ynxadmp-functions.php:25 40 msgid "Post Type:" 41 msgstr "Tip Post:" 42 43 #: ynxadmp-functions.php:28 44 msgid "Post" 45 msgstr "Articol" 46 47 #: ynxadmp-functions.php:29 48 msgid "Page" 49 msgstr "Pagină" 50 51 #: ynxadmp-functions.php:34 52 msgid "Status:" 53 msgstr "Stare:" 54 55 #: ynxadmp-functions.php:37 56 msgid "Published" 57 msgstr "Publicat" 58 59 #: ynxadmp-functions.php:38 60 msgid "Pending Review" 61 msgstr "Așteaptă aprobare" 62 63 #: ynxadmp-functions.php:39 64 msgid "Draft" 65 msgstr "Schiţă" 66 67 #: ynxadmp-functions.php:44 40 68 msgid "Posts Titles:" 41 msgstr "Titluri postări:"69 msgstr "Titluri Postări:" 42 70 43 #: ynxadmp-functions.php: 2771 #: ynxadmp-functions.php:45 44 72 msgid "One post on each line" 45 73 msgstr "Un post pe fiecare linie" 46 74 47 #: ynxadmp-functions.php:33 75 #: ynxadmp-functions.php:51 76 msgid "Category:" 77 msgstr "Categoria:" 78 79 #: ynxadmp-functions.php:63 80 msgid "Parent:" 81 msgstr "Nivel superior:" 82 83 #: ynxadmp-functions.php:68 84 msgid "none" 85 msgstr "niciunul" 86 87 #: ynxadmp-functions.php:76 48 88 msgid "Author of Posts:" 49 89 msgstr "Autor post-uri:" 50 90 51 #: ynxadmp-functions.php: 4791 #: ynxadmp-functions.php:90 52 92 msgid "Progress Bar:" 53 93 msgstr "Bară de progres:" 54 94 55 #: ynxadmp-functions.php: 5695 #: ynxadmp-functions.php:99 56 96 msgid "Create Multiple Posts" 57 msgstr "Crează multiple postări"97 msgstr "Crează Multiple Postări" 58 98 59 #: ynxadmp-functions.php: 5799 #: ynxadmp-functions.php:100 60 100 msgid "Reset Form" 61 101 msgstr "Resetare Formular" … … 63 103 #: yonox-add-multiple-posts.php:35 64 104 msgid "Yonox Add Multiple Posts" 65 msgstr "Yonox Ad d Multiple Posts"105 msgstr "Yonox Adăugare Multiple Posturi" 66 106 67 107 #: yonox-add-multiple-posts.php:35 -
yonox-add-multiple-posts/trunk/ynxadmp-functions.php
r1184180 r1184774 17 17 <thead> 18 18 <tr> 19 <th class="manage-column" style="width:180px; "><?php _e('Option','ynxadmp'); ?></th>20 <th colspan="2" class="manage-column" ><?php _e('Setting','ynxadmp'); ?></th>19 <th class="manage-column" style="width:180px;font-weight:600;"><?php _e('Option','ynxadmp'); ?></th> 20 <th colspan="2" class="manage-column" style="font-weight:600;"><?php _e('Setting','ynxadmp'); ?></th> 21 21 </tr> 22 22 </thead> 23 23 <tbody> 24 <input type="hidden" name="ynxadmp_createpost_input" value="post" />25 24 <tr class="alternate iedit"> 26 <td valign="top"><?php _e('Posts Titles:','ynxadmp'); ?><br /> 25 <td valign="middle" style="padding:14px 10px;font-weight:600;font-size:14px;"><?php _e('Post Type:','ynxadmp'); ?></td> 26 <td> 27 <select id="ynxadmp_post_type" name="ynxadmp_post_type" style="border-radius:4px;"> 28 <option value="ynxadmp_type_post" selected="selected"><?php _e('Post','ynxadmp'); ?></option> 29 <option value="ynxadmp_type_page"><?php _e('Page','ynxadmp'); ?></option> 30 </select> 31 </td> 32 </tr> 33 <tr class="alternate iedit"> 34 <td valign="middle" style="padding:14px 10px;font-weight:600;font-size:14px;"><?php _e('Status:','ynxadmp'); ?></td> 35 <td> 36 <select id="ynxadmp_post_status" name="ynxadmp_post_status"> 37 <option value="publish" selected="selected"><?php _e('Published','ynxadmp'); ?></option> 38 <option value="pending"><?php _e('Pending Review','ynxadmp'); ?></option> 39 <option value="draft"><?php _e('Draft','ynxadmp'); ?></option> 40 </select> 41 </td> 42 </tr> 43 <tr id="ynxadmp_titles_section" class="alternate iedit"> 44 <td valign="top" style="font-weight:600;font-size:14px;padding: 20px 10px;"><?php _e('Posts Titles:','ynxadmp'); ?><br /> 27 45 <small><?php _e('One post on each line','ynxadmp'); ?></small></td> 28 46 <td style="padding:8px 12px;"> … … 30 48 </td> 31 49 </tr> 50 <tr class="alternate iedit ynxadmp_post-options"> 51 <td style="padding:14px 10px;font-weight:600;font-size:14px;"><?php _e('Category:','ynxadmp'); ?></td> 52 <td> 53 <?php 54 $args = array( 55 'hide_empty' => 0, 56 'hierarchical' => 1, 57 ); 58 wp_dropdown_categories( $args ); 59 ?> 60 </td> 61 </tr> 62 <tr class="alternate iedit ynxadmp_page-options"> 63 <td style="padding:14px 10px;font-weight:600;font-size:14px;"><?php _e('Parent:','ynxadmp'); ?></td> 64 <td> 65 <?php 66 $arr = array( 67 'option_none_value' => 0, 68 'show_option_none' => __('none','ynxadmp') 69 ); 70 71 wp_dropdown_pages($arr); 72 ?> 73 </td> 74 </tr> 32 75 <tr class="alternate iedit"> 33 <td valign="middle" style="padding:14px 10px; "><?php _e('Author of Posts:','ynxadmp'); ?></td>76 <td valign="middle" style="padding:14px 10px;font-weight:600;font-size:14px;"><?php _e('Author of Posts:','ynxadmp'); ?></td> 34 77 <td colspan="2"> 35 <select name="author_id" >78 <select name="author_id" style="border-radius:4px;"> 36 79 <?php 37 80 $user_query = "SELECT ID, user_login, display_name, user_email FROM $wpdb->users ORDER BY ID ASC"; … … 45 88 </tr> 46 89 <tr class="iedit"> 47 <td valign="middle" style="padding:13px 10px; "><?php _e('Progress Bar:','ynxadmp'); ?></td>90 <td valign="middle" style="padding:13px 10px;font-weight:600;font-size:14px;"><?php _e('Progress Bar:','ynxadmp'); ?></td> 48 91 <td style="padding:8px 14px;" colspan="2"> 49 92 <div id="ynxadmp_progressbar" style="height:26px;width:100%;border:1px solid rgb(197, 197, 197);border-radius:4px;padding:1px;background:#fff;"><span style="position:absolute;margin:4px 0 0 8px;"></span></div> -
yonox-add-multiple-posts/trunk/yonox-add-multiple-posts.php
r1184242 r1184774 3 3 Plugin Name: Yonox Add Multiple Posts 4 4 Plugin URI: http://yonoxpc.com 5 Description: Add multiple posts by a simple ajax method.6 Version: 1. 25 Description: Add multiple posts or pages by a simple ajax method. 6 Version: 1.3 7 7 Author: Yonox 8 8 Author URI: http://yonoxpc.com … … 57 57 public function ynxadmpCreatePosts() { 58 58 59 $ nonce = $_POST['sendlocNonce'];60 if ( ! wp_verify_nonce( $ nonce, 'ynxadmp-send-secur' ) )59 $ynxadmpnonce = $_POST['sendlocNonce']; 60 if ( ! wp_verify_nonce( $ynxadmpnonce, 'ynxadmp-send-secur' ) ) 61 61 die ( __('Security Failed!','ynxadmp') ); 62 62 63 $typeEntry = $_POST['typeEntry']; 64 $statusEntry = $_POST['statusEntry']; 63 65 $ynxadmpTitle = $_POST['ynxadmpTitle']; 66 $ynxadmpCategory = $_POST['ynxadmpCategory']; 67 $ynxadmpParent = $_POST['ynxadmpParent']; 64 68 $ynxadmpAuthor = $_POST['ynxadmpAuthor']; 65 69 … … 80 84 $postTitle = trim($ynxadmpTitle); 81 85 82 if ( !empty ($postTitle)) {86 if ( $typeEntry == 'ynxadmp_type_post' ) { 83 87 $ynxadmpPost = array (); 84 88 $ynxadmpPost['post_title'] = $postTitle; 85 89 $ynxadmpPost['post_type'] = 'post'; 86 90 $ynxadmpPost['post_content'] = ''; 87 $ynxadmpPost['post_status'] = 'publish';91 $ynxadmpPost['post_status'] = $statusEntry; 88 92 $ynxadmpPost['post_author'] = $author_id; 93 $ynxadmpPost['post_category'] = array($ynxadmpCategory); 89 94 wp_insert_post($ynxadmpPost); 95 } elseif ( $typeEntry == 'ynxadmp_type_page' ) { 96 $ynxadmpPage = array (); 97 $ynxadmpPage['post_title'] = $postTitle; 98 $ynxadmpPage['post_type'] = 'page'; 99 $ynxadmpPage['post_content'] = ''; 100 $ynxadmpPage['post_status'] = $statusEntry; 101 $ynxadmpPage['post_author'] = $author_id; 102 $ynxadmpPage['post_parent'] = $ynxadmpParent; 103 wp_insert_post($ynxadmpPage); 90 104 } 91 105
Note: See TracChangeset
for help on using the changeset viewer.