Links in new menu don’t work

You have a script active that prevents normal behaviour of links if they have no target=”_blank” attribute on them. The original site has this attribute on the link to the blog, so that one works. The ‘new’ site doesn’t have it on the menu links, so those links are disabled. To fix this, go to … Read more

How to return a blank page

To return a blank page that’s been created in a plugin like so: Example: blank-page.php <?php // Blank PHP page… Use the following function: add_filter( ‘some_tag’, ‘wpse_238008_blank_page’, 99 ); function wpse_238008_blank_page() { // Template with an empty page define( ‘PLUGIN_PATH’, plugin_dir_path( __FILE__ ) ); return PLUGIN_PATH . ‘/path/to/blank-page.php’; } Replace the following to suit your … Read more

Add a jQuery snippet for sepcific user role

You should be able to use the admin_enqueue_scripts hook to load your snippet on the edit page as seen in this example from the codex function my_enqueue($hook) { if ( ‘edit.php’ != $hook ) { return; } wp_enqueue_script( ‘my_custom_script’, get_template_directory_uri() . ‘/myscript.js’ ); } add_action( ‘admin_enqueue_scripts’, ‘my_enqueue’ );

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