Resources

My Agape try

Your Agape try


Support Forum

Current User: Guest Login Register
Please consider registering

Search 
Search Forums:


 




hide elements using remove_meta_box

UserPost

6:22 am
July 3, 2009


piemanek

Member

posts 5

1

Hi

Just a small (and rather picky!) point, but hopefully it's of interest to you.

I notice you use CSS display:none to hide elements on the post/page editing screen from users who do not have full capabilities.

I used to use this in some of my own plugins, but recently discovered that in recent versions of WordPress a much better way is to use remove_meta_box, for example remove_meta_box('passworddiv','post','core').

It's called from the admin_menu hook: add_action( 'admin_menu', 'my_function_to_remove_boxes' );

I think it's a much more secure way of doing it than hiding the divs with CSS.


10:16 am
July 3, 2009


Kevin

Admin

posts 1169

2

piemanek said:

Hi

… recently discovered that in recent versions of WordPress a much better way is to use remove_meta_box, for example remove_meta_box('passworddiv','post','core').



I didn't realize that function would remove any div from the edit form (not just "meta boxes"). Thanks for the tip; the change is now in place in the updated Role Scoper dev snapshot.

11:55 am
July 3, 2009


piemanek

Member

posts 5

3

glad to be of use :-)

and yeah, it's not the best name for the function really, took me a while to discover that too…



Reply to Topic: hide elements using remove_meta_box

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 6 + 9        (Required)

Topic Reply:


 

About the Agapetry forum

Currently Online:

9 Guests

Maximum Online: 88

Forums:

Groups: 2

Forums: 7

Topics: 561

Posts: 2660

Members:

There are 472 members

There are 1 guests


Kevin has made 1169 posts

Top Posters:

metal450 - 98

YikYak - 53

Ragnar - 36

Daisy - 35

LorenW - 33

Administrator: Kevin | Moderators: Kevin