Changeset 2096400
- Timestamp:
- 05/28/2019 10:13:00 AM (7 years ago)
- Location:
- events-as-posts
- Files:
-
- 8 added
- 2 deleted
- 3 edited
- 13 copied
-
tags/0.5.8 (copied) (copied from events-as-posts/trunk)
-
tags/0.5.8/css (added)
-
tags/0.5.8/css/eap.css (added)
-
tags/0.5.8/eap-functions.php (copied) (copied from events-as-posts/trunk/eap-functions.php) (3 diffs)
-
tags/0.5.8/eap-settings.php (copied) (copied from events-as-posts/trunk/eap-settings.php)
-
tags/0.5.8/event-content.php (copied) (copied from events-as-posts/trunk/event-content.php)
-
tags/0.5.8/event-meta.php (copied) (copied from events-as-posts/trunk/event-meta.php)
-
tags/0.5.8/event-post-type.php (copied) (copied from events-as-posts/trunk/event-post-type.php)
-
tags/0.5.8/events-as-posts.php (copied) (copied from events-as-posts/trunk/events-as-posts.php) (2 diffs)
-
tags/0.5.8/inc (deleted)
-
tags/0.5.8/index.php (copied) (copied from events-as-posts/trunk/index.php)
-
tags/0.5.8/js (added)
-
tags/0.5.8/js/eap.js (added)
-
tags/0.5.8/languages (copied) (copied from events-as-posts/trunk/languages)
-
tags/0.5.8/readme.txt (copied) (copied from events-as-posts/trunk/readme.txt) (2 diffs)
-
tags/0.5.8/settings (copied) (copied from events-as-posts/trunk/settings)
-
tags/0.5.8/settings/eap-display-settings.php (copied) (copied from events-as-posts/trunk/settings/eap-display-settings.php)
-
tags/0.5.8/uninstall.php (copied) (copied from events-as-posts/trunk/uninstall.php)
-
trunk/css (added)
-
trunk/css/eap.css (added)
-
trunk/eap-functions.php (modified) (3 diffs)
-
trunk/eap.js (deleted)
-
trunk/events-as-posts.php (modified) (2 diffs)
-
trunk/js (added)
-
trunk/js/eap.js (added)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
events-as-posts/tags/0.5.8/eap-functions.php
r2096073 r2096400 1 1 <?php 2 // e ap admin scripts and styles3 function eap_ admin_scripts( $hook ) {2 // enqueue admin scripts 3 function eap_enqueue_admin_scripts( $hook ) { 4 4 5 5 if( is_admin() ) { … … 7 7 wp_enqueue_style( 'wp-color-picker' ); 8 8 // include custom jQuery file with WordPress Color Picker dependency 9 wp_enqueue_script( 'eap_color_picker_script', plugins_url( '/eap.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); 10 } 11 } 12 add_action( 'admin_enqueue_scripts', 'eap_admin_scripts' ); 13 9 wp_enqueue_script( 'eap-scripts', plugins_url( 'js/eap.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); 10 } 11 } 12 add_action( 'admin_enqueue_scripts', 'eap_enqueue_admin_scripts' ); 13 14 // enqueue styles 15 function eap_enqueue_styles() { 16 17 $setting = get_option( 'eap_settings_style' ); 18 19 wp_register_style( 'eap-styles', plugins_url( 'css/eap.css', __FILE__ ) ); 20 wp_enqueue_style( 'eap-styles' ); 21 22 $bg_color = ( isset( $setting['bg_color'] ) && ! empty ( $setting['bg_color'] ) ) ? $setting['bg_color'] : 'initial'; 23 $event_bg_color = ( isset( $setting['event_bg_color'] ) && ! empty ( $setting['event_bg_color'] ) ) ? $setting['event_bg_color'] : 'initial'; 24 25 $css = null; 26 27 $css .= ".eap__event { padding: 1em; background: $event_bg_color; }"; 28 29 if ( $setting['layout'] == 1 || ! isset( $setting['layout'] ) ) { 30 31 $css .= ".eap__list { display: -ms-grid; display: grid; grid-template-columns: 1fr; grid-gap: 1.6em; background: $bg_color; }" . 32 ".eap__title { margin: 0 0 .6em !important;}" . 33 "@media screen and (min-width: 576px) { .eap__event { display: -ms-grid; display: grid; grid-template-columns: 1fr 2fr; grid-gap: 1.6em; } }"; 34 35 } elseif ( $setting['layout'] == 2 ) { 36 37 $css .= ".eap__list { display: -ms-grid; display: grid; grid-gap: 1.6em; background: $bg_color; }" . 38 ".eap__title { margin: .6em 0 .6em; }" . 39 "@media screen and (min-width: 576px) { .eap__list { grid-template-columns: repeat(2, 1fr); } }"; 40 41 } elseif ( $setting['layout'] == 3 ) { 42 43 $css .= ".eap__list { display: -ms-grid; display: grid; grid-gap: 1.6em; background: $bg_color; }" . 44 ".eap__title { margin: .6em 0 .6em; }" . 45 "@media screen and (min-width: 576px) { .eap__list { grid-template-columns: repeat(3, 1fr); } }"; 46 } 47 48 if ( isset( $setting['custom_css'] ) && ! empty ( $setting['custom_css'] ) ) { 49 $css .= htmlentities( $setting['custom_css'] ); 50 } 51 52 if ( ! empty ( $css ) ) { 53 wp_add_inline_style( 'eap-styles', $css ); 54 } 55 } 56 add_action( 'wp_enqueue_scripts', 'eap_enqueue_styles' ); 14 57 15 58 // load textdomain … … 237 280 } 238 281 add_action( 'init', 'eap_register_shortcodes' ); 239 240 241 // list styles242 function eap_events_style() {243 244 $setting = get_option( 'eap_settings_style' );245 ?>246 <style>247 /* Events as Posts */248 <?php if ( $setting['layout'] == 1 || ! isset( $setting['layout'] ) ) : ?>249 .eap__list { grid-template-columns: 1fr; }250 .eap__title { margin: 0 0 .6em !important;}251 @media all and (min-width: 576px) { .eap__event { display: -ms-grid; display: grid; grid-template-columns: 1fr 2fr; grid-gap: 1.6em; } }252 <?php elseif ( $setting['layout'] == 2 ) : ?>253 .eap__title { margin: .6em 0 .6em; }254 @media all and (min-width: 576px) { .eap__list { grid-template-columns: repeat(2, 1fr); } }255 <?php elseif ( $setting['layout'] == 3 ) : ?>256 .eap__title { margin: .6em 0 .6em; }257 @media all and (min-width: 576px) { .eap__list { grid-template-columns: repeat(3, 1fr); } }258 <?php endif; ?>259 260 .eap__img img { width: 100%; }261 .no-wrap { white-space: nowrap; }262 .eap__meta .dashicons { vertical-align: middle; }263 .eap__list { display: -ms-grid; display: grid; grid-gap: 1.6em; background: <?php echo ( isset( $setting['bg_color'] ) && ! empty ( $setting['bg_color'] ) ) ? $setting['bg_color'] : 'initial'; ?>; }264 .eap__event { padding: 1em; background: <?php echo ( isset( $setting['event_bg_color'] ) && ! empty ( $setting['event_bg_color'] ) ) ? $setting['event_bg_color'] : 'initial'; ?>; }265 <?php if ( isset( $setting['custom_css'] ) && ! empty ( $setting['custom_css'] ) ) echo htmlentities( $setting['custom_css'] ); ?>266 </style>267 <?php268 }269 add_action('wp_head', 'eap_events_style'); -
events-as-posts/tags/0.5.8/events-as-posts.php
r2096074 r2096400 4 4 Plugin URI: https://wordpress.org/plugins/events-as-posts/ 5 5 Description: A simple plugin that allows you to post events on your site 6 Version: 0.5. 76 Version: 0.5.8 7 7 Author: Ambrogio Piredda 8 8 Author URI: https://profiles.wordpress.org/orbam7819 … … 36 36 if ( ! defined( 'EAP_VERSION' ) ) { 37 37 38 define('EAP_VERSION', '0.5. 7');38 define('EAP_VERSION', '0.5.8'); 39 39 } 40 40 -
events-as-posts/tags/0.5.8/readme.txt
r2096074 r2096400 7 7 Requires at least: 4.8 8 8 Tested up to: 5.2 9 Stable tag: 0.5. 79 Stable tag: 0.5.8 10 10 Requires PHP: 5.4 11 11 License: GPLv2 or later … … 74 74 == Changelog == 75 75 76 = 0.5.8 — 28 of May, 2019 = 77 * Added front-end stylesheet again, but now can be disabled using [wp_deregister_style()](https://developer.wordpress.org/reference/functions/wp_deregister_style/) in case you don't want to use the plugin default styles 78 76 79 = 0.5.7 — 27 of May, 2019 = 77 80 * Cleaned up code that displays the styles, and correct a wrong option name in setting's page -
events-as-posts/trunk/eap-functions.php
r2096073 r2096400 1 1 <?php 2 // e ap admin scripts and styles3 function eap_ admin_scripts( $hook ) {2 // enqueue admin scripts 3 function eap_enqueue_admin_scripts( $hook ) { 4 4 5 5 if( is_admin() ) { … … 7 7 wp_enqueue_style( 'wp-color-picker' ); 8 8 // include custom jQuery file with WordPress Color Picker dependency 9 wp_enqueue_script( 'eap_color_picker_script', plugins_url( '/eap.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); 10 } 11 } 12 add_action( 'admin_enqueue_scripts', 'eap_admin_scripts' ); 13 9 wp_enqueue_script( 'eap-scripts', plugins_url( 'js/eap.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); 10 } 11 } 12 add_action( 'admin_enqueue_scripts', 'eap_enqueue_admin_scripts' ); 13 14 // enqueue styles 15 function eap_enqueue_styles() { 16 17 $setting = get_option( 'eap_settings_style' ); 18 19 wp_register_style( 'eap-styles', plugins_url( 'css/eap.css', __FILE__ ) ); 20 wp_enqueue_style( 'eap-styles' ); 21 22 $bg_color = ( isset( $setting['bg_color'] ) && ! empty ( $setting['bg_color'] ) ) ? $setting['bg_color'] : 'initial'; 23 $event_bg_color = ( isset( $setting['event_bg_color'] ) && ! empty ( $setting['event_bg_color'] ) ) ? $setting['event_bg_color'] : 'initial'; 24 25 $css = null; 26 27 $css .= ".eap__event { padding: 1em; background: $event_bg_color; }"; 28 29 if ( $setting['layout'] == 1 || ! isset( $setting['layout'] ) ) { 30 31 $css .= ".eap__list { display: -ms-grid; display: grid; grid-template-columns: 1fr; grid-gap: 1.6em; background: $bg_color; }" . 32 ".eap__title { margin: 0 0 .6em !important;}" . 33 "@media screen and (min-width: 576px) { .eap__event { display: -ms-grid; display: grid; grid-template-columns: 1fr 2fr; grid-gap: 1.6em; } }"; 34 35 } elseif ( $setting['layout'] == 2 ) { 36 37 $css .= ".eap__list { display: -ms-grid; display: grid; grid-gap: 1.6em; background: $bg_color; }" . 38 ".eap__title { margin: .6em 0 .6em; }" . 39 "@media screen and (min-width: 576px) { .eap__list { grid-template-columns: repeat(2, 1fr); } }"; 40 41 } elseif ( $setting['layout'] == 3 ) { 42 43 $css .= ".eap__list { display: -ms-grid; display: grid; grid-gap: 1.6em; background: $bg_color; }" . 44 ".eap__title { margin: .6em 0 .6em; }" . 45 "@media screen and (min-width: 576px) { .eap__list { grid-template-columns: repeat(3, 1fr); } }"; 46 } 47 48 if ( isset( $setting['custom_css'] ) && ! empty ( $setting['custom_css'] ) ) { 49 $css .= htmlentities( $setting['custom_css'] ); 50 } 51 52 if ( ! empty ( $css ) ) { 53 wp_add_inline_style( 'eap-styles', $css ); 54 } 55 } 56 add_action( 'wp_enqueue_scripts', 'eap_enqueue_styles' ); 14 57 15 58 // load textdomain … … 237 280 } 238 281 add_action( 'init', 'eap_register_shortcodes' ); 239 240 241 // list styles242 function eap_events_style() {243 244 $setting = get_option( 'eap_settings_style' );245 ?>246 <style>247 /* Events as Posts */248 <?php if ( $setting['layout'] == 1 || ! isset( $setting['layout'] ) ) : ?>249 .eap__list { grid-template-columns: 1fr; }250 .eap__title { margin: 0 0 .6em !important;}251 @media all and (min-width: 576px) { .eap__event { display: -ms-grid; display: grid; grid-template-columns: 1fr 2fr; grid-gap: 1.6em; } }252 <?php elseif ( $setting['layout'] == 2 ) : ?>253 .eap__title { margin: .6em 0 .6em; }254 @media all and (min-width: 576px) { .eap__list { grid-template-columns: repeat(2, 1fr); } }255 <?php elseif ( $setting['layout'] == 3 ) : ?>256 .eap__title { margin: .6em 0 .6em; }257 @media all and (min-width: 576px) { .eap__list { grid-template-columns: repeat(3, 1fr); } }258 <?php endif; ?>259 260 .eap__img img { width: 100%; }261 .no-wrap { white-space: nowrap; }262 .eap__meta .dashicons { vertical-align: middle; }263 .eap__list { display: -ms-grid; display: grid; grid-gap: 1.6em; background: <?php echo ( isset( $setting['bg_color'] ) && ! empty ( $setting['bg_color'] ) ) ? $setting['bg_color'] : 'initial'; ?>; }264 .eap__event { padding: 1em; background: <?php echo ( isset( $setting['event_bg_color'] ) && ! empty ( $setting['event_bg_color'] ) ) ? $setting['event_bg_color'] : 'initial'; ?>; }265 <?php if ( isset( $setting['custom_css'] ) && ! empty ( $setting['custom_css'] ) ) echo htmlentities( $setting['custom_css'] ); ?>266 </style>267 <?php268 }269 add_action('wp_head', 'eap_events_style'); -
events-as-posts/trunk/events-as-posts.php
r2096074 r2096400 4 4 Plugin URI: https://wordpress.org/plugins/events-as-posts/ 5 5 Description: A simple plugin that allows you to post events on your site 6 Version: 0.5. 76 Version: 0.5.8 7 7 Author: Ambrogio Piredda 8 8 Author URI: https://profiles.wordpress.org/orbam7819 … … 36 36 if ( ! defined( 'EAP_VERSION' ) ) { 37 37 38 define('EAP_VERSION', '0.5. 7');38 define('EAP_VERSION', '0.5.8'); 39 39 } 40 40 -
events-as-posts/trunk/readme.txt
r2096074 r2096400 7 7 Requires at least: 4.8 8 8 Tested up to: 5.2 9 Stable tag: 0.5. 79 Stable tag: 0.5.8 10 10 Requires PHP: 5.4 11 11 License: GPLv2 or later … … 74 74 == Changelog == 75 75 76 = 0.5.8 — 28 of May, 2019 = 77 * Added front-end stylesheet again, but now can be disabled using [wp_deregister_style()](https://developer.wordpress.org/reference/functions/wp_deregister_style/) in case you don't want to use the plugin default styles 78 76 79 = 0.5.7 — 27 of May, 2019 = 77 80 * Cleaned up code that displays the styles, and correct a wrong option name in setting's page
Note: See TracChangeset
for help on using the changeset viewer.