-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
ports: | ||
- 80:80 | ||
volumes: | ||
- ./src:/var/www/html/wp-content/plugins/spiderblocker:ro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
die(); | ||
} | ||
|
||
// How do you debug your AJAX calls, how do you sleep at night? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wp-debug-toolbar :)
|
||
function __construct() | ||
{ | ||
if (is_admin()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also limit to user current_user_can('delete_themes') for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using current_user_can resulted in a strange error on my test setup. I'm still looking into this.
PHP message: PHP Fatal error: Call to undefined function wp_get_current_user() in /srv/www/cinn/wp-includes/capabilities.php on line 448
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize plugin at init hook? plugins_loaded is probably too soon
$this->themes_root = FooterLinks::joinPaths(ABSPATH, 'wp-content', 'themes'); | ||
} | ||
|
||
function generateRewriteRules($wp_rewrite) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be setup with hook
$paths[] = $arg; | ||
} | ||
} | ||
return preg_replace('#/+#', '/', join('/', $paths)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DIRECTORY_SEPARATOR instead of /
} catch (Exception $e) { | ||
// Something went wrong, clean up | ||
try { | ||
foreach (glob("{$this->child_dir}/*") as $f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directory iterator please
<hr/> | ||
<div ng-app="footerLinksApp"> | ||
<div ng-controller="MajikCtrl"> | ||
<h2>Input CSS class</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if we could add this into the theme preview and use their apis? New wp 4.7 also supports custom css for all themes directly from theme selector, can we use that?
|
||
// Inside WordPress | ||
if (defined('ABSPATH')) { | ||
$NiteowebFooterLinks_ins = new FooterLinks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add namescape :) This is mostly because of this https://wordpress.org/plugins/search.php?type=term&q=Footer+Links (1000+ plugins that mig use that function name)
) | ||
); | ||
|
||
\WP_Mock::wpFunction('wp_next_scheduled', array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
$plugin = new FooterLinks; | ||
$plugin->adminMenu(); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing other tests
add_action('admin_menu', array(&$this, 'adminMenu')); | ||
add_action('wp_ajax_NFL-patch_theme', array(&$this, 'patchTheme')); | ||
} | ||
if (current_user_can('edit_themes')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit_theme_options , edit_themes is FS rule which is not allowed in EBN.
} | ||
if (array_key_exists($theme_stylesheet, $this->themes)) { | ||
$opts['hide-class'] = $this->themes[$theme_stylesheet]; | ||
update_option('ebn_options', $opts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ebn should not be mentioned anywhere in plugin...
$wp_customize->add_section( | ||
'ebn_settings_section', | ||
array( | ||
'title' => 'EBN Settings', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"footprint"
&$this, | ||
'viewHandler' | ||
$wp_customize->add_section( | ||
'ebn_settings_section', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"footprint"
<?php } | ||
} | ||
$wp_customize->add_setting( | ||
'ebn_options[hide-enabled]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"footprint"
delete_option('nfl_activation'); | ||
} | ||
$wp_customize->add_setting( | ||
'ebn_options[hide-class]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"footprint"
$wp_customize->add_control( | ||
'ebn_hide_class_control', | ||
array( | ||
'label' => 'CSS class to hide', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS Rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The label should only read 'CSS Rule' ? :)
'ebn_hide_class_control', | ||
array( | ||
'label' => 'CSS class to hide', | ||
'description' => 'Some meaningful description of what needs to be here.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS Rule that will hade copyright info
add_option('nfl_activation', 'EXTERMINATE'); | ||
?> | ||
<div class="notice notice-success"> | ||
<p>Hide Footer Links plugin has been enabled.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmurko Probably some link to help docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dz0ny I would add help docs to the WordPress.org site when it's online.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs some work, and tests are missing
// Array of themes and class name to hide. Maybe extend this to hold an | ||
// array of classes or an override function for more complex solutions. | ||
private $themes = array( | ||
'twentysixteen' => 'site-info', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little too broad?
cd73eea
to
33bbc12
Compare
33bbc12
to
2231cb0
Compare
A bit of work left, before this can be used