Plugin Directory

Changeset 2096400


Ignore:
Timestamp:
05/28/2019 10:13:00 AM (7 years ago)
Author:
orbam7819
Message:

Tagging version 0.5.8.

Location:
events-as-posts
Files:
8 added
2 deleted
3 edited
13 copied

Legend:

Unmodified
Added
Removed
  • events-as-posts/tags/0.5.8/eap-functions.php

    r2096073 r2096400  
    11<?php
    2 // eap admin scripts and styles
    3 function eap_admin_scripts( $hook ) {
     2// enqueue admin scripts
     3function eap_enqueue_admin_scripts( $hook ) {
    44
    55    if( is_admin() ) {
     
    77        wp_enqueue_style( 'wp-color-picker' );
    88        // 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}
     12add_action( 'admin_enqueue_scripts', 'eap_enqueue_admin_scripts' );
     13
     14// enqueue styles
     15function 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}
     56add_action( 'wp_enqueue_scripts', 'eap_enqueue_styles' );
    1457
    1558// load textdomain
     
    237280}
    238281add_action( 'init', 'eap_register_shortcodes' );
    239 
    240 
    241 // list styles
    242 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     <?php
    268 }
    269 add_action('wp_head', 'eap_events_style');
  • events-as-posts/tags/0.5.8/events-as-posts.php

    r2096074 r2096400  
    44Plugin URI:   https://wordpress.org/plugins/events-as-posts/
    55Description:  A simple plugin that allows you to post events on your site
    6 Version:      0.5.7
     6Version:      0.5.8
    77Author:       Ambrogio Piredda
    88Author URI:   https://profiles.wordpress.org/orbam7819
     
    3636if ( ! defined( 'EAP_VERSION' ) ) {
    3737
    38     define('EAP_VERSION', '0.5.7');
     38    define('EAP_VERSION', '0.5.8');
    3939}
    4040
  • events-as-posts/tags/0.5.8/readme.txt

    r2096074 r2096400  
    77Requires at least: 4.8
    88Tested up to: 5.2
    9 Stable tag: 0.5.7
     9Stable tag: 0.5.8
    1010Requires PHP: 5.4
    1111License: GPLv2 or later
     
    7474== Changelog ==
    7575
     76= 0.5.8 &mdash; 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
    7679= 0.5.7 &mdash; 27 of May, 2019 =
    7780* 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  
    11<?php
    2 // eap admin scripts and styles
    3 function eap_admin_scripts( $hook ) {
     2// enqueue admin scripts
     3function eap_enqueue_admin_scripts( $hook ) {
    44
    55    if( is_admin() ) {
     
    77        wp_enqueue_style( 'wp-color-picker' );
    88        // 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}
     12add_action( 'admin_enqueue_scripts', 'eap_enqueue_admin_scripts' );
     13
     14// enqueue styles
     15function 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}
     56add_action( 'wp_enqueue_scripts', 'eap_enqueue_styles' );
    1457
    1558// load textdomain
     
    237280}
    238281add_action( 'init', 'eap_register_shortcodes' );
    239 
    240 
    241 // list styles
    242 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     <?php
    268 }
    269 add_action('wp_head', 'eap_events_style');
  • events-as-posts/trunk/events-as-posts.php

    r2096074 r2096400  
    44Plugin URI:   https://wordpress.org/plugins/events-as-posts/
    55Description:  A simple plugin that allows you to post events on your site
    6 Version:      0.5.7
     6Version:      0.5.8
    77Author:       Ambrogio Piredda
    88Author URI:   https://profiles.wordpress.org/orbam7819
     
    3636if ( ! defined( 'EAP_VERSION' ) ) {
    3737
    38     define('EAP_VERSION', '0.5.7');
     38    define('EAP_VERSION', '0.5.8');
    3939}
    4040
  • events-as-posts/trunk/readme.txt

    r2096074 r2096400  
    77Requires at least: 4.8
    88Tested up to: 5.2
    9 Stable tag: 0.5.7
     9Stable tag: 0.5.8
    1010Requires PHP: 5.4
    1111License: GPLv2 or later
     
    7474== Changelog ==
    7575
     76= 0.5.8 &mdash; 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
    7679= 0.5.7 &mdash; 27 of May, 2019 =
    7780* 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.