Hide parts of marketpress store settings

Hi all

I'm trying to remove/hide certain parts of marketpress' store settings. Some of the settings just aren't relevant to my network , and some are, I just don't want them to see them.

Within a particular tab, I can hide certain fields or modules with css, so, my question is twofold:
1) Is there a better way than hiding with css? I know its not ideal in terms of semantics, but I'm more concerned about marketpress functionality.
2) How can I hide an entire tab but leave its settings intact?

In both cases, I'd rather not have to alter MP core file.

I've dug up a few threads about this topic, but none really addressed what I'm aiming to do, so if this has already been answered, I apologize.

Thank you!!

  • zeroplusone
    • New Recruit

    Hi Kimberly,

    Thanks. I am using admin-menu-editor, but it only deals w/the menu items on the left hand side in the dashboard (great plugin though).

    I ended up using jquery to remove certain items in marketpress store settings. Since the tabs and many of the modules do not have unique id's or classes, I was going to use something like nth:child to hide them, but browser support isn't as good as jquery. For anyone else interested, this is the bit that I added to functions.php to remove the presentation tab:

    function hide_mp_store_settings(){echo "\n"
    	. '<script type="text/javascript">jQuery(document).ready(function($) {
    	$(\'.nav-tab:eq(2)\').hide();  }); </script>' . "\n"; }
    
    add_action('admin_head', hide_mp_store_settings');

    Could be a much smarter way to achieve this, but its works for me and I haven't noticed any negative side effects.

    Thanks
    Andy

  • aristath
    • Recruit

    I had the same issue.

    In the end I edited marketpress.php file and edited some <tr> elements to make them <tr style="display: none;">.

    It's really a shame thought that we have to hack our plugins. These issues could have easily been avoided if there were simple id's or classes in the admin form elements. This way we'd simply have to add our own css. I propose this becomes a feature request! :slight_smile:

  • xaviemirmon
    • Site Builder, Child of Zeus

    I am using this great piece of code which allows me to create a custom admin area

    <?php
    function my_admin_head() {
            echo '<link rel="stylesheet" type="text/css" href="' .plugins_url('admin.css', __FILE__). '">';
    }
    
    add_action('admin_head', 'my_admin_head');
    ?>

    If you create a folder call it something like "my-plugin" inside you want "my-plugin.php" with the above code and "admin.css" with your custom CSS from there you can change whatever CSS you want. Best of all if the plugin gets updated then you don't lose any of your changes (unless the plugin changes it's CSS syntax) you can also include your function code in this "my-plugin.php" file.

  • aristath
    • Recruit

    @Aaron that's great! I didn't know that...
    However classes would be useful. And I'm saying that 'cause tabs are not the only issue. For example these are the settings/areas of the administration that I 've hidden from my clients:

    • Force Login
    • Product Listings Only
    • Google Analytics Ecommerce Tracking
    • Show Product Image
    • Product Image Size
    • Show Image Lightbox
    • Show Product Thumbnail
    • Product Thumbnail Size
    • Show Excerpts
    • Store URL Slugs
    • Store Page
    • Product Listing Pages

    These are all <tr> elements inside the table on the settings pages.
    If they were for example <tr class="show_product_image"> then I'd be able to hide them using css instead of hacking MarketPress to do <tr style="display:none">.

    The reason for hiding them is simple: I want my users to have a simple environment, no redundant settings and I want some settings to be "permanent" and uniform across the whole network of stores (using the blog templates plugin it's easy to have them all cloned on creation).

      • Tyler Postle
        • CGO

        Hey Pete,

        This post is over 2 years old now, if you are able to create a new one that would be awesome :slight_smile: A lot has changed since then; however, I don't believe using CSS will work to hide the tabs yet.

        Create a new post and we'll be able to assist you with this, plus I'm sure it will help a lot of other members as well! Be easier to find.

        Be sure to include which settings you are wanting to hide in your new thread.

        All the best,
        Tyler

  • mazza
    • Flash Drive

    Sorry to pull up an old post but it works beautifully as is, just wondering if it can be amended to add another tab to hide? say 'shortcodes' which is tab 7? (2,7) breaks it.

    @zeroplusone 's code

    function hide_mp_store_settings(){echo "\n"
    	. '<script type="text/javascript">jQuery(document).ready(function($) {
    	$(\'.nav-tab:eq(2)\').hide();  }); </script>' . "\n"; }
    
    add_action('admin_head', hide_mp_store_settings');

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.