Skip to content

Commit e808843

Browse files
committed
Поправил ошибки
1 parent d806b7a commit e808843

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

ad-generator.php

+5-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* Author URI: https://airat.biz
88
* Version: 1.0.0
99
* Text Domain: ad-generator
10-
* Domain Path: languages
1110
*/
1211

1312
// Exit if accessed directly
@@ -23,18 +22,11 @@ class ad_generator_shortcode {
2322
static function init () {
2423
add_shortcode('ad_generator', array(__CLASS__, 'ad_generator_func'));
2524
//add_action('init', array(__CLASS__, 'register_script'));
26-
add_action('wp_footer', array(__CLASS__, 'print_script'));
25+
//add_action('wp_footer', array(__CLASS__, 'print_script'));
2726
}
2827

2928
static function ad_generator_func( $atts ) {
3029
self::$add_script = true;
31-
return "foo and bar";
32-
}
33-
34-
//static function register_script() { }
35-
36-
static function print_script () {
37-
if ( !self::$add_script ) return;
3830

3931
echo '<form method="post" action="">';
4032
$ad_text = isset($_POST['ad_text']) ? (string) $_POST['ad_text'] : '';
@@ -45,7 +37,7 @@ static function print_script () {
4537
echo '<textarea name="ad_text" cols="100" rows="14">{Рандомизатор|Рандомайзер} {|текста}</textarea>';
4638
}
4739

48-
echo '<br /><input type="submit" value="Генерировать" /></form>'
40+
echo '<br /><input type="submit" value="Генерировать" /></form>';
4941

5042
if ($ad_text) {
5143
require_once plugin_dir_path( __FILE__ ).'/includes/Natty/TextRandomizer.php';
@@ -57,9 +49,11 @@ static function print_script () {
5749
echo htmlspecialchars($tRand->getText()) . '<hr />';
5850
}
5951
}
52+
53+
return;
6054
}
55+
6156
}
6257

63-
6458
ad_generator_shortcode::init();
6559

0 commit comments

Comments
 (0)