fix advert, remove useless add_settings_field() calls

parent dd58c420
...@@ -25,7 +25,7 @@ if(!class_exists('SexhackAdvert')) { ...@@ -25,7 +25,7 @@ if(!class_exists('SexhackAdvert')) {
echo $args['before_widget']; echo $args['before_widget'];
$id=$instance['advid']; $id=$instance['advid'];
if ( ! empty($id)) if ( ! empty($id))
echo $args['before_advid'] . do_shortcode('[sexadv adv='.$id.']'). $args['after_advid']; echo /*$args['before_advid'] . */ do_shortcode('[sexadv adv='.$id.']'); //. $args['after_advid'];
echo $args['after_widget']; echo $args['after_widget'];
} }
......
...@@ -124,8 +124,8 @@ if(!class_exists('SexHackVideoGallery')) { ...@@ -124,8 +124,8 @@ if(!class_exists('SexHackVideoGallery')) {
{ {
add_settings_section('sexhackme-gallery-settings', ' ', array($this, 'settings_section'), 'sexhackme-gallery-settings'); add_settings_section('sexhackme-gallery-settings', ' ', array($this, 'settings_section'), 'sexhackme-gallery-settings');
register_setting('sexhackme-gallery-settings', 'sexhack_gallery_slug'); register_setting('sexhackme-gallery-settings', 'sexhack_gallery_slug');
add_settings_field('sexhack_gallery_slug', 'sexhack_gallery_slug', 'sexhack_gallery_slug', //add_settings_field('sexhack_gallery_slug', 'sexhack_gallery_slug', 'sexhack_gallery_slug',
array($this, 'settings_field'), 'sexhackme-gallery-settings', 'sexhackme-gallery-settings', 'sexhack_gallery_slug' ); // array($this, 'settings_field'), 'sexhackme-gallery-settings', 'sexhackme-gallery-settings' );
} }
...@@ -134,10 +134,12 @@ if(!class_exists('SexHackVideoGallery')) { ...@@ -134,10 +134,12 @@ if(!class_exists('SexHackVideoGallery')) {
echo "<h2>SexHackMe Gallery Settings</h2>"; echo "<h2>SexHackMe Gallery Settings</h2>";
} }
/*
public function settings_field($name) public function settings_field($name)
{ {
echo $name; echo $name;
} }
*/
public function check_rewrite($rules) public function check_rewrite($rules)
{ {
......
...@@ -50,7 +50,7 @@ if(count($slug) > 1) { ...@@ -50,7 +50,7 @@ if(count($slug) > 1) {
require_once dirname( __FILE__ ) . '/inc/class-tgm-plugin-activation.php'; require_once dirname( __FILE__ ) . '/inc/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'sexhackme_register_required_plugins' ); add_action( 'tgmpa_register', 'wp_SexHackMe\sexhackme_register_required_plugins' );
function sexhackme_register_required_plugins() { function sexhackme_register_required_plugins() {
...@@ -146,11 +146,13 @@ if(!class_exists('SexHackMe')) { ...@@ -146,11 +146,13 @@ if(!class_exists('SexHackMe')) {
public function settings_section() { public function settings_section() {
echo "<h3>Enable following functionalities:</h3>"; echo "<h3>Enable following functionalities:</h3>";
} }
/*
public function settings_field($name) public function settings_field($name)
{ {
echo $name; echo $name;
} }
*/
public function checkbox($res) public function checkbox($res)
{ {
...@@ -177,8 +179,8 @@ if(!class_exists('SexHackMe')) { ...@@ -177,8 +179,8 @@ if(!class_exists('SexHackMe')) {
add_settings_section('sexhackme-settings', ' ', array($this, 'settings_section'), 'sexhackme-settings'); add_settings_section('sexhackme-settings', ' ', array($this, 'settings_section'), 'sexhackme-settings');
//register_setting('sexhackme-settings', 'need_rewrite_flush'); //register_setting('sexhackme-settings', 'need_rewrite_flush');
foreach($this->SECTIONS as $section) { foreach($this->SECTIONS as $section) {
add_settings_field($section['name'], $section['name'], $section['name'], //add_settings_field($section['name'], $section['name'], $section['name'],
array($this, 'settings_field'), 'sexhackme-settings', 'sexhackme-settings', $section['name'] ); // array($this, 'settings_field'), 'sexhackme-settings', 'sexhackme-settings', $section['name'] );
register_setting('sexhackme-settings', $section['name']); register_setting('sexhackme-settings', $section['name']);
if(array_key_exists('require-page', $section) && ($section['require-page'])) if(array_key_exists('require-page', $section) && ($section['require-page']))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment