Skip to content

Commit

Permalink
small bug-fix for several warnings when WP_DEBUG is on
Browse files Browse the repository at this point in the history
  • Loading branch information
nida78 committed Mar 8, 2020
1 parent 54f571f commit cd37fdb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Tags: wiki, wikipedia, mediawiki, tooltip, tooltipster, shortcode

Requires at least: 3.0

Tested up to: 5.2.2
Tested up to: 5.3.2

Stable tag: 1.9.1
Stable tag: 1.9.2

Donate link: https://n1da.net/specials/wp-wiki-tooltip/spenden/

Expand Down
2 changes: 1 addition & 1 deletion class.wp-wiki-tooltip-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
class WP_Wiki_Tooltip_Base {

protected $version = '1.9.1';
protected $version = '1.9.2';

protected $options = false;
}
6 changes: 3 additions & 3 deletions class.wp-wiki-tooltip.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function init() {
'error_handling' => $this->options[ 'page-error-handling' ],
'default_error_title' => __( 'Error!', 'wp-wiki-tooltip' ),
'default_error_message' => __( 'Sorry, but we were not able to find this page :(', 'wp-wiki-tooltip' ),
'own_error_title' => $this->options[ 'own-error-title' ],
'own_error_message' => $this->options[ 'own-error-message' ],
'own_error_title' => ( $this->options[ 'page-error-handling' ] == 'show-own' ) ? $this->options[ 'own-error-title' ] : '',
'own_error_message' => ( $this->options[ 'page-error-handling' ] == 'show-own' ) ? $this->options[ 'own-error-message' ] : '',
'section_error_handling' => $this->options[ 'section-error-handling' ]
));
wp_enqueue_script( 'wp-wiki-tooltip-js' );
Expand Down Expand Up @@ -108,7 +108,7 @@ public function do_wiki_shortcode( $atts, $content ) {
$output = '<script>$wwtj( document ).ready( function() { add_wiki_box( ' . $cnt . ', "' . $trans_wiki_data[ 'wiki-id' ] . '", "' . $trans_wiki_data[ 'wiki-title' ] . '", "' . $params[ 'section' ] . '", "' . $trans_wiki_data[ 'wiki-base-url' ] . '", "' . $trans_wiki_data[ 'wiki-url' ] . '", "' . $params[ 'thumbnail' ] . '" ); } );</script>';
$relno = ( $this->options[ 'a-target' ] == '_blank' ) ? ' rel="noopener noreferrer"' : '';

if( ( $trans_wiki_data[ 'wiki-id' ] == '-1' ) && ( $this->options[ 'error-handling' ] == 'remove-link' ) ) {
if( ( $trans_wiki_data[ 'wiki-id' ] == '-1' ) && ( $this->options[ 'page-error-handling' ] == 'remove-link' ) ) {
$output .= $content;
} else {
$output .= '<span id="wiki-tooltip-' . $cnt . '" data-tooltip-content="wiki-tooltip-box-' . $cnt . '"><a class="wiki-tooltip" href="' . $trans_wiki_data['wiki-url'] . ( ( $params[ 'section' ] != '' ) ? ( '#' . $params[ 'section' ] ) : '' ) . '" target="' . $this->options['a-target'] . '"' . $relno . ' onclick="return isClickEnabled( \'' . $this->options['trigger'] . '\', \'' . $this->options['trigger-hover-action'] . '\' );">' . $content . '</a></span>';
Expand Down
20 changes: 10 additions & 10 deletions config.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php

$wp_wiki_tooltip_default_options = array(
$wp_wiki_tooltip_default_options = [

'wiki-urls' => array (
'wiki-urls' => [
'standard' => 1,
'data' => array (
'1' => array ( // standard URL of Wiki to get contents from
'data' => [
'1' => [ // standard URL of Wiki to get contents from
'id' => 'EN',
'url' => 'https://en.wikipedia.org/w/api.php',
'sitename' => 'Wikipedia'
)
)
),
]
]
],

'cache' => array ( // NOT USED: cache settings - default "1 week"
'cache' => [ // NOT USED: cache settings - default "1 week"

'count' => 1, // how many

'unit' => 'week' // what
),
],

'a-target' => '_blank', // where to open links to wiki pages

Expand Down Expand Up @@ -55,4 +55,4 @@
'thumb-width' => '200', // standard width of the thumbnails

'thumb-style' => '', // stylesheets for thumbnail images
);
];
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: nida78
Tags: wiki, wikipedia, mediawiki, tooltip, tooltipster, shortcode
Requires at least: 3.0
Tested up to: 5.2.2
Stable tag: 1.9.1
Tested up to: 5.3.2
Stable tag: 1.9.2
Donate link: https://n1da.net/specials/wp-wiki-tooltip/spenden/
License: GPLv2 or later

Expand Down
2 changes: 1 addition & 1 deletion wp-wiki-tooltip.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: WP Wiki Tooltip
Plugin URI: https://n1da.net/specials/wp-wiki-tooltip/
Description: Adds explaining tooltips querying their content from a <a href="https://www.mediawiki.org" target="_blank" rel="noopener noreferrer">MediaWiki</a> installation, e.g. <a href="https://www.wikipedia.org" target="_blank" rel="noopener noreferrer">Wikipedia.org</a>.
Version: 1.9.1
Version: 1.9.2
Author: Nico Danneberg
Author URI: https://n1da.net
License: GPLv2 or later
Expand Down

0 comments on commit cd37fdb

Please sign in to comment.