Changeset 1491938
- Timestamp:
- 09/07/2016 05:48:09 PM (10 years ago)
- Location:
- listolicious/trunk
- Files:
-
- 5 edited
-
languages/listolicious-sv_SE.mo (modified) (previous)
-
languages/listolicious-sv_SE.po (modified) (3 diffs)
-
languages/listolicious.pot (modified) (3 diffs)
-
listolicious.php (modified) (18 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
listolicious/trunk/languages/listolicious-sv_SE.po
r1485192 r1491938 2 2 msgstr "" 3 3 "Project-Id-Version: Listolicious\n" 4 "POT-Creation-Date: 2016-0 8-16 15:07+0200\n"5 "PO-Revision-Date: 2016-0 8-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" 7 7 "Language-Team: \n" 8 8 "Language: sv\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 1.8. 8\n"12 "X-Generator: Poedit 1.8.9\n" 13 13 "X-Poedit-Basepath: .\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 17 17 "X-Poedit-SearchPath-0: .\n" 18 18 19 #: listolicious.php:8 7 listolicious.php:89 listolicious.php:9019 #: listolicious.php:88 listolicious.php:90 listolicious.php:91 20 20 msgid "Movies" 21 21 msgstr "Filmer" 22 22 23 #: listolicious.php:8 8 listolicious.php:10123 #: listolicious.php:89 listolicious.php:102 24 24 msgid "Movie" 25 25 msgstr "Film" 26 26 27 #: listolicious.php:9 127 #: listolicious.php:92 28 28 msgid "Movie Archives" 29 29 msgstr "Filmarkiv" 30 30 31 #: listolicious.php:9 231 #: listolicious.php:93 32 32 msgid "All Movies" 33 33 msgstr "Alla filmer" 34 34 35 #: listolicious.php:9 335 #: listolicious.php:94 36 36 msgid "Add New Movie" 37 37 msgstr "Skapa ny film" 38 38 39 #: listolicious.php:9 439 #: listolicious.php:95 40 40 msgid "New Movie" 41 41 msgstr "Ny film" 42 42 43 #: listolicious.php:9 543 #: listolicious.php:96 44 44 msgid "Edit Movie" 45 45 msgstr "Redigera film" 46 46 47 #: listolicious.php:9 647 #: listolicious.php:97 48 48 msgid "Update Movie" 49 49 msgstr "Uppdatera film" 50 50 51 #: listolicious.php:9 751 #: listolicious.php:98 52 52 msgid "View Movie" 53 53 msgstr "Visa film" 54 54 55 #: listolicious.php:9 855 #: listolicious.php:99 56 56 msgid "Search Movie" 57 57 msgstr "Sök film" 58 58 59 #: listolicious.php:10 259 #: listolicious.php:103 60 60 msgid "Movies for your list" 61 61 msgstr "Filmer i din lista" 62 62 63 #: listolicious.php:129 63 #: listolicious.php:136 listolicious.php:144 64 msgid "Lists" 65 msgstr "Listor" 66 67 #: listolicious.php:137 68 msgid "List" 69 msgstr "Lista" 70 71 #: listolicious.php:138 72 msgid "Search Lists" 73 msgstr "Sök listor" 74 75 #: listolicious.php:139 76 msgid "All Lists" 77 msgstr "Alla listor" 78 79 #: listolicious.php:140 80 msgid "Edit List" 81 msgstr "Redigera lista" 82 83 #: listolicious.php:141 84 msgid "Update List" 85 msgstr "Uppdatera lista" 86 87 #: listolicious.php:142 88 msgid "Add New List" 89 msgstr "Skapa ny lista" 90 91 #: listolicious.php:143 92 msgid "New List Name" 93 msgstr "Nytt listnamn" 94 95 #: listolicious.php:164 64 96 msgid "Details" 65 97 msgstr "Detaljer" 66 98 67 #: listolicious.php:1 47 listolicious.php:252 listolicious.php:29799 #: listolicious.php:184 listolicious.php:290 listolicious.php:335 68 100 msgid "Director" 69 101 msgstr "Regissör" 70 102 71 #: listolicious.php:1 49 listolicious.php:253 listolicious.php:300103 #: listolicious.php:186 listolicious.php:291 listolicious.php:338 72 104 msgid "Year" 73 105 msgstr "Årtal" 74 106 75 #: listolicious.php:2 51107 #: listolicious.php:289 76 108 msgid "Title" 77 109 msgstr "Titel" -
listolicious/trunk/languages/listolicious.pot
r1485192 r1491938 3 3 msgstr "" 4 4 "Project-Id-Version: Listolicious\n" 5 "POT-Creation-Date: 2016-0 8-16 15:07+0200\n"5 "POT-Creation-Date: 2016-09-03 15:33+0200\n" 6 6 "PO-Revision-Date: 2016-08-12 16:07+0200\n" 7 7 "Last-Translator: \n" … … 11 11 "Content-Type: text/plain; charset=UTF-8\n" 12 12 "Content-Transfer-Encoding: 8bit\n" 13 "X-Generator: Poedit 1.8. 8\n"13 "X-Generator: Poedit 1.8.9\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 19 19 "X-Poedit-SearchPath-1: .\n" 20 20 21 #: listolicious.php:8 7 listolicious.php:89 listolicious.php:9021 #: listolicious.php:88 listolicious.php:90 listolicious.php:91 22 22 msgid "Movies" 23 23 msgstr "" 24 24 25 #: listolicious.php:8 8 listolicious.php:10125 #: listolicious.php:89 listolicious.php:102 26 26 msgid "Movie" 27 27 msgstr "" 28 28 29 #: listolicious.php:9 129 #: listolicious.php:92 30 30 msgid "Movie Archives" 31 31 msgstr "" 32 32 33 #: listolicious.php:9 233 #: listolicious.php:93 34 34 msgid "All Movies" 35 35 msgstr "" 36 36 37 #: listolicious.php:9 337 #: listolicious.php:94 38 38 msgid "Add New Movie" 39 39 msgstr "" 40 40 41 #: listolicious.php:9 441 #: listolicious.php:95 42 42 msgid "New Movie" 43 43 msgstr "" 44 44 45 #: listolicious.php:9 545 #: listolicious.php:96 46 46 msgid "Edit Movie" 47 47 msgstr "" 48 48 49 #: listolicious.php:9 649 #: listolicious.php:97 50 50 msgid "Update Movie" 51 51 msgstr "" 52 52 53 #: listolicious.php:9 753 #: listolicious.php:98 54 54 msgid "View Movie" 55 55 msgstr "" 56 56 57 #: listolicious.php:9 857 #: listolicious.php:99 58 58 msgid "Search Movie" 59 59 msgstr "" 60 60 61 #: listolicious.php:10 261 #: listolicious.php:103 62 62 msgid "Movies for your list" 63 63 msgstr "" 64 64 65 #: listolicious.php:129 65 #: listolicious.php:136 listolicious.php:138 listolicious.php:139 66 msgid "Lists" 67 msgstr "" 68 69 #: listolicious.php:137 70 msgid "List" 71 msgstr "" 72 73 #: listolicious.php:140 74 msgid "Search Lists" 75 msgstr "" 76 77 #: listolicious.php:141 78 msgid "All Lists" 79 msgstr "" 80 81 #: listolicious.php:142 82 msgid "Edit List" 83 msgstr "" 84 85 #: listolicious.php:143 86 msgid "Update List" 87 msgstr "" 88 89 #: listolicious.php:144 90 msgid "Add New List" 91 msgstr "" 92 93 #: listolicious.php:145 94 msgid "New List Name" 95 msgstr "" 96 97 #: listolicious.php:165 66 98 msgid "Details" 67 99 msgstr "" 68 100 69 #: listolicious.php:1 47 listolicious.php:252 listolicious.php:297101 #: listolicious.php:185 listolicious.php:291 listolicious.php:336 70 102 msgid "Director" 71 103 msgstr "" 72 104 73 #: listolicious.php:1 49 listolicious.php:253 listolicious.php:300105 #: listolicious.php:187 listolicious.php:292 listolicious.php:339 74 106 msgid "Year" 75 107 msgstr "" 76 108 77 #: listolicious.php:2 51109 #: listolicious.php:290 78 110 msgid "Title" 79 111 msgstr "" -
listolicious/trunk/listolicious.php
r1485192 r1491938 3 3 Plugin Name: Listolicious 4 4 Description: The shortcode displays a movie list in the style of Mubi 5 Version: 1. 05 Version: 1.1 6 6 Author: Daniel Hånberg Alonso 7 7 Author URI: http://webbilicious.se … … 40 40 * Initiates all hooks, actions and filters. 41 41 * 42 * @since 1.0 .042 * @since 1.0 43 43 */ 44 44 public function init() { … … 50 50 51 51 add_action( 'init', array( $this, 'custom_post_type' ), 0 ); 52 add_action( 'init', array( $this, 'custom_taxonomy' ), 0 ); 52 53 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); 53 54 … … 67 68 * Adds stylesheet 68 69 * 69 * @since 1.0 .070 * @since 1.0 70 71 */ 71 72 function add_style() { … … 80 81 * need to create a custom post type. 81 82 * 82 * @since 1.0 .083 * @since 1.0 83 84 */ 84 85 function custom_post_type() { … … 98 99 'search_items' => __( 'Search Movie', 'listolicious' ), 99 100 ); 101 100 102 $args = array( 101 103 'label' => __( 'Movie', 'listolicious' ), … … 112 114 'show_in_nav_menus' => true, 113 115 'can_export' => true, 116 'taxonomies' => array( 'lists' ), 114 117 'has_archive' => true, 115 118 'exclude_from_search' => false, … … 117 120 'capability_type' => 'post', 118 121 ); 122 119 123 register_post_type( 'movies', $args ); 120 124 121 125 } 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 123 164 /** 124 165 * Adds a metabox with custom fields 125 166 * 126 * @since 1.0 .0167 * @since 1.0 127 168 */ 128 169 function add_meta_boxes(){ … … 136 177 * we need to create custom fields. 137 178 * 138 * @since 1.0 .0179 * @since 1.0 139 180 */ 140 181 function details(){ … … 157 198 * Saves/updates the new custom fields 158 199 * 159 * @since 1.0 .0200 * @since 1.0 160 201 */ 161 202 function save_details(){ … … 175 216 * 176 217 * 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 attribute178 * "orderby" you can change the list to be ordered by title.179 * Example: [listolicious orderby="title"].180 * 181 * @since 1.0 .0218 * 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 182 223 */ 183 224 function shortcode( $atts ) { … … 187 228 $count = 0; 188 229 189 $atts = shortcode_atts( array( 'orderby' => '' ), 190 $atts ); 230 $atts = shortcode_atts( 231 array( 232 'orderby' => '', 233 'list' => '', 234 ), $atts ); 191 235 192 236 $args['order'] = 'ASC'; 193 237 $args['post_type'] = 'movies'; 194 238 $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' ] ); 197 252 switch ($orderby) { 198 253 case 'title': … … 247 302 * We only want to display information in the list view which is relevant to the custom post type. 248 303 * 249 * @since 1.0 .0304 * @since 1.0 250 305 */ 251 306 function edit_columns($columns){ … … 255 310 "director" => __( 'Director', 'listolicious' ), 256 311 "year" => __( 'Year', 'listolicious' ), 312 "lists" => __( 'Lists', 'listolicious' ), 257 313 ); 258 314 return $columns; … … 262 318 * Outputs the data from our custom fields in the new list view columns 263 319 * 264 * @since 1.0 .0320 * @since 1.0 265 321 */ 266 322 function add_columns($column){ … … 276 332 echo esc_html( $custom['listo_year'][0] ); 277 333 break; 278 } 334 case "lists": 335 echo get_the_term_list($post->ID,'lists','',', ',''); 336 break; 337 } 279 338 } 280 339 … … 282 341 * Adds quickedit button for editing in list view 283 342 * 284 * @since 1.0 .0343 * @since 1.0 285 344 */ 286 345 function quickedit($column_name, $post_type) { … … 314 373 * Adds quickedit script for getting values into quickedit fields 315 374 * 316 * @since 1.0 .0375 * @since 1.0 317 376 */ 318 377 public function quickedit_script( $hook = '' ) { -
listolicious/trunk/readme.txt
r1485192 r1491938 4 4 Tags: shortcode, custom post type, list, movie 5 5 Requires at least: 4.5.3 6 Tested up to: 4. 5.37 Stable tag: 1. 06 Tested up to: 4.6 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 23 23 = Usage = 24 24 1. 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"] 25 2. 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) 28 Example: [listolicious list="favourites" orderby="title"] 28 29 29 30 = Contributors = … … 48 49 == Changelog == 49 50 50 = 1.0.0 = 51 = 1.1 = 52 53 * Created a custom taxonomy and the ability to create multiple lists. 54 55 = 1.0 = 51 56 52 57 * Initial release. … … 54 59 == Upgrade Notice == 55 60 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.