Breaks other plugins settings page
-
Hi,
I found an issue in your plugin which breaks other plugins settings page if they are using the name “fields” as tab name.
Below code snippet from the file wp-members\admin\tab-fields.php changes all the tables id to “wpmem-fields” in other plugins settings page who using the name “fields” for their tab.
This can be easily fix by adding an additional check in the if condition. Currently it only checks for the “tab name”, by just adding “page name” check along with the tab name check will solve this issue.
Change the line
if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'fields' ) {
to
if ( isset( $_GET['page'] ) && $_GET['page'] == 'wpmem-settings' && isset( $_GET['tab'] ) && $_GET['tab'] == 'fields' ) {
add_action( 'admin_footer', 'wpmem_bulk_fields_action' ); function wpmem_bulk_fields_action() { // if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'fields' ) { if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'fields' ) { ?><script type="text/javascript"> (function($) { $(document).ready(function() { $("table").attr("id", "wpmem-fields"); /**$("tr").attr('style', 'cursor:move;');**/ }); })(jQuery); jQuery('<input id="add_field" name="add_field" class="button action" type="submit" value="<?php _e( 'Add Field', 'wp-members' ); ?>" />').appendTo(".top .bulkactions"); jQuery('<input id="add_field" name="add_field" class="button action" type="submit" value="<?php _e( 'Add Field', 'wp-members' ); ?>" />').appendTo(".bottom .bulkactions"); </script><?php } }
Hope you resolve this soon.. this is a blocker for few other plugins.
[moderated to remove blockquotes and put code in backticks.]
- The topic ‘Breaks other plugins settings page’ is closed to new replies.