Changeset 1828007
- Timestamp:
- 02/23/2018 08:12:26 PM (8 years ago)
- Location:
- wp-upcoming-releases/trunk
- Files:
-
- 9 edited
-
README.txt (modified) (3 diffs)
-
admin/releases-cpt.php (modified) (1 diff)
-
admin/releases-metabox.php (modified) (3 diffs)
-
admin/releases-taxonomy.php (modified) (1 diff)
-
admin/releases-widget.php (modified) (1 diff)
-
languages/wp-upcoming-releases-pt_BR.mo (modified) (previous)
-
languages/wp-upcoming-releases-pt_BR.po (modified) (4 diffs)
-
uninstall.php (modified) (1 diff)
-
wp-upcoming-releases.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-upcoming-releases/trunk/README.txt
r835527 r1828007 1 1 === WP Upcoming Releases === 2 2 Contributors: henriquesilverio 3 Tags: custom post type, posts, widget, sidebar, admin, releases, games, music3 Tags: upcoming releases, coming soon, movies, events, games, widget, custom post type 4 4 Requires at least: 3.8 5 5 Tested up to: 3.8 6 Stable tag: 1.0.0 6 Requires PHP: 5.6 7 Stable tag: 1.2.0 7 8 License: GPLv2 or later 8 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 Donate link: https://pag.ae/bhdkncn 9 11 10 Display a widget with a list of upcoming releases of games, films, music albums and what you want. Easy management with custom post types.12 Show a list of upcoming releases: movies, games, events or any other thing your needs. Easy management with post type and categories. 11 13 12 14 == Description == 13 15 14 Manage and display a list with upcoming releases of games, books, films, music albums and what you want. 16 Create a dynamic widget to show a list of upcoming releases: movies, games, events, musics, or any other thing your creative ideas needs. 15 17 16 Easy management /configuration with custom post types and widget.18 Easy management of all content with custom post types and categories. 17 19 18 = Contribut e=20 = Contributing = 19 21 20 You can contribute to the source code and/or request new features for the plugin in our [Github repository](https://github.com/HenriqueSilverio/wp-upcoming-releases). 22 You can contribute with this plugin development by: 23 24 - Reporting issues [here](https://github.com/HenriqueSilverio/wp-upcoming-releases/issues). 25 - Solving bugs, with [pull requests](https://github.com/HenriqueSilverio/wp-upcoming-releases/pulls). 26 - [Donating](https://pag.ae/bhdkncn) **any amount** to help me drink a coffee. 27 28 ## Support 29 30 Have any questions about using the plugin? You're welcome. 31 32 Just follow these simple steps: 33 34 - Carefully read all the documentation. 35 - Search topics on our [support forum](https://wordpress.org/support/plugin/wp-upcoming-releases), maybe someone else already have answered your questions. 36 37 If after carefully following the steps above, your questions/problems are not solved, then you should **open a new topic** on our [support forum](https://wordpress.org/support/plugin/wp-upcoming-releases). 38 39 All support requests out of the forum, will be **not answered**. 21 40 22 41 == Installation == … … 24 43 This section describes how to install the plugin and get it working. 25 44 26 ** Obs:** Your theme needs a dynamic sidebar for this plugin to work.45 **Note:** Your theme will need a [dynamic sidebar](https://codex.wordpress.org/Function_Reference/dynamic_sidebar) to display recorded items. 27 46 28 = Using The WordPress Dashboard =47 = Install searching in the WordPress dashboard = 29 48 30 1. Navigate to the 'Add New' in the plugins dashboard49 1. Navigate to the 'Add New' in the Plugins menu 31 50 2. Search for 'wp upcoming releases' 32 51 3. Click 'Install Now' 33 4. Activate the plugin on the Plugin dashboard52 4. When download finishes, click 'Activate' 34 53 35 = Uploading in WordPress Dashboard =54 = Install uploading plugin files in WordPress dashboard = 36 55 37 1. Navigate to the 'Add New' in the plugins dashboard38 2. Navigate to the 'Upload' area56 1. Navigate to the 'Add New' in the 'Plugins' menu 57 2. Click 'Upload Plugin' button 39 58 3. Select `wp-upcoming-releases.zip` from your computer 40 59 4. Click 'Install Now' 41 5. Activate the plugin in the Plugin dashboard60 5. Activate the plugin in the 'Installed Plugins' page 42 61 43 = Using FTP =62 = Install using FTP = 44 63 45 64 1. Download `wp-upcoming-releases.zip` 46 65 2. Extract the `wp-upcoming-releases` directory to your computer 47 3. Upload the `wp-upcoming-releases` directory to the `/wp-content/plugins/` directory48 4. Activate the plugin in the Plugin dashboard66 3. Upload the `wp-upcoming-releases` directory to the your server `/wp-content/plugins/` 67 4. Activate the plugin in the 'Installed Plugins' page 49 68 50 = Add Widget=69 = Add the widget into your dynamic sidebar = 51 70 52 1. Go to Appearance -> Widgets53 2. Add the "Next Releases" on a widgetarea of your theme.71 1. Go to 'Appearance' -> 'Widgets' 72 2. Add the 'Upcoming Releases' widget on any available area of your theme. 54 73 55 74 == Frequently Asked Questions == … … 57 76 = What is the plugin license? = 58 77 59 This plugin is released under a GPLlicense.78 This plugin is released under GPLv2 (or later) license. 60 79 61 80 == Screenshots == 62 81 63 1. Add new release.64 2. List all releases.65 3. List/Add categories.66 4. Releases Widget.67 5. Display in Front-End.82 1. Front-End display of Upcoming Releases 83 2. Front-End display "not found" message 84 3. Back-End widget configurations 85 4. Back-End listing recorded items 86 5. Back-End editing a item 68 87 69 88 == Changelog == 70 89 71 = 1.0.0 = 90 = 1.2.0 2018-02-23 = 91 92 - Proper use of hooks to all plugin functions. 93 - Proper check values on metabox and widget fields. 94 - Widget name updated to be more consistent with plugin name. 95 - Added `.editorconfig`, to improve code consistency in the code base. 96 - New "not found" message. More human friendly and with a cool design. 97 - Template structure to display widget in Front-End, revised and improved. 98 - Refactor `uninstall.php`. Now attached images are not removed from media library. 99 - All CSS classes rewritten and documented, to allow much more flexible customizations. 100 - Refactor, fixes in `has_wpur_widget::form()` method and extract HTML to a template file. 101 102 = 1.0.0 - 2014-01-09 = 103 72 104 * Initial version. 105 106 == Upgrade Notice == 107 108 = 1.2.0 2018-02-23 = 109 110 - Since of the plugin initial release, PHP and WordPress evolved a lot. So there's good optimizations, wich would be nice to get. -
wp-upcoming-releases/trunk/admin/releases-cpt.php
r835527 r1828007 1 1 <?php 2 2 3 function has_wpur_register_post_type() { 3 if( false === post_type_exists( 'has_releases' ) ) { 4 $labels = array( 5 'name' => __( 'Releases', 'wp-upcoming-releases' ), 6 'singular_name' => __( 'Release', 'wp-upcoming-releases' ), 7 'menu_name' => __( 'Releases', 'wp-upcoming-releases' ), 8 'all_items' => __( 'All Releases', 'wp-upcoming-releases' ), 9 'add_new' => __( 'New Release', 'wp-upcoming-releases' ), 10 'add_new_item' => __( 'New Release', 'wp-upcoming-releases' ), 11 'edit_item' => __( 'Edit Release', 'wp-upcoming-releases' ), 12 'new_item' => __( 'New Release', 'wp-upcoming-releases' ), 13 'view_item' => __( 'View Release', 'wp-upcoming-releases' ), 14 'search_items' => __( 'Search Release', 'wp-upcoming-releases' ), 15 'not_found' => __( 'Not found release', 'wp-upcoming-releases' ), 16 'not_found_in_trash' => __( 'Not found releases in trash', 'wp-upcoming-releases' ) 17 ); 18 19 $args = array( 20 'labels' => $labels, 21 'description' => __( 'Register releases.', 'wp-upcoming-releases' ), 22 'public' => true, 23 'menu_icon' => 'dashicons-list-view', 24 'supports' => array( 25 'title', 26 'thumbnail' 27 ), 28 'rewrite' => array( 29 'slug' => 'releases', 30 'with_front' => true 31 ) 32 ); 4 $labels = array( 5 'name' => __( 'Releases', 'wp-upcoming-releases' ), 6 'singular_name' => __( 'Release', 'wp-upcoming-releases' ), 7 'menu_name' => __( 'Releases', 'wp-upcoming-releases' ), 8 'all_items' => __( 'All Releases', 'wp-upcoming-releases' ), 9 'add_new' => __( 'New Release', 'wp-upcoming-releases' ), 10 'add_new_item' => __( 'New Release', 'wp-upcoming-releases' ), 11 'edit_item' => __( 'Edit Release', 'wp-upcoming-releases' ), 12 'new_item' => __( 'New Release', 'wp-upcoming-releases' ), 13 'view_item' => __( 'View Release', 'wp-upcoming-releases' ), 14 'search_items' => __( 'Search Release', 'wp-upcoming-releases' ), 15 'not_found' => __( 'Not found release', 'wp-upcoming-releases' ), 16 'not_found_in_trash' => __( 'Not found releases in trash', 'wp-upcoming-releases' ) 17 ); 33 18 34 register_post_type( 'has_releases', $args ); 35 } 19 $args = array( 20 'labels' => $labels, 21 'description' => __( 'Register releases.', 'wp-upcoming-releases' ), 22 'public' => true, 23 'menu_icon' => 'dashicons-list-view', 24 'supports' => array( 'title', 'thumbnail' ), 25 'rewrite' => array( 'slug' => 'releases', 'with_front' => true ) 26 ); 27 28 register_post_type( 'has_releases', $args ); 36 29 } 37 30 -
wp-upcoming-releases/trunk/admin/releases-metabox.php
r835527 r1828007 4 4 */ 5 5 function has_wpur_register_metabox() { 6 add_meta_box(7 'has-wpur-metabox',8 __( 'Additional informations', 'wp-upcoming-releases' ),9 'has_wpur_metabox_render',10 'has_releases',11 'normal',12 'high'13 );6 add_meta_box( 7 'has-wpur-metabox', 8 __( 'Additional informations', 'wp-upcoming-releases' ), 9 'has_wpur_metabox_render', 10 'has_releases', 11 'normal', 12 'high' 13 ); 14 14 } 15 15 … … 17 17 * Display 18 18 */ 19 function has_wpur_metabox_render( $post ) { 20 $values = get_post_custom( $post->ID );21 $classification =( $values['has_wpur_classification'] ) ? esc_attr( $values['has_wpur_classification'][0] ) : '';22 $release_date = ( $values['has_wpur_release_date'] )? esc_attr( $values['has_wpur_release_date'][0] ) : '';19 function has_wpur_metabox_render( $post ) { 20 $values = get_post_custom( $post->ID ); 21 $classification = isset( $values['has_wpur_classification'] ) ? esc_attr( $values['has_wpur_classification'][0] ) : ''; 22 $release_date = isset( $values['has_wpur_release_date'] ) ? esc_attr( $values['has_wpur_release_date'][0] ) : ''; 23 23 24 wp_nonce_field( 'has_wpur_metabox_nonce', 'has_wpur_nonce' );24 wp_nonce_field( 'has_wpur_metabox_nonce', 'has_wpur_nonce' ); 25 25 ?> 26 <table class="form-table">27 <tr valign="top">28 <th scope="row">29 <label for="has_wpur_classification">30 <?php _e( 'Age Rating:', 'wp-upcoming-releases' ); ?>31 </label>32 </th>33 <td>34 <input type="text"35 id="has_wpur_classification"36 name="has_wpur_classification"37 size="35"38 value="<?php echo $classification; ?>">39 </td>40 </tr>26 <table class="form-table"> 27 <tr valign="top"> 28 <th scope="row"> 29 <label for="has_wpur_classification"> 30 <?php _e( 'Age Rating:', 'wp-upcoming-releases' ); ?> 31 </label> 32 </th> 33 <td> 34 <input type="text" 35 id="has_wpur_classification" 36 name="has_wpur_classification" 37 size="35" 38 value="<?php echo $classification; ?>"> 39 </td> 40 </tr> 41 41 42 <tr valign="top">43 <th scope="row">44 <label for="has_wpur_release_date">45 <?php _e( 'Release date:', 'wp-upcoming-releases' ); ?>46 </label>47 </th>48 <td>49 <input type="text"50 id="has_wpur_release_date"51 name="has_wpur_release_date"52 size="35"53 value="<?php echo $release_date; ?>">54 </td>55 </tr>56 </table>42 <tr valign="top"> 43 <th scope="row"> 44 <label for="has_wpur_release_date"> 45 <?php _e( 'Release date:', 'wp-upcoming-releases' ); ?> 46 </label> 47 </th> 48 <td> 49 <input type="text" 50 id="has_wpur_release_date" 51 name="has_wpur_release_date" 52 size="35" 53 value="<?php echo $release_date; ?>"> 54 </td> 55 </tr> 56 </table> 57 57 <?php } 58 58 … … 61 61 */ 62 62 function has_wpur_metabox_save( $post_id ) { 63 if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {64 return;65 }63 if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { 64 return; 65 } 66 66 67 if( false == isset( $_POST['has_wpur_nonce'] ) || false == wp_verify_nonce( $_POST['has_wpur_nonce'], 'has_wpur_metabox_nonce' ) ) {68 return;69 }67 if( false == isset( $_POST['has_wpur_nonce'] ) || false == wp_verify_nonce( $_POST['has_wpur_nonce'], 'has_wpur_metabox_nonce' ) ) { 68 return; 69 } 70 70 71 if( false == current_user_can( 'edit_post' ) ) {72 return;73 }71 if( false == current_user_can( 'edit_post' ) ) { 72 return; 73 } 74 74 75 if( isset( $_POST['has_wpur_classification'] ) ) {76 update_post_meta( $post_id, 'has_wpur_classification', esc_attr( $_POST['has_wpur_classification'] ) );77 }75 if( isset( $_POST['has_wpur_classification'] ) ) { 76 update_post_meta( $post_id, 'has_wpur_classification', esc_attr( $_POST['has_wpur_classification'] ) ); 77 } 78 78 79 if( isset( $_POST['has_wpur_release_date'] ) ) {80 update_post_meta( $post_id, 'has_wpur_release_date', esc_attr( $_POST['has_wpur_release_date'] ) );81 }79 if( isset( $_POST['has_wpur_release_date'] ) ) { 80 update_post_meta( $post_id, 'has_wpur_release_date', esc_attr( $_POST['has_wpur_release_date'] ) ); 81 } 82 82 } 83 83 -
wp-upcoming-releases/trunk/admin/releases-taxonomy.php
r835527 r1828007 1 1 <?php 2 2 3 function has_wpur_register_taxonomy() { 3 if( false == taxonomy_exists( 'has_wpur_category' ) ) { 4 $args = array( 5 'hierarchical' => false, 6 'label' => __( 'Categories', 'wp-upcoming-releases' ), 7 'query_var' => 'category', 8 'rewrite' => array( 'slug' => 'category' ), 9 'show_admin_column' => true 10 ); 4 $args = array( 5 'hierarchical' => false, 6 'label' => __( 'Categories', 'wp-upcoming-releases' ), 7 'query_var' => 'category', 8 'rewrite' => array( 'slug' => 'category' ), 9 'show_admin_column' => true 10 ); 11 11 12 register_taxonomy( 'has_wpur_category', 'has_releases', $args ); 13 } 12 register_taxonomy( 'has_wpur_category', 'has_releases', $args ); 14 13 } 15 14 -
wp-upcoming-releases/trunk/admin/releases-widget.php
r835527 r1828007 4 4 */ 5 5 class has_wpur_widget extends WP_Widget { 6 /**7 * Register widget with WordPress.8 */9 function __construct() {10 $widget_args = array(11 'classname' => 'has_wpur_widget',12 'description' => __( 'Displays a list of your upcoming releases.', 'wp-upcoming-releases' )13 );6 /** 7 * Register widget with WordPress. 8 */ 9 function __construct() { 10 $widget_args = array( 11 'classname' => 'has_wpur_widget', 12 'description' => __( 'Displays a list of your upcoming releases.', 'wp-upcoming-releases' ) 13 ); 14 14 15 parent::__construct(16 'has_wpur_widget',17 __( 'NextReleases', 'wp-upcoming-releases' ),18 $widget_args19 );20 }15 parent::__construct( 16 'has_wpur_widget', 17 __( 'Upcoming Releases', 'wp-upcoming-releases' ), 18 $widget_args 19 ); 20 } 21 21 22 /** 23 * Back-end widget form. 24 * 25 * @see WP_Widget::form() 26 * 27 * @param array $instance Previously saved values from database. 28 */ 29 function form( $instance ) { 30 $defaults = array( 31 'title' => __( 'Next Releases', 'wp-upcoming-releases' ), 32 'show_releases' => 4 33 ); 22 /** 23 * Back-End widget form 24 * 25 * A form with configurable options to control how widget is displayed. 26 * 27 * @see WP_Widget::form() 28 * 29 * @param array $instance Previously saved values from database. 30 */ 31 function form( $instance ) { 32 $defaults = array( 33 'title' => __( 'Upcoming Releases', 'wp-upcoming-releases' ), 34 'show_releases' => 4 35 ); 34 36 35 $instance = wp_parse_args( (array) $instance, $defaults );37 $instance = wp_parse_args( (array) $instance, $defaults ); 36 38 37 $title = $instance['title'];38 $show_releases = $instance['show_releases'];39 ?> 39 $title = sanitize_text_field( $instance['title'] ); 40 $perPage = (int) sanitize_text_field( $instance['show_releases'] ); 41 $showLabels = (int) sanitize_text_field( $instance['show_labels'] ); 40 42 41 <p> 42 <label for="<?php echo $this->get_field_id( 'show_releases' ); ?>"> 43 <?php _e( 'Title:', 'wp-upcoming-releases' ); ?> 44 </label> 45 <input type="text" 46 class="widefat" 47 name="<?php echo $this->get_field_name( 'title' ); ?>" 48 id="<?php echo $this->get_field_id( 'show_releases' ); ?>" 49 value="<?php echo esc_attr( $title ); ?>"> 50 </p> 43 $data = array( 44 'title' => array( 45 'id' => $this->get_field_id( 'title' ), 46 'name' => $this->get_field_name( 'title' ), 47 'value' => $title 48 ), 51 49 52 <p> 53 <label for="<?php echo $this->get_field_id( 'show_releases' ); ?>"> 54 <?php _e( 'Number of releases to show:', 'wp-upcoming-releases' ); ?> 55 </label> 56 <input type="text" 57 size="2" 58 maxlength="2" 59 name="<?php echo $this->get_field_name( 'show_releases' ); ?>" 60 id="<?php echo $this->get_field_id( 'show_releases' ); ?>" 61 value="<?php echo esc_attr( $show_releases ); ?>"> 62 </p> 50 'perPage' => array( 51 'id' => $this->get_field_id( 'show_releases' ), 52 'name' => $this->get_field_name( 'show_releases' ), 53 'value' => $perPage 54 ), 63 55 64 <?php 65 } 56 'showLabels' => array( 57 'idNo' => $this->get_field_id( 'show_labels_no' ), 58 'idYes' => $this->get_field_id( 'show_labels_yes' ), 59 'name' => $this->get_field_name( 'show_labels' ), 60 'value' => $showLabels 61 ) 62 ); 66 63 67 /** 68 * Sanitize widget form values as they are saved. 69 * 70 * @see WP_Widget::update() 71 * 72 * @param array $new_instance Values just sent to be saved. 73 * @param array $old_instance Previously saved values from database. 74 * 75 * @return array Updated safe values to be saved. 76 */ 77 function update( $new_instance, $old_instance ) { 78 $instance = $old_instance; 64 require WPUR_PATH . '/templates/widget-form.php'; 65 } 79 66 80 $instance['title'] = strip_tags( $new_instance['title'] ); 67 /** 68 * Sanitize values 69 * 70 * Sanitize widget form values as they are saved. 71 * 72 * @see WP_Widget::update() 73 * 74 * @param array $new_instance Values just sent to be saved. 75 * @param array $old_instance Previously saved values from database. 76 * 77 * @return array Updated safe values to be saved. 78 */ 79 function update( $new_instance, $old_instance ) { 80 $instance = $old_instance; 81 81 82 if( is_numeric( $new_instance['show_releases'] ) && $new_instance['show_releases'] <= 10 ) { 83 $instance['show_releases'] = strip_tags( $new_instance['show_releases'] ); 84 } else { 85 $instance['show_releases'] = 0; 86 } 82 $instance['title'] = sanitize_text_field( $new_instance['title'] ); 83 $instance['title'] = ( $instance['title'] ) ? $instance['title'] : __( 'Upcoming Releases', 'wp-upcoming-releases' ); 84 $instance['show_labels'] = (int) sanitize_text_field( $new_instance['show_labels'] ); 87 85 88 return $instance;89 } 86 $perPage = (int) sanitize_text_field( $new_instance['show_releases'] ); 87 $showLabels = (int) sanitize_text_field( $new_instance['show_labels'] ); 90 88 91 /** 92 * Front-end display of widget. 93 * 94 * @see WP_Widget::widget() 95 * 96 * @param array $args Widget arguments. 97 * @param array $instance Saved values from database. 98 */ 99 function widget( $args, $instance ) { 100 extract( $args ); 101 102 echo $before_widget; 103 require_once( WPUR_PATH . 'public/releases-view.php' ); 104 echo $after_widget; 105 } 106 } // class has_wpur_widget 89 $instance['show_releases'] = ( $perPage > 0 && $perPage <= 10 ) ? $perPage : 4; 90 $instance['show_labels'] = ( $showLabels ) ? 1 : 0; 91 92 return $instance; 93 } 94 95 /** 96 * Widget Front-End display. 97 * 98 * @see WP_Widget::widget() 99 * 100 * @param array $arguments Widget arguments. 101 * @param array $instance Saved values from database. 102 */ 103 function widget( $arguments, $instance ) { 104 /** 105 * Widget Title 106 */ 107 $before_title = empty($arguments['before_title']) ? '' : $arguments['before_title']; 108 $after_title = empty($arguments['after_title']) ? '' : $arguments['after_title']; 109 $title = apply_filters( 'widget_title', $instance['title'] ); 110 $title = empty( $title ) ? '' : $title; 111 $title = $before_title . $title . $after_title; 112 113 /** 114 * Widget Options 115 */ 116 $perPage = empty( $instance['show_releases'] ) ? 4 : (int) $instance['show_releases']; 117 $showLabels = empty( $instance['show_labels'] ) ? 0 : (int) $instance['show_labels']; 118 119 /** 120 * WP Query 121 */ 122 $criteria = array( 'post_type' => 'has_releases', 'posts_per_page' => $perPage ); 123 $storage = new WP_Query(); 124 $releases = $storage->query($criteria); 125 126 /** 127 * Template data 128 */ 129 $data = array( 130 'title' => $title, 131 'releases' => $releases, 132 'showLabels' => $showLabels 133 ); 134 135 echo empty( $arguments['before_widget'] ) ? '' : $arguments['before_widget']; 136 137 require_once WPUR_PATH . '/templates/releases-list.php'; 138 139 echo empty( $arguments['after_widget'] ) ? '' : $arguments['after_widget']; 140 } 141 } 107 142 108 143 // register has_wpur_widget widget. 109 144 function has_wpur_register_widget() { 110 register_widget( 'has_wpur_widget' );145 register_widget( 'has_wpur_widget' ); 111 146 } 112 147 -
wp-upcoming-releases/trunk/languages/wp-upcoming-releases-pt_BR.po
r835527 r1828007 1 # Copyright (C) 201 3 TODO2 # This file is distributed under the same license as the TODO package.1 # Copyright (C) 2014 ~ 2018 Henrique Antonini Silvério 2 # This file is distributed under the same license as the WP Upcoming Releases plugin. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WP Upcoming Releases 1. 0.0\n"5 "Project-Id-Version: WP Upcoming Releases 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n" 7 "POT-Creation-Date: 201 4-01-09 10:03-0300\n"8 "PO-Revision-Date: 201 4-01-09 10:03-0300\n"7 "POT-Creation-Date: 2018-02-23 16:42-0300\n" 8 "PO-Revision-Date: 2018-02-23 16:44-0300\n" 9 9 "Last-Translator: Henrique Antonini Silvério <henrique-silverio@hotmail.com>\n" 10 "Language-Team: Henrique Antonini Silvério <henrique-silverio@hotmail.com>\n"10 "Language-Team: Henrique Antonini Silvério\n" 11 11 "Language: pt_BR\n" 12 12 "MIME-Version: 1.0\n" 13 13 "Content-Type: text/plain; charset=UTF-8\n" 14 14 "Content-Transfer-Encoding: 8bit\n" 15 "X-Generator: Poedit 1.6.3\n"15 "X-Generator: Poedit 2.0.6\n" 16 16 "X-Poedit-KeywordsList: __;_e;_n;_x;esc_html_e;esc_html__;esc_attr_e;" 17 17 "esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2\n" 18 "X-Poedit-Basepath: .. /\n"18 "X-Poedit-Basepath: ..\n" 19 19 "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 20 "X-Poedit-SourceCharset: UTF-8\n" … … 33 33 msgstr "Todos Lançamentos" 34 34 35 #: admin/releases-cpt.php:9 admin/releases-cpt.php:10 36 #: admin/releases-cpt.php:12 35 #: admin/releases-cpt.php:9 admin/releases-cpt.php:10 admin/releases-cpt.php:12 37 36 msgid "New Release" 38 37 msgstr "Novo Lançamento" … … 68 67 #: admin/releases-metabox.php:30 69 68 msgid "Age Rating:" 70 msgstr "Classificação Indicativa "69 msgstr "Classificação Indicativa:" 71 70 72 71 #: admin/releases-metabox.php:45 … … 82 81 msgstr "Exibe uma lista com os seus próximos lançamentos." 83 82 84 #: admin/releases-widget.php:17 admin/releases-widget.php:31 85 msgid "Next Releases" 83 #: admin/releases-widget.php:17 admin/releases-widget.php:33 84 #: admin/releases-widget.php:83 85 msgid "Upcoming Releases" 86 86 msgstr "Próximos Lançamentos" 87 87 88 #: admin/releases-widget.php:43 88 #: templates/partials/release-item.php:55 89 msgid "Rating" 90 msgstr "Classificação" 91 92 #: templates/partials/release-item.php:75 93 msgid "Category" 94 msgstr "Categoria" 95 96 #: templates/partials/release-item.php:95 97 msgid "Release Date" 98 msgstr "Data de Lançamento" 99 100 #: templates/releases-list.php:21 101 msgid "Nothing new for now. Stay tuned!" 102 msgstr "Nada novo por enquanto. Fique ligado!" 103 104 #: templates/widget-form.php:17 89 105 msgid "Title:" 90 106 msgstr "Título:" 91 107 92 #: admin/releases-widget.php:54108 #: templates/widget-form.php:30 93 109 msgid "Number of releases to show:" 94 110 msgstr "Número de Lançamentos a exibir:" 95 111 96 #: public/releases-view.php:56 97 msgid "Not found releases." 98 msgstr "Nenhum lançamento encontrado." 112 #: templates/widget-form.php:46 113 msgid "Show item labels?" 114 msgstr "Mostrar rótulos nos itens?" 115 116 #: templates/widget-form.php:59 117 msgid "No" 118 msgstr "Não" 119 120 #: templates/widget-form.php:73 121 msgid "Yes" 122 msgstr "Sim" 123 124 #: wp-upcoming-releases.php:133 125 msgid "Upcoming Release Cover" 126 msgstr "Capa do Lançamento" 127 128 #~ msgid "Next Releases" 129 #~ msgstr "Próximos Lançamentos" 130 131 #~ msgid "No category" 132 #~ msgstr "Sem categoria" 133 134 #~ msgid "Not found releases." 135 #~ msgstr "Nenhum lançamento encontrado." -
wp-upcoming-releases/trunk/uninstall.php
r835527 r1828007 1 1 <?php 2 2 /** 3 * Fired when the plugin is uninstalled.3 * Plugin uninstall 4 4 * 5 * @package WP_Upcoming_Releases 6 * @author Henrique Antonini Silvério <contato@henriquesilverio.com> 7 * @license GPL-2.0+ 8 * @copyright 2013 Henrique Antonini Silvério 5 * Handles proper database clean up when plugin is deleted. 6 * 7 * @see https://developer.wordpress.org/plugins/the-basics/uninstall-methods/#method-2-uninstall-php 9 8 */ 10 9 11 10 // If uninstall not called from WordPress, then exit 12 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 13 exit(); 11 if ( false === defined( 'WP_UNINSTALL_PLUGIN' ) ) { 12 header('Status: 403 Forbidden'); 13 header('HTTP/1.1 403 Forbidden'); 14 die(); 14 15 } 15 16 16 // Widget 17 unregister_widget( 'has_wpur_widget' ); 18 19 // Custom Post Types and Attachments 17 // Delete all `has_releases` posts 20 18 $all_posts = get_posts( array( 'post_type' => 'has_releases', 'fields' => 'ids') ); 21 19 22 20 if( is_array( $all_posts ) ) { 23 foreach( $all_posts as $post ) { 24 $all_attachs = get_children( array( 'post_parent' => $post ) ); 25 26 if( is_array( $all_attachs ) ) { 27 foreach( $all_attachs as $attach ) { 28 $attach_id = $attach->ID; 29 $file = get_attached_file( $attach_id ); 30 31 wp_delete_attachment( $attach_id, true ); 32 unlink( $file ); 33 } 34 } 35 36 wp_delete_post( $post, true ); 37 } 21 foreach( $all_posts as $post ) { 22 wp_delete_post( $post, true ); 23 } 38 24 } 39 25 40 // Taxonomies and Terms 41 global $wp_taxonomies; 26 // Delete all `has_wpur_category` terms 42 27 $taxonomy = 'has_wpur_category'; 43 28 $terms = get_terms( $taxonomy ); 44 29 45 if( $terms) {46 foreach ($terms as $term) {47 wp_delete_term( $term->term_id, $taxonomy );48 }30 if( is_array( $terms ) ) { 31 foreach ($terms as $term) { 32 wp_delete_term( $term->term_id, $taxonomy ); 33 } 49 34 } 50 51 unset( $wp_taxonomies[ $taxonomy ] ); -
wp-upcoming-releases/trunk/wp-upcoming-releases.php
r835527 r1828007 1 1 <?php 2 3 2 /** 4 * @package WP_Upcoming_Releases5 * @author Henrique Antonini Silvério <contato@henriquesilverio.com>6 * @license GPL-2.0+7 * @copyright 2013 Henrique Antonini Silvério8 *9 3 * Plugin Name: WP Upcoming Releases 10 4 * Plugin URI: https://github.com/HenriqueSilverio/wp-upcoming-releases 11 * Description: Display a widget with a list of upcoming releases of games, books, films, music albums and what you want. Easy management with custom post types.12 * Version: 1. 0.05 * Description: Widget to show a list of upcoming releases: movies, games, musics, or any other thing your creative ideas needs. Easy management with custom post types and categories. 6 * Version: 1.2.0 13 7 * Author: Henrique Antonini Silvério 14 * Author URI: http://henriquesilverio.com/ 15 * License: GPL-2.0+ 8 * Author URI: https://henriquesilverio.github.io 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 * Text Domain: wp-upcoming-releases 12 * Domain Path: /languages 16 13 * 17 * Copyright 2013 Henrique Antonini Silvério <contato@henriquesilverio.com>18 * 14 * Copyright (C) 2014 ~ 2018 Henrique Antonini Silvério 15 * 19 16 * This program is free software; you can redistribute it and/or 20 17 * modify it under the terms of the GNU General Public License 21 18 * as published by the Free Software Foundation; either version 2 22 19 * of the License, or (at your option) any later version. 23 * 20 * 24 21 * This program is distributed in the hope that it will be useful, 25 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 24 * GNU General Public License for more details. 28 * 25 * 29 26 * You should have received a copy of the GNU General Public License 30 27 * along with this program; if not, write to the Free Software 31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 32 29 */ 33 30 34 31 // If this file is called directly, abort. 35 if ( ! defined( 'WPINC' ) ) { 36 die; 32 if ( false === defined( 'ABSPATH' ) ) { 33 header('Status: 403 Forbidden'); 34 header('HTTP/1.1 403 Forbidden'); 35 die(); 37 36 } 38 37 39 38 // Define some util globals 40 if( !defined( 'WPUR_PATH' ) ) {41 define( 'WPUR_PATH', plugin_dir_path( __FILE__ ) );39 if( false === defined( 'WPUR_PATH' ) ) { 40 define( 'WPUR_PATH', dirname( __FILE__ ) ); 42 41 } 43 42 44 43 // Text domain 45 load_plugin_textdomain( 'wp-upcoming-releases', false, 'wp-upcoming-releases/languages' ); 46 47 48 /*---------------------------------------------------------------------------- 49 Styles and Scripts 50 ----------------------------------------------------------------------------*/ 51 52 /** 53 * Register plugin styles 54 */ 55 function has_wpur_register_styles() { 56 wp_register_style( 57 'has_wpur_admin', 58 plugins_url( 'admin/css/admin.css', __FILE__ ) 59 ); 60 61 wp_register_style( 62 'has_wpur_public', 63 plugins_url( 'public/css/public.css', __FILE__ ) 64 ); 44 function loadUpcomingReleasesDomain () { 45 load_plugin_textdomain( 'wp-upcoming-releases', false, WPUR_PATH . '/languages' ); 65 46 } 66 47 67 add_action( ' wp_enqueue_scripts', 'has_wpur_register_styles' );48 add_action( 'init', 'loadUpcomingReleasesDomain' ); 68 49 50 /*------------------------------------------------------------------------------ 51 Styles and Scripts 52 ------------------------------------------------------------------------------*/ 69 53 70 54 /** … … 72 56 */ 73 57 function has_wpur_enqueue_admin_styles( $hook ) { 74 global $post; 75 $has_post_type = 'has_releases'; 76 77 if( $hook == 'post-new.php' || $hook == 'post.php' ) { 78 if( 'has_releases' == $post->post_type ) { 79 wp_enqueue_style( 80 'has_wpur_admin', 81 plugins_url( 'admin/css/admin.css', __FILE__ ) 82 ); 83 } 84 } 58 if ( false === in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { 59 return; 60 } 61 62 $screen = get_current_screen(); 63 64 if ( false === ( is_object( $screen ) && 'has_releases' === $screen->post_type ) ) { 65 return; 66 } 67 68 wp_enqueue_style( 69 'has-wpur-admin', 70 plugins_url( 'assets/css/admin.css', __FILE__ ), 71 array(), 72 null, 73 'all' 74 ); 85 75 } 86 76 87 77 add_action( 'admin_enqueue_scripts', 'has_wpur_enqueue_admin_styles', 10, 1 ); 88 89 78 90 79 /** … … 92 81 */ 93 82 function has_wpur_enqueue_public_styles() { 94 wp_enqueue_style( 'has_wpur_public' ); 83 wp_enqueue_style( 84 'has-wpur-public', 85 plugins_url( 'assets/css/public.css', __FILE__ ), 86 array(), 87 null, 88 'all' 89 ); 95 90 } 96 91 97 92 add_action( 'wp_enqueue_scripts', 'has_wpur_enqueue_public_styles' ); 98 93 99 100 /*---------------------------------------------------------------------------- 94 /*------------------------------------------------------------------------------ 101 95 Post type, Metabox, Taxonomy, Widget 102 ---------------------------------------------------------------------------- */96 ------------------------------------------------------------------------------*/ 103 97 104 98 /** 105 99 * Custom Post Type 106 100 */ 107 require_once( plugin_dir_path( __FILE__ ) . '/admin/releases-cpt.php' ); 108 101 require_once WPUR_PATH . '/admin/releases-cpt.php'; 109 102 110 103 /** 111 104 * Metabox 112 105 */ 113 require_once( plugin_dir_path( __FILE__ ) . '/admin/releases-metabox.php' ); 114 106 require_once WPUR_PATH . '/admin/releases-metabox.php'; 115 107 116 108 /** 117 109 * Taxonomy 118 110 */ 119 require_once( plugin_dir_path( __FILE__ ) . '/admin/releases-taxonomy.php' ); 120 111 require_once WPUR_PATH . '/admin/releases-taxonomy.php'; 121 112 122 113 /** 123 114 * Widget 124 115 */ 125 require_once( plugin_dir_path( __FILE__ ) . '/admin/releases-widget.php' ); 126 116 require_once WPUR_PATH . '/admin/releases-widget.php'; 127 117 128 118 /** 129 * Image size119 * Add Thumbnails support and custom Image size 130 120 */ 131 if( function_exists( 'add_theme_support' ) ) { 132 add_theme_support( 'post-thumbnails' ); 121 function addUpcomingReleasesThumbnail () { 122 add_theme_support( 'post-thumbnails', array( 'has_releases' ) ); 123 add_image_size( 'has_wpur_cover', 90, 120 ); 133 124 } 134 125 135 if( function_exists( 'add_image_size' ) ) { 136 add_image_size( 'has_wpur_cover', 77, 105 ); 126 add_action( 'after_setup_theme', 'addUpcomingReleasesThumbnail' ); 127 128 /** 129 * Add Upcoming Releases Cover selectable from Media Library dropdown 130 */ 131 function upcomingReleasesImageSizeName( $sizes ) { 132 return array_merge( $sizes, array( 133 'has_wpur_cover' => __( 'Upcoming Release Cover', 'wp-upcoming-releases' ), 134 ) ); 137 135 } 136 137 add_filter( 'image_size_names_choose', 'upcomingReleasesImageSizeName' );
Note: See TracChangeset
for help on using the changeset viewer.