Plugin Directory

Changeset 1491938


Ignore:
Timestamp:
09/07/2016 05:48:09 PM (10 years ago)
Author:
webbilicious
Message:

Updated to tag 1.1

Location:
listolicious/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • listolicious/trunk/languages/listolicious-sv_SE.po

    r1485192 r1491938  
    22msgstr ""
    33"Project-Id-Version: Listolicious\n"
    4 "POT-Creation-Date: 2016-08-16 15:07+0200\n"
    5 "PO-Revision-Date: 2016-08-16 15:07+0200\n"
    6 "Last-Translator: \n"
     4"POT-Creation-Date: 2016-09-03 15:30+0200\n"
     5"PO-Revision-Date: 2016-09-03 15:34+0200\n"
     6"Last-Translator: Daniel Hånberg Alonso\n"
    77"Language-Team: \n"
    88"Language: sv\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.8.8\n"
     12"X-Generator: Poedit 1.8.9\n"
    1313"X-Poedit-Basepath: .\n"
    1414"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     
    1717"X-Poedit-SearchPath-0: .\n"
    1818
    19 #: listolicious.php:87 listolicious.php:89 listolicious.php:90
     19#: listolicious.php:88 listolicious.php:90 listolicious.php:91
    2020msgid "Movies"
    2121msgstr "Filmer"
    2222
    23 #: listolicious.php:88 listolicious.php:101
     23#: listolicious.php:89 listolicious.php:102
    2424msgid "Movie"
    2525msgstr "Film"
    2626
    27 #: listolicious.php:91
     27#: listolicious.php:92
    2828msgid "Movie Archives"
    2929msgstr "Filmarkiv"
    3030
    31 #: listolicious.php:92
     31#: listolicious.php:93
    3232msgid "All Movies"
    3333msgstr "Alla filmer"
    3434
    35 #: listolicious.php:93
     35#: listolicious.php:94
    3636msgid "Add New Movie"
    3737msgstr "Skapa ny film"
    3838
    39 #: listolicious.php:94
     39#: listolicious.php:95
    4040msgid "New Movie"
    4141msgstr "Ny film"
    4242
    43 #: listolicious.php:95
     43#: listolicious.php:96
    4444msgid "Edit Movie"
    4545msgstr "Redigera film"
    4646
    47 #: listolicious.php:96
     47#: listolicious.php:97
    4848msgid "Update Movie"
    4949msgstr "Uppdatera film"
    5050
    51 #: listolicious.php:97
     51#: listolicious.php:98
    5252msgid "View Movie"
    5353msgstr "Visa film"
    5454
    55 #: listolicious.php:98
     55#: listolicious.php:99
    5656msgid "Search Movie"
    5757msgstr "Sök film"
    5858
    59 #: listolicious.php:102
     59#: listolicious.php:103
    6060msgid "Movies for your list"
    6161msgstr "Filmer i din lista"
    6262
    63 #: listolicious.php:129
     63#: listolicious.php:136 listolicious.php:144
     64msgid "Lists"
     65msgstr "Listor"
     66
     67#: listolicious.php:137
     68msgid "List"
     69msgstr "Lista"
     70
     71#: listolicious.php:138
     72msgid "Search Lists"
     73msgstr "Sök listor"
     74
     75#: listolicious.php:139
     76msgid "All Lists"
     77msgstr "Alla listor"
     78
     79#: listolicious.php:140
     80msgid "Edit List"
     81msgstr "Redigera lista"
     82
     83#: listolicious.php:141
     84msgid "Update List"
     85msgstr "Uppdatera lista"
     86
     87#: listolicious.php:142
     88msgid "Add New List"
     89msgstr "Skapa ny lista"
     90
     91#: listolicious.php:143
     92msgid "New List Name"
     93msgstr "Nytt listnamn"
     94
     95#: listolicious.php:164
    6496msgid "Details"
    6597msgstr "Detaljer"
    6698
    67 #: listolicious.php:147 listolicious.php:252 listolicious.php:297
     99#: listolicious.php:184 listolicious.php:290 listolicious.php:335
    68100msgid "Director"
    69101msgstr "Regissör"
    70102
    71 #: listolicious.php:149 listolicious.php:253 listolicious.php:300
     103#: listolicious.php:186 listolicious.php:291 listolicious.php:338
    72104msgid "Year"
    73105msgstr "Årtal"
    74106
    75 #: listolicious.php:251
     107#: listolicious.php:289
    76108msgid "Title"
    77109msgstr "Titel"
  • listolicious/trunk/languages/listolicious.pot

    r1485192 r1491938  
    33msgstr ""
    44"Project-Id-Version: Listolicious\n"
    5 "POT-Creation-Date: 2016-08-16 15:07+0200\n"
     5"POT-Creation-Date: 2016-09-03 15:33+0200\n"
    66"PO-Revision-Date: 2016-08-12 16:07+0200\n"
    77"Last-Translator: \n"
     
    1111"Content-Type: text/plain; charset=UTF-8\n"
    1212"Content-Transfer-Encoding: 8bit\n"
    13 "X-Generator: Poedit 1.8.8\n"
     13"X-Generator: Poedit 1.8.9\n"
    1414"X-Poedit-Basepath: ..\n"
    1515"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     
    1919"X-Poedit-SearchPath-1: .\n"
    2020
    21 #: listolicious.php:87 listolicious.php:89 listolicious.php:90
     21#: listolicious.php:88 listolicious.php:90 listolicious.php:91
    2222msgid "Movies"
    2323msgstr ""
    2424
    25 #: listolicious.php:88 listolicious.php:101
     25#: listolicious.php:89 listolicious.php:102
    2626msgid "Movie"
    2727msgstr ""
    2828
    29 #: listolicious.php:91
     29#: listolicious.php:92
    3030msgid "Movie Archives"
    3131msgstr ""
    3232
    33 #: listolicious.php:92
     33#: listolicious.php:93
    3434msgid "All Movies"
    3535msgstr ""
    3636
    37 #: listolicious.php:93
     37#: listolicious.php:94
    3838msgid "Add New Movie"
    3939msgstr ""
    4040
    41 #: listolicious.php:94
     41#: listolicious.php:95
    4242msgid "New Movie"
    4343msgstr ""
    4444
    45 #: listolicious.php:95
     45#: listolicious.php:96
    4646msgid "Edit Movie"
    4747msgstr ""
    4848
    49 #: listolicious.php:96
     49#: listolicious.php:97
    5050msgid "Update Movie"
    5151msgstr ""
    5252
    53 #: listolicious.php:97
     53#: listolicious.php:98
    5454msgid "View Movie"
    5555msgstr ""
    5656
    57 #: listolicious.php:98
     57#: listolicious.php:99
    5858msgid "Search Movie"
    5959msgstr ""
    6060
    61 #: listolicious.php:102
     61#: listolicious.php:103
    6262msgid "Movies for your list"
    6363msgstr ""
    6464
    65 #: listolicious.php:129
     65#: listolicious.php:136 listolicious.php:138 listolicious.php:139
     66msgid "Lists"
     67msgstr ""
     68
     69#: listolicious.php:137
     70msgid "List"
     71msgstr ""
     72
     73#: listolicious.php:140
     74msgid "Search Lists"
     75msgstr ""
     76
     77#: listolicious.php:141
     78msgid "All Lists"
     79msgstr ""
     80
     81#: listolicious.php:142
     82msgid "Edit List"
     83msgstr ""
     84
     85#: listolicious.php:143
     86msgid "Update List"
     87msgstr ""
     88
     89#: listolicious.php:144
     90msgid "Add New List"
     91msgstr ""
     92
     93#: listolicious.php:145
     94msgid "New List Name"
     95msgstr ""
     96
     97#: listolicious.php:165
    6698msgid "Details"
    6799msgstr ""
    68100
    69 #: listolicious.php:147 listolicious.php:252 listolicious.php:297
     101#: listolicious.php:185 listolicious.php:291 listolicious.php:336
    70102msgid "Director"
    71103msgstr ""
    72104
    73 #: listolicious.php:149 listolicious.php:253 listolicious.php:300
     105#: listolicious.php:187 listolicious.php:292 listolicious.php:339
    74106msgid "Year"
    75107msgstr ""
    76108
    77 #: listolicious.php:251
     109#: listolicious.php:290
    78110msgid "Title"
    79111msgstr ""
  • listolicious/trunk/listolicious.php

    r1485192 r1491938  
    33Plugin Name: Listolicious
    44Description: The shortcode displays a movie list in the style of Mubi
    5 Version:     1.0
     5Version:     1.1
    66Author:      Daniel Hånberg Alonso
    77Author URI:  http://webbilicious.se
     
    4040     * Initiates all hooks, actions and filters.
    4141     *     
    42      * @since 1.0.0
     42     * @since 1.0
    4343     */
    4444    public function init() {
     
    5050
    5151        add_action( 'init', array( $this, 'custom_post_type' ), 0 );
     52        add_action( 'init', array( $this, 'custom_taxonomy' ), 0 );
    5253        add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
    5354
     
    6768     * Adds stylesheet
    6869     *   
    69      * @since 1.0.0
     70     * @since 1.0
    7071     */
    7172    function add_style() {
     
    8081     * need to create a custom post type.
    8182     *
    82      * @since 1.0.0
     83     * @since 1.0
    8384     */
    8485    function custom_post_type() {
     
    9899            'search_items'          => __( 'Search Movie', 'listolicious' ),
    99100        );
     101
    100102        $args = array(
    101103            'label'                 => __( 'Movie', 'listolicious' ),
     
    112114            'show_in_nav_menus'     => true,
    113115            'can_export'            => true,
     116            'taxonomies'            => array( 'lists' ),
    114117            'has_archive'           => true,       
    115118            'exclude_from_search'   => false,
     
    117120            'capability_type'       => 'post',
    118121        );
     122
    119123        register_post_type( 'movies', $args );
    120124
    121125    }
    122    
     126
     127    /**
     128     * Creates the taxonomy "lists"
     129     *
     130     * As we want to be able to create multiple lists, we need a custom taxonomy for this.
     131     *
     132     * @since 1.1
     133     */
     134    function custom_taxonomy() {
     135
     136        $labels = array(
     137            'name'              => __( 'Lists', 'listolicious' ),
     138            'singular_name'     => __( 'List', 'listolicious' ),
     139            'menu_name'         => __( 'Lists', 'listolicious' ),
     140            'name_admin_bar'    => __( 'Lists', 'listolicious' ),           
     141            'search_items'      => __( 'Search Lists', 'listolicious' ),
     142            'all_items'         => __( 'All Lists', 'listolicious' ),
     143            'edit_item'         => __( 'Edit List', 'listolicious' ),
     144            'update_item'       => __( 'Update List', 'listolicious' ),
     145            'add_new_item'      => __( 'Add New List', 'listolicious' ),
     146            'new_item_name'     => __( 'New List Name', 'listolicious' ),
     147        );
     148
     149        $args = array(
     150            'hierarchical'          => false,
     151            'labels'                => $labels,
     152            'public'                => true,
     153            'show_ui'               => true,
     154            'show_admin_column'     => true,
     155            'query_var'             => true,
     156            'publicly_queryable'    => true,
     157            'rewrite'               => array( 'slug' => 'list' ),
     158        );
     159
     160        register_taxonomy( 'lists', 'movies', $args );
     161
     162    }   
     163
    123164    /**
    124165     * Adds a metabox with custom fields
    125166     *
    126      * @since 1.0.0
     167     * @since 1.0
    127168     */
    128169    function add_meta_boxes(){
     
    136177     * we need to create custom fields.
    137178     *
    138      * @since 1.0.0
     179     * @since 1.0
    139180     */
    140181    function details(){
     
    157198     * Saves/updates the new custom fields
    158199     *
    159      * @since 1.0.0
     200     * @since 1.0
    160201     */
    161202    function save_details(){
     
    175216     *
    176217     * The plugin creates the shortcode [listolicious] for displaying the movie list.
    177      * As a default the lists is ordered by the custom field "year". With the attribute
    178      * "orderby" you can change the list to be ordered by title.
    179      * Example: [listolicious orderby="title"].
    180      *
    181      * @since 1.0.0
     218     * The shortcode comes with two attributes, "list" and "orderby".
     219     * As a default the lists is ordered by the custom field "year" and shows all movies.
     220     * Example: [listolicious list="favourites" orderby="title"].
     221     *
     222     * @since 1.0
    182223     */
    183224    function shortcode( $atts ) {
     
    187228        $count = 0;     
    188229       
    189         $atts = shortcode_atts( array( 'orderby' => '' ),
    190                                         $atts );       
     230        $atts = shortcode_atts(
     231            array(
     232                'orderby' => '',
     233                'list' => '',
     234            ), $atts );     
    191235       
    192236        $args['order'] = 'ASC';
    193237        $args['post_type'] = 'movies';
    194238        $args['posts_per_page'] = -1;
    195 
    196         $orderby = $atts[ 'orderby' ];
     239           
     240        $list = sanitize_text_field( $atts[ 'list' ] );
     241        if( $list ) {
     242            $args['tax_query'] = array(
     243                array(
     244                    'taxonomy' => 'lists',
     245                    'field'    => 'slug',
     246                    'terms'    => $list,
     247                ),
     248            );
     249        }
     250
     251        $orderby = sanitize_text_field( $atts[ 'orderby' ] );
    197252        switch ($orderby) {
    198253            case 'title':
     
    247302     * We only want to display information in the list view which is relevant to the custom post type.
    248303     *
    249      * @since 1.0.0
     304     * @since 1.0
    250305     */
    251306    function edit_columns($columns){
     
    255310            "director" => __( 'Director', 'listolicious' ),
    256311            "year" => __( 'Year', 'listolicious' ),
     312            "lists" => __( 'Lists', 'listolicious' ),
    257313        );
    258314        return $columns;
     
    262318     * Outputs the data from our custom fields in the new list view columns
    263319     *
    264      * @since 1.0.0
     320     * @since 1.0
    265321     */
    266322    function add_columns($column){
     
    276332            echo esc_html( $custom['listo_year'][0] );
    277333            break;         
    278         }
     334        case "lists":
     335            echo get_the_term_list($post->ID,'lists','',', ','');
     336            break;
     337        }
    279338    }
    280339
     
    282341     * Adds quickedit button for editing in list view
    283342     *
    284      * @since 1.0.0
     343     * @since 1.0
    285344     */
    286345    function quickedit($column_name, $post_type) { 
     
    314373     * Adds quickedit script for getting values into quickedit fields
    315374     *
    316      * @since 1.0.0
     375     * @since 1.0
    317376     */
    318377    public function quickedit_script( $hook = '' ) {
  • listolicious/trunk/readme.txt

    r1485192 r1491938  
    44Tags: shortcode, custom post type, list, movie
    55Requires at least: 4.5.3
    6 Tested up to: 4.5.3
    7 Stable tag: 1.0
     6Tested up to: 4.6
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2323= Usage =
    24241. Insert the shortcode [listolicious] in the content of the page/post.
    25 2. You can set one option:
    26    orderby: title or year (default: year) 
    27    Example: [listolicious orderby="title"] 
     252. You can set two options:
     26    list:       slug of a list you've created (default: shows all movies)
     27    orderby:    title or year (default: year) 
     28Example:    [listolicious list="favourites" orderby="title"] 
    2829
    2930= Contributors =
     
    4849== Changelog ==
    4950
    50 = 1.0.0 =
     51= 1.1 =
     52
     53* Created a custom taxonomy and the ability to create multiple lists.
     54
     55= 1.0 =
    5156
    5257* Initial release.
     
    5459== Upgrade Notice ==
    5560
    56 = 1.1.0 =
    57 
    58 Support categories and that way the ability to create multiple lists.
Note: See TracChangeset for help on using the changeset viewer.