How can I create a plugin installation link?

Well, looks like I have found the answer. The action should be changed like so: $action = ‘install-plugin’; $slug = ‘akismet’; wp_nonce_url( add_query_arg( array( ‘action’ => $action, ‘plugin’ => $slug ), admin_url( ‘update.php’ ) ), $action.’_’.$slug ); The answer was found in line 275 in the source code: https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-admin/includes/plugin-install.php

Select box saves but doesn’t update value in admin

The second parameter of selected() has to agree with the value attribute of the current <option>. So assuming you have stuffed $selected with the value given by the relevant get_post_meta(), the following should work for you: <label for=”myplugin_meta_box_select”>Status:</label> <select name=”myplugin_meta_box_select” id=”myplugin_meta_box_select”> <option value=”Approved” <?php selected( $selected, ‘Approved’ ); ?>>Approved</option> <option value=”In Progress” <?php selected( $selected, … Read more

Remove query var on admin pages when ‘Save changes’ pressed

This might be useful: there is a filter called removable_query_args. You get an array of argument names to which you can append your own argument. Then WP will take care of removing all of the arguments in the list from the URL. function add_removable_arg($args) { array_push($args, ‘my-query-arg’); return $args; } add_filter(‘removable_query_args’, ‘add_removable_arg’); Something like: ‘…post.php?post=1&my-query-arg=10’ … Read more

Admin Blank Page with Working Front-End After Updating to WordPress 4.6

After debugging this problem, I found this error in the PHP error log located at public_html/mywebsite/wp-admin/error_log: PHP Fatal error: Call to undefined function wp_raise_memory_limit() in /home/example/public_html/mywebsite/wp-admin/admin.php on line 141 This function wp_raise_memory_limit() should be defined in wp-includes/functions.php but it is not defined in my case due to an unsuccessful update by WordPress. So Solution: Do … Read more