Plugin Directory

Changeset 1184774


Ignore:
Timestamp:
06/20/2015 03:01:19 PM (11 years ago)
Author:
yonox
Message:

Create new version

Location:
yonox-add-multiple-posts/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • yonox-add-multiple-posts/trunk/Readme.txt

    r1184242 r1184774  
    44Requires at least: 4.0
    55Tested up to: 4.0
    6 Stable tag: stable
     6Stable tag: 1.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
    10 A WordPress plugin to add multiple posts by a simple ajax method.
     10Yonox Add Multiple Posts enables a WordPress user to quickly add multiple posts or pages at once.
    1111
    1212== Description ==
    1313
    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
     21This 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.
    1525
    1626== Installation ==
    1727
    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.
     281. Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation.
     292. Activate the Plugin from Plugins page.
     303. Go to the new admin menu created.
     314. That's all folks. Enjoy.
    2132
    2233== Screenshots ==
     
    26373. Process finished.
    27384. 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  
    4646                action          : 'addposts_ajaxfunc',
    4747                sendlocNonce    : YnxadmpAdminAjax.ynxadmpNonce,
     48                typeEntry       : $('#ynxadmp_post_type').val(),
    4849                ynxadmpTitle    : this,
     50                ynxadmpCategory : $('#cat[name=cat]').val(),
     51                ynxadmpParent   : $('#page_id[name=page_id]').val(),
     52                statusEntry     : $('#ynxadmp_post_status').val(),
    4953                ynxadmpAuthor   : $('select[name=author_id] option:selected').val()
    5054            };
     
    6468    });
    6569   
     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   
    6688    $('#ynxadmp_progressbar').on('progressbarcomplete', function() {
    6789        $('#btn_ynxadmp_create_posts').fadeOut(1000);
     
    7597    $('#btn_ynxadmp_reset_form').click(function(event){
    7698        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);
    82100    });
    83101       
  • yonox-add-multiple-posts/trunk/lang/ynxadmp-es_ES.po

    r1184180 r1184774  
    22msgstr ""
    33"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"
    66"Last-Translator: \n"
    7 "Language-Team: \n"
     7"Language-Team: Yonox <yonox2008@gmail.com>\n"
    88"Language: es_ES\n"
    99"MIME-Version: 1.0\n"
     
    3636msgstr "Configuración"
    3737
    38 #: ynxadmp-functions.php:26
     38#: ynxadmp-functions.php:25
     39msgid "Post Type:"
     40msgstr "Tipo de entrada:"
     41
     42#: ynxadmp-functions.php:28
     43msgid "Post"
     44msgstr "Entrada"
     45
     46#: ynxadmp-functions.php:29
     47msgid "Page"
     48msgstr "Página"
     49
     50#: ynxadmp-functions.php:34
     51msgid "Status:"
     52msgstr "Estado:"
     53
     54#: ynxadmp-functions.php:37
     55msgid "Published"
     56msgstr "Publicado"
     57
     58#: ynxadmp-functions.php:38
     59msgid "Pending Review"
     60msgstr "Pendiente de revisión"
     61
     62#: ynxadmp-functions.php:39
     63msgid "Draft"
     64msgstr "Borrador"
     65
     66#: ynxadmp-functions.php:44
    3967msgid "Posts Titles:"
    40 msgstr "Títulos de las entradas:"
     68msgstr "Títulos de Entradas:"
    4169
    42 #: ynxadmp-functions.php:27
     70#: ynxadmp-functions.php:45
    4371msgid "One post on each line"
    4472msgstr "Una entrada por cada línea"
    4573
    46 #: ynxadmp-functions.php:33
     74#: ynxadmp-functions.php:51
     75msgid "Category:"
     76msgstr "Categoría:"
     77
     78#: ynxadmp-functions.php:63
     79msgid "Parent:"
     80msgstr "Nivel superior:"
     81
     82#: ynxadmp-functions.php:68
     83msgid "none"
     84msgstr "ninguno"
     85
     86#: ynxadmp-functions.php:76
    4787msgid "Author of Posts:"
    4888msgstr "Autor de las entradas:"
    4989
    50 #: ynxadmp-functions.php:47
     90#: ynxadmp-functions.php:90
    5191msgid "Progress Bar:"
    5292msgstr "Barra de progreso:"
    5393
    54 #: ynxadmp-functions.php:56
     94#: ynxadmp-functions.php:99
    5595msgid "Create Multiple Posts"
    56 msgstr "Crear múltiples entradas"
     96msgstr "Crear Múltiples Entradas"
    5797
    58 #: ynxadmp-functions.php:57
     98#: ynxadmp-functions.php:100
    5999msgid "Reset Form"
    60100msgstr "Reiniciar Formulario"
  • yonox-add-multiple-posts/trunk/lang/ynxadmp-ro_RO.po

    r1184180 r1184774  
    22msgstr ""
    33"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"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    2323#: ynxadmp-functions.php:13
    2424msgid "Process finished OK."
    25 msgstr "Proces terminat OK."
     25msgstr "Proces încheiat cu succes."
    2626
    2727#: ynxadmp-functions.php:14
    2828msgid "No titles found."
    29 msgstr "Un s-au găsit titluri."
     29msgstr "Nu s-au găsit titluri."
    3030
    3131#: ynxadmp-functions.php:19
     
    3737msgstr "Setare"
    3838
    39 #: ynxadmp-functions.php:26
     39#: ynxadmp-functions.php:25
     40msgid "Post Type:"
     41msgstr "Tip Post:"
     42
     43#: ynxadmp-functions.php:28
     44msgid "Post"
     45msgstr "Articol"
     46
     47#: ynxadmp-functions.php:29
     48msgid "Page"
     49msgstr "Pagină"
     50
     51#: ynxadmp-functions.php:34
     52msgid "Status:"
     53msgstr "Stare:"
     54
     55#: ynxadmp-functions.php:37
     56msgid "Published"
     57msgstr "Publicat"
     58
     59#: ynxadmp-functions.php:38
     60msgid "Pending Review"
     61msgstr "Așteaptă aprobare"
     62
     63#: ynxadmp-functions.php:39
     64msgid "Draft"
     65msgstr "Schiţă"
     66
     67#: ynxadmp-functions.php:44
    4068msgid "Posts Titles:"
    41 msgstr "Titluri postări:"
     69msgstr "Titluri Postări:"
    4270
    43 #: ynxadmp-functions.php:27
     71#: ynxadmp-functions.php:45
    4472msgid "One post on each line"
    4573msgstr "Un post pe fiecare linie"
    4674
    47 #: ynxadmp-functions.php:33
     75#: ynxadmp-functions.php:51
     76msgid "Category:"
     77msgstr "Categoria:"
     78
     79#: ynxadmp-functions.php:63
     80msgid "Parent:"
     81msgstr "Nivel superior:"
     82
     83#: ynxadmp-functions.php:68
     84msgid "none"
     85msgstr "niciunul"
     86
     87#: ynxadmp-functions.php:76
    4888msgid "Author of Posts:"
    4989msgstr "Autor post-uri:"
    5090
    51 #: ynxadmp-functions.php:47
     91#: ynxadmp-functions.php:90
    5292msgid "Progress Bar:"
    5393msgstr "Bară de progres:"
    5494
    55 #: ynxadmp-functions.php:56
     95#: ynxadmp-functions.php:99
    5696msgid "Create Multiple Posts"
    57 msgstr "Crează multiple postări"
     97msgstr "Crează Multiple Postări"
    5898
    59 #: ynxadmp-functions.php:57
     99#: ynxadmp-functions.php:100
    60100msgid "Reset Form"
    61101msgstr "Resetare Formular"
     
    63103#: yonox-add-multiple-posts.php:35
    64104msgid "Yonox Add Multiple Posts"
    65 msgstr "Yonox Add Multiple Posts"
     105msgstr "Yonox Adăugare Multiple Posturi"
    66106
    67107#: yonox-add-multiple-posts.php:35
  • yonox-add-multiple-posts/trunk/ynxadmp-functions.php

    r1184180 r1184774  
    1717    <thead>
    1818        <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>
    2121        </tr>
    2222    </thead>
    2323    <tbody>
    24         <input type="hidden" name="ynxadmp_createpost_input" value="post" />
    2524        <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 />
    2745            <small><?php _e('One post on each line','ynxadmp'); ?></small></td>
    2846            <td style="padding:8px 12px;">
     
    3048            </td>
    3149        </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>
    3275        <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>
    3477            <td colspan="2">
    35                 <select name="author_id">
     78                <select name="author_id" style="border-radius:4px;">
    3679                <?php
    3780                $user_query = "SELECT ID, user_login, display_name, user_email FROM $wpdb->users ORDER BY ID ASC";
     
    4588        </tr>
    4689        <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>
    4891            <td style="padding:8px 14px;" colspan="2">
    4992                <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  
    33Plugin Name: Yonox Add Multiple Posts
    44Plugin URI: http://yonoxpc.com
    5 Description: Add multiple posts by a simple ajax method.
    6 Version: 1.2
     5Description: Add multiple posts or pages by a simple ajax method.
     6Version: 1.3
    77Author: Yonox
    88Author URI: http://yonoxpc.com
     
    5757    public function ynxadmpCreatePosts() {
    5858
    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' ) )
    6161            die ( __('Security Failed!','ynxadmp') );
    6262
     63        $typeEntry = $_POST['typeEntry'];
     64        $statusEntry = $_POST['statusEntry'];
    6365        $ynxadmpTitle = $_POST['ynxadmpTitle'];
     66        $ynxadmpCategory = $_POST['ynxadmpCategory'];
     67        $ynxadmpParent = $_POST['ynxadmpParent'];
    6468        $ynxadmpAuthor = $_POST['ynxadmpAuthor'];
    6569       
     
    8084        $postTitle = trim($ynxadmpTitle);
    8185
    82         if (!empty ($postTitle)) {
     86        if ( $typeEntry == 'ynxadmp_type_post' ) {
    8387            $ynxadmpPost = array ();
    8488            $ynxadmpPost['post_title'] = $postTitle;
    8589            $ynxadmpPost['post_type'] = 'post';
    8690            $ynxadmpPost['post_content'] = '';
    87             $ynxadmpPost['post_status'] = 'publish';
     91            $ynxadmpPost['post_status'] = $statusEntry;
    8892            $ynxadmpPost['post_author'] = $author_id;
     93            $ynxadmpPost['post_category'] = array($ynxadmpCategory);
    8994            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);
    90104        }
    91105
Note: See TracChangeset for help on using the changeset viewer.