How to retain HTML5 Attributes on Markup

It is enough to add unfiltered_html capability to Editor role. Add the following code into your current theme’s functions.php: function wpse_change_capability() { $role = get_role( ‘editor’ ); if ( ! $role->has_cap( ‘unfiltered_html’ ) ) $role->add_cap( ‘unfiltered_html’ ); } add_action( ‘init’, ‘wpse_change_capability’, 10 ); Login as the user with Editor role. Test it by editing any … Read more

WordPress Admin Thickbox: Remove Margins/Padding

You can use this for a custom stylesheet. Copy and paste all the CSS from the original thickbox.css in your custom stylesheet. Now you can edit your custom CSS and add the code below in your plugin. function get_thickbox() { // Add the original thickbox add_thickbox(); // register your custom stylesheet // Make sure its … Read more

Display Graphs in Admin Pages

Some days ago I also searched for that thing, but haven’t got any suitable option. I used a third party library for showing my graphs and charts. So firstly I’ll suggest you to visit those two directories wp-includes/js/ and wp-admin/js/ Those are the JavaScript libraries included with WordPress by default. If you find nothing to … Read more

Form submit in admin does not set is_admin() true

Ok, here is what I found out to solve the issue: First of all, the form should be posted to admin-post.php 2nd, there should be a hidden variable “action” so the form should be like: <form method=”post” action=”<?php echo esc_url( admin_url(‘admin-post.php’) ); ?>”> <input type=”hidden” name=”action” value=”my_settings_save”> …. </form> Now the is_admin() is true and … Read more

Populate Dropdwon with DIR files, save value and keep it “selected”

You need to add a ‘selected’ value to the option output, so that the html displays the value that’s saved in the psg_settings. Something like this: function psg_dyn_select_1_render ( ) { $options = get_option( ‘psg_settings’ ); $files = glob( plugin_dir_path( __FILE__ ) . “assets/images/*” ); ?> <select name=”psg_settings[psg_dyn_select_1]”> <?php foreach ($files as $filename){ $filename = … Read more

Wp-admin page not found following copy of site

I’ve never used wp-clone so i’ll try to help based on what i see. D id you change the site url and wordpress? When i load your site, css isn’t loading either which generally means you haven’t done that yet. First make sure that your wp-config that you’ve got the right database. You need to … Read more

exclude ID on avatar

Should help, if user isn’t admin show avatar, if user is admin hide avatar. <?php if(!is_admin()) { ?> <div class=”single-post-about-author”> <div class=”author-avatar-w”><?php echo get_avatar(get_the_author_meta( ‘ID’ )); ?> </div> <?php } ?> <div class=”author-details”> <h3 class=”author-name”><?php the_author_meta( ‘display_name’ ); ?></h3> </div>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)