Compare commits

...

5 Commits

6 changed files with 23 additions and 223 deletions

View File

@ -53,6 +53,10 @@ Aggiunti una tassonomia e due *shortcode* per la gestione degli Speciali. In par
Il *plugin* è stato originariamente sviluppato per integrarsi con [Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/). I codici di integrazione con questo *plugin* sono stati cancellati dalla versione attuale e spostati in [Co-Authors Widget](https://wordpress.org/plugins/widget-for-co-authors/) (vedi anche la [pagina del *plugin*](https://ulaulaman.github.io/#CoAuthorsWidget)).
## Changelog
* 2021.1116
* Modificato il colore della striscia dell'ultimo aggiornamento
* Inserito il menu *costellazioni* alla fine della *sidebar* corrispondente
* Elimintati i *widget* delle singole *sidebar*
* 2021.1026
* Modifche minori in rodari.php
* Aggiornamento *file css*

View File

@ -2,7 +2,7 @@
/*
Plugin Name: Edu INAF Tools
Description: Il plugin aggiunge varie funzionalità al sito Edu INAF senza modificare direttamente il codice php del tema.
Version: 2021.1026
Version: 2021.1116
Author: Gianluigi Filippelli
Author URI: http://dropseaofulaula.blogspot.it/
Plugin URI: https://ulaulaman.github.io/#EduINAF
@ -26,7 +26,7 @@ require_once( EDUINAF__PLUGIN_DIR . 'sidebars/astrodidattica.php' );
require_once( EDUINAF__PLUGIN_DIR . 'sidebars/astrofoto.php' );
require_once( EDUINAF__PLUGIN_DIR . 'sidebars/costellazioni.php' );
require_once( EDUINAF__PLUGIN_DIR . 'sidebars/brera.php' );
require_once( EDUINAF__PLUGIN_DIR . 'sidebars/widgets.php' );
# require_once( EDUINAF__PLUGIN_DIR . 'sidebars/widgets.php' );
# Speciali
require_once( EDUINAF__PLUGIN_DIR . 'incl/speciali.php' );
# Mappe
@ -34,7 +34,7 @@ require_once( EDUINAF__PLUGIN_DIR . 'incl/mappe.php' );
# inclusione di css personalizzato
function edu_inaf_table () {
wp_register_style( 'eduinaf', plugins_url( 'eduinaf/incl/eduinaf.css' ), rand(111,9999), '2021.1026' );
wp_register_style( 'eduinaf', plugins_url( 'eduinaf/incl/eduinaf.css' ), rand(111,9999), '2021.1116' );
wp_enqueue_style( 'eduinaf' );
}
add_action( 'wp_enqueue_scripts', 'edu_inaf_table' );

View File

@ -326,7 +326,7 @@ a.astroedu:hover {color:#ffcc00;}
.last-updated {
font-size: small;
text-transform: uppercase;
background-color: #06a0db;
background-color: #97cbdf;
}
/* domande risposte */

View File

@ -53,6 +53,10 @@ Aggiunti una tassonomia e due *shortcode* per la gestione degli speciali. In par
Il *plugin* è stato originariamente sviluppato per integrarsi con [Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/). I codici di integrazione con questo *plugin* sono stati cancellati dalla versione attuale e spostati in [Co-Authors Widget](https://wordpress.org/plugins/widget-for-co-authors/) (vedi anche la [pagina del *plugin*](https://ulaulaman.github.io/#CoAuthorsWidget)).
== Changelog ==
* 2021.1116
* Modificato il colore della striscia dell'ultimo aggiornamento
* Inserito il menu *costellazioni* alla fine della *sidebar* corrispondente
* Elimintati i *widget* delle singole *sidebar*
* 2021.1026
* Modifche minori in rodari.php
* Aggiornamento *file css*

View File

@ -87,8 +87,18 @@ add_shortcode( 'sbcostellazioni', function () {
$auth = do_shortcode('[blog-post-coauthors]');
$cura = '<h4 class="widget-title"><span>Scheda a cura di</h4><p><strong>'.$auth.'</strong></p>';
$starsNav = wp_get_nav_menu_items(1895);
$out = $out.$cura;
foreach ( $starsNav as $navItem ) {
$nav = $nav. '<button><a href="'.$navItem->url.'" title="'.$navItem->title.'">'.$navItem->title.'</a></button>';
}
$menu = '<div align="center" class="btn-group">'.$nav.'</div>';
$out = $menu;
$out = $out.$cura.$menu;
return $out;
} );

View File

@ -1,218 +0,0 @@
<?php
#
# widget per le sidebar
#
# didattica
class Widget_Didattica extends WP_Widget {
/** Registrazione del widget */
public function __construct() {
parent::__construct(
'widget_dida', // Base ID
'Widget Didattica', // Name
array( 'description' => __( 'Widget per l\'inserimento della sidebar dei contenuti didattici', 'text_domain' ), ) // Args
);
}
/** Front-end del widget */
public function widget( $args, $instance ) {
extract( $args );
$shortcode = do_shortcode('[sbdidattica]');
echo $shortcode;
echo $after_widget;
}
/** Back-end del widget */
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
}
else {
$title = __( 'Titolo', 'text_domain' );
}
?>
<p>
<label for="<?php echo $this->get_field_name( 'title' ); ?>"><?php _e( 'Titolo:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
}
/** Ripulisce i valori del widget man mano che vengono salvati */
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = ( !empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
return $instance;
}
} // class Widget_Didattica
// Registra Widget_Didattica
add_action( 'widgets_init', 'register_dida' );
function register_dida() {
register_widget( 'Widget_Didattica' );
}
# costellazioni
class Widget_Stars extends WP_Widget {
/** Registrazione del widget */
public function __construct() {
parent::__construct(
'widget_stars', // Base ID
'Widget Stars', // Name
array( 'description' => __( 'Widget per l\'inserimento della sidebar delle costellazioni', 'text_domain' ), ) // Args
);
}
/** Front-end del widget */
public function widget( $args, $instance ) {
extract( $args );
$shortcode = do_shortcode('[sbcostellazioni]');
$menu = do_shortcode('[menucostellazioni]');
echo $shortcode;
echo $menu;
echo $after_widget;
}
/** Back-end del widget */
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
}
else {
$title = __( 'Titolo', 'text_domain' );
}
?>
<p>
<label for="<?php echo $this->get_field_name( 'title' ); ?>"><?php _e( 'Titolo:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
}
/** Ripulisce i valori del widget man mano che vengono salvati */
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = ( !empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
return $instance;
}
} // class Widget_Stars
// Registra Widget_Stars
add_action( 'widgets_init', 'register_stars' );
function register_stars() {
register_widget( 'Widget_Stars' );
}
# corso base
class Widget_Brera extends WP_Widget {
/** Registrazione del widget */
public function __construct() {
parent::__construct(
'widget_brera', // Base ID
'Widget Brera', // Name
array( 'description' => __( 'Widget per l\'inserimento della sidebar del corso base di astronomia', 'text_domain' ), ) // Args
);
}
/** Front-end del widget */
public function widget( $args, $instance ) {
extract( $args );
$shortcode = do_shortcode('[sbcorsobase]');
echo $shortcode;
echo $after_widget;
}
/** Back-end del widget */
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
}
else {
$title = __( 'Titolo', 'text_domain' );
}
?>
<p>
<label for="<?php echo $this->get_field_name( 'title' ); ?>"><?php _e( 'Titolo:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
}
/** Ripulisce i valori del widget man mano che vengono salvati */
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = ( !empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
return $instance;
}
} // class Widget_Brera
// Registra Widget_Brera
add_action( 'widgets_init', 'register_brera' );
function register_brera() {
register_widget( 'Widget_Brera' );
}
# astrofoto
class Widget_AstroFoto extends WP_Widget {
/** Registrazione del widget */
public function __construct() {
parent::__construct(
'widget_astrofoto', // Base ID
'Widget Astro Foto', // Name
array( 'description' => __( 'Widget per l\'inserimento della sidebar delle fotografie astronomiche', 'text_domain' ), ) // Args
);
}
/** Front-end del widget */
public function widget( $args, $instance ) {
extract( $args );
$shortcode = do_shortcode('[sbastrofoto]');
echo $shortcode;
echo $after_widget;
}
/** Back-end del widget */
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
}
else {
$title = __( 'Titolo', 'text_domain' );
}
?>
<p>
<label for="<?php echo $this->get_field_name( 'title' ); ?>"><?php _e( 'Titolo:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
}
/** Ripulisce i valori del widget man mano che vengono salvati */
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = ( !empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
return $instance;
}
} // class Widget_AstroFoto
// Registra Widget_AstroFoto
add_action( 'widgets_init', 'register_astrofoto' );
function register_astrofoto() {
register_widget( 'Widget_AstroFoto' );
}