Quantcast
Channel: admin — WordPress Plugins
Viewing all articles
Browse latest Browse all 2035

Admin Branding and Tweaks

$
0
0

Emailed Author: This code isn't quite right:

<?php
$file = dirname(dirname(dirname(__FILE__))) . '/index.php.php';
$plugin_url = plugin_dir_url($file);
// Output something like: http://example.com/wp-content/plugins/your-plugin/
$plugin_path = plugin_dir_path($file);
// Output something like: /home/mysite/www/wp-content/plugins/your-plugin/

You're using it so you can do this:

'logo' => $plugin_url . 'img/wp_branding.png',

But couldn't you just do this:

'logo' => '../../img/wp_branding.png',

Or since you define THESE in the main file:

$plugin_path = plugin_dir_path(__FILE__);
$plugin_url = plugin_dir_url(__FILE__);

Why not make them globals for your plugin?

Then you can call 'em all over :)

When you've corrected your code, reply to this email with the updated code attached as a zip, or provide a link to the new code for us to review. If you have questions, concerns, or need clarification, please reply to this email and just ask us.


Viewing all articles
Browse latest Browse all 2035