Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
milesimarco committed Jun 22, 2021
1 parent 2ca39b4 commit b9f452f
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 24 deletions.
5 changes: 0 additions & 5 deletions amministrazionetrasparente.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,6 @@ function at_force_template( $template ) {
require_once(plugin_dir_path(__FILE__) . 'admin-messages.php');

add_action( 'admin_menu', function() {
/*
add_submenu_page( 'edit.php?post_type=amm-trasparente', 'Adeguamenti', 'Adeguamenti', 'manage_options', 'wpgov_checkup', function() {
include(plugin_dir_path(__FILE__) . 'checkup.php');
} );
*/
add_submenu_page( 'edit.php?post_type=amm-trasparente', 'Impostazioni', 'Impostazioni', 'publish_posts', 'wpgov_at', function() {
include(plugin_dir_path(__FILE__) . 'settings.php');
} );
Expand Down
2 changes: 1 addition & 1 deletion pasw2013/paswarchive-tipologie.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- fine breadcrumbs -->

<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>
<h2 class="page-title"><?php echo esc_html( $term->name ); ?></h2>
<h2 class="page-title"><?php echo esc_attr( $term->name ); ?></h2>

<?php
if (is_tax( 'tipologie' )) {
Expand Down
Empty file added readme.md
Empty file.
6 changes: 3 additions & 3 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@
$merge = array_merge( $merge, $inner[1] );
}
sort($merge);
echo 'Numero sezioni supportate dal plugin: '.esc_html( $count );
echo 'Numero sezioni supportate dal plugin: '.sanitize_text_field( $count );
echo '<hr>';
echo '<div style="width:45%;float:left;"><h4>Installate:</h4>';
echo '<ul>';
foreach ( $terms as $term ) {
echo '<li>'.esc_html($term->name).'</li>';
echo '<li>'.sanitize_text_field($term->name).'</li>';
}
echo '</ul>';
echo '</div>';
echo '<div style="width:45%;float:left;"><h4>Supportate:</h4>';
echo '<ul>';
foreach ( $merge as $merge_item ) {
echo '<li>'.esc_html($merge_item).'</li>';
echo '<li>'.sanitize_text_field($merge_item).'</li>';
}
echo '</ul>';
echo '</div>';
Expand Down
13 changes: 7 additions & 6 deletions shortcodes/shortcodes-sezioni.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

echo '
<style type="text/css">
.at-tableclass {'.esc_html($atscss).'padding:0px 0px 0px 5px;position:relative;min-width: 200px;}
.at-tableclass {'.$atscss.'padding:0px 0px 0px 5px;position:relative;min-width: 200px;}
';

if ($atw2) { echo '#at-s-23 { '.esc_html($atw2).' }'; }
if ($atw2) { echo '#at-s-23 { '.$atw2.' }'; }

echo '
.at-tableclass h3 a { text-decoration:none; cursor: default; }
Expand All @@ -40,7 +40,7 @@
font-size: 0.8em;
font-weight: bold; }
</style>
<!-- Generato con il Plugin Wordpress Amministrazione Trasparente v.' . get_option('at_version_number') . '-->';
<!-- Generato con il Plugin Wordpress Amministrazione Trasparente v.' . sanitize_text_field( get_option('at_version_number') ) . '-->';

if ($bar) {
echo '<div style="border: 1px solid #eee; padding: 8px 10px; background: #FBFBFB;">';
Expand All @@ -61,6 +61,7 @@
$atreturn = '<ul>';
$atcounter = 0;
foreach ($inner[1] as $value) {
$value = sanitize_text_field( $value );
$args = array( 'taxonomy' => 'tipologie', 'term' => $value );
$query = new WP_Query( $args );
$fount_posts = $query->found_posts;
Expand All @@ -78,9 +79,9 @@

$sez_l = strtolower(preg_replace('/[^a-zA-Z]+/', '', $inner[0]));
echo '<h3>';
if ($con) { echo '<div class="at-number">'.$atcounter.'</div>'; }
echo esc_html( '<a id="'.$sez_l.'" href="#'.$sez_l.'">'.$inner[0].'</a></h3>' );
echo esc_html( $atreturn );
if ($con) { echo '<div class="at-number">'.esc_attr( $atcounter ).'</div>'; }
echo '<a id="'.$sez_l.'" href="#'.$sez_l.'">'.esc_attr( $inner[0] ).'</a></h3>';
echo $atreturn;

echo '</div>';

Expand Down
4 changes: 2 additions & 2 deletions widget/widget-output-list.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
foreach (amministrazionetrasparente_getarray() as $inner) {

echo '<ul><li><b>'.esc_html($inner[0]).'</b>';
echo '<ul><li><b>'.esc_attr($inner[0]).'</b>';
$atreturn = '';
foreach ($inner[1] as $value) {
$atreturn .= '<li><a href="' . get_term_link( get_term_by('name', $value, 'tipologie'), 'tipologie' ) . '" title="' . $value . '">' . $value . '</a></li>';
}
echo '<ul>'.esc_html( $atreturn ).'</ul>';
echo '<ul>'.wp_kses_post($atreturn).'</ul>';

echo '</li></ul>';
}
Expand Down
14 changes: 7 additions & 7 deletions widget/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ function widget( $args, $instance ) {
return;
}

echo $before_widget;
echo wp_kses_post( $before_widget );

echo $before_title.$instance['title'].$after_title;
echo wp_kses_post( $before_title.$instance['title'].$after_title );

if ( isset($instance['expandable']) && $instance['expandable'] != 0 ) {
include(plugin_dir_path(__FILE__) . 'widget-output-collapse.php');
} else {
include(plugin_dir_path(__FILE__) . 'widget-output-list.php');
}
echo $after_widget;
echo wp_kses_post( $after_widget );
}

function update( $new_instance, $old_instance ) {
Expand Down Expand Up @@ -52,12 +52,12 @@ function form( $instance ) {
$instance = wp_parse_args( (array) $instance, self::get_defaults() );

$title = esc_attr($instance['title']); ?>
<p><label for="<?php echo $this->get_field_id('title');?>">
Titolo: <input class="widefat" id="<?php echo $this->get_field_id('title');?>" name="<?php echo $this->get_field_name('title');?>" type="text" value="<?php echo $title; ?>" />
<p><label for="<?php echo esc_attr( $this->get_field_id('title') );?>">
Titolo: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') );?>" name="<?php echo esc_attr( $this->get_field_name('title') );?>" type="text" value="<?php echo esc_attr($title); ?>" />
</label></p>
<p><input type="checkbox" id="<?php echo $this->get_field_id('expandable');?>" name="<?php echo $this->get_field_name('expandable');?>"
<p><input type="checkbox" id="<?php echo esc_attr( $this->get_field_id('expandable') );?>" name="<?php echo esc_attr( $this->get_field_name('expandable') );?>"
<?php checked( $instance[ 'expandable' ] ); ?>/> Voci espandibili</p>
<p><input type="checkbox" id="<?php echo $this->get_field_id('logic');?>" name="<?php echo $this->get_field_name('logic');?>"
<p><input type="checkbox" id="<?php echo $this->get_field_id('logic');?>" name="<?php echo esc_attr( $this->get_field_name('logic') );?>"
<?php checked( $instance[ 'logic' ] ); ?>/> Visualizza solo nella pagina indicata nelle impostazioni, pagina archivio e singola dei documenti</p>
<input type="hidden" name="submitted" value="1" />
<?php
Expand Down

0 comments on commit b9f452f

Please sign in to comment.