Jump to content
Sign in to follow this  
beardedavenger

Removal of "Store" from non-admin

Recommended Posts

beardedavenger

Hi! I'm running a multisite network with WP. I don't want my users to have access to the Store to download new things, however I DO want them to have access to whatever I activate from the admin level. So, I'd like to hide only the "Add Themes," "Add Plugins," and "Add Sections" from the Store section from non-admins. This way I can activate new stuff from admin level,and it shows in clients store sections on sub-sites. I have a couple other requests as well, and am looking for direction on how to get these taken care of. 1. Change "Vist Pagelines.com" on the bottom of the Store panel. 2. I'm looking to change the tab name "Pagelines" to something else. 3. I need to either remove, or re-link the "View Docs" button that are located throughout the install. Again, brand confusion from the clients point-of-view. I want them to come to me to get help, not the PL forums, as they aren't even a license holder. My clients know that we'll be using Pagelines as a platform, but I do want to reduce brand-confusion as much as possible. I know a pretty good amount of code but unfortunately stringing together functions in php is where my limit stops. Nick


Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
kgstew
Hi Nick, Good news is by default your users will not be able to install store products onto their site through the store. You can buy download and install any products you want and your users will have access to activate them. They can see the store products but cannot control the purchase and install. As far as removing the options to add the store products this is not something that is built in to the framework at this time. You can make these changes to the framework and I would recommend working with a developer if you are not comfortable with using PHP for this function. You will want to avoid modifying the core files of the framework so you can update without overwriting your changes. I would suggest working with your developer to add to the functions.php file or create your own custom plugin for PageLines to customize those changes you would like to your install. Given the number of users maintaining multiuser networks, this type of plugin could be a good inclusion in the store as well. Something to think about if you go ahead and have this developed. -Kyle

Share this post


Link to post
Share on other sites
beardedavenger
Thanks for the response! I want to avoid users seeing something in the store, then coming to me asking whey we don't have XX plugin. Feel me? I am my own developer, not just an average "user." :) A plugin actually sounds like a better route to take so I won't have to stuff the same calls in every child theme functions file. I've already created my own child theme and I know I can target those tabs through functions.php. All I'm looking for is the function to put through. I figured by posting here one of the core developers would know the correct functions to paste in. I know I can modify the core, but I'd rather not because I don't want to re-do things when an update comes along. All about doing it the right way.

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
beardedavenger
Is there anyone I can then hire to build the plugin? Just too much on my plate at the moment..

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
catrina
Hm, I don't have any experience building plugins but perhaps someone else on the forum can (or you can hire someone outside of PageLines to create the plugin you're looking for).

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
beardedavenger
Hiya! Yeah I'm hoping maybe a fellow PageLiner would want the gig. If nobody steps forward I'll have to go elsewhere. I'd likely put this up for everyone. I know I'm not the only one who would find this useful. Just for triple clarification, it's these blue tabs (Sections, Themes, and Plugins) that I want to hide from someone who isn't a super-admin: http://screencast.com/t/0m4sg5e9Enat

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
Simon
OK you need to use a 'mu-plugin', its a special plugin that isn't documented very much. mu-plugins work on normal wordpress but are especially useful on multisite. An mu-plugin loads before any other plugin for every blog on the network, always! And there is no need to activate it either, its like a super plugin. They go in wp-content/mu-plugins/ Any file in that folder with php in it will be auto included. Now, to remove the 'added' tab there is a provided filter: extension_array So 1st make sure you have wp_dev set to true in wp-config.php and also make a new define PL_DEV and make that true too: [code]add_filter( 'extension_array', 'remove_added_tab' ); function remove_added_tab( $d ) { plprint($d); return $d; }[/code] Now visit admin, and in the footer you will see the array that is used to build the tabs dumped to the footer. Use unset() to remove the array parts before the return $d;

Share this post


Link to post
Share on other sites
beardedavenger
Dude, you are THE man. So it basically ends up running like this? Again, this is my weakpoint ... plprint( $d ); unset(); Array ( [Sections] => Array ( [icon] => .... So I'm copy and pasting the entire array correct? ***Edit*** Did a rough lookup on unset and I think it may go more something like this? unset($arr[add_plugins]); I appreciate your help on this!

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
Simon
Fair play for having a try here is the solution: [code]add_filter( 'extension_array', 'remove_added_tab' ); function remove_added_tab( $d ) { // remove tabs from array unset( $d['Sections']['htabs']['add_sections']); unset( $d['Plugins']['htabs']['add_plugins']); unset( $d['Themes']['htabs']['add_themes']); // pass array back to framework return $d; }[/code]

Share this post


Link to post
Share on other sites
beardedavenger
You my friend, are my hero. Works like a freakin' charm. I can't thank you enough. I need to brush up on my PHP big time. I understand how it all worsk, functions, arrays, etc, just need more practice. Do I have your permission to post this finished plugin here? Or post a new thread? Whatever channel you want me to follow. I think this will work great for others in certain applications. **Edit** BTW wp_dev breaks things. ;) It's wp_debug.

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
Simon
Of course, the forum is for sharing :)

Share this post


Link to post
Share on other sites
beardedavenger
OK thanks to Pross above, and my super Bearded Avenger ninja-kick-ass skills, here's the finished Wordpress Multi-Site plugin for hiding the tabs above. http://cl.ly/2O1X0q3G2i35191A0B2Z Instructions 1. Upload add-tab-remover.php to wp-content/plugins/mu-plugins folder on your Wordpress Multi-Site installation. 2. Have a beer. Rock on.

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
Simon
Well done :) The mu-plugin is a very powerful feature, we use it on the demo site to add google ga code to all blogs on the fly. It also strips out all useless dashboard widgets.

Share this post


Link to post
Share on other sites
beardedavenger
...and to you to sir! Yeah they are really helpful. Also you may already know of this place but they carry some wicked awesome mu plugins too (not free). [url="http://premium.wpmudev.org?ref=nphaskins-41965"]http://premium.wpmudev.org[/url] (Affiliate link. Feel like I should say that before you go clickin' and make me a millionaire. ;)

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×